Java Code Examples for java.util.ServiceConfigurationError#printStackTrace()
The following examples show how to use
java.util.ServiceConfigurationError#printStackTrace() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EntityExtractorService.java From CLIFF with Apache License 2.0 | 6 votes |
@SuppressWarnings("rawtypes") public ExtractedEntities extractEntitiesFromSentences(Map[] sentences, boolean manuallyReplaceDemonyms, String langauge){ ExtractedEntities e = new ExtractedEntities(); try { Iterator<EntityExtractor> extractors = loader.iterator(); while (extractors != null && extractors.hasNext()) { EntityExtractor currentExtractor = extractors.next(); ExtractedEntities e2 = currentExtractor.extractEntitiesFromSentences(sentences, manuallyReplaceDemonyms, langauge); e.merge(e2); } } catch (ServiceConfigurationError serviceError) { e = null; serviceError.printStackTrace(); } return e; }
Example 2
Source File: RuntimeManifoldHost.java From manifold with Apache License 2.0 | 6 votes |
private static IRuntimeManifoldHost loadRuntimeManifoldHost() { try { // Allow for the IRuntimeManifoldHost impl to be customised as a Java Service IRuntimeManifoldHost host = loadRuntimeManifoldHost( RuntimeManifoldHost.class.getClassLoader() ); if( host == null ) { host = loadRuntimeManifoldHost( Thread.currentThread().getContextClassLoader() ); } if( host != null ) { return host; } } catch( ServiceConfigurationError e ) { // report, but do not throw, the exception; let the default host takeover e.printStackTrace(); } // default return new RuntimeManifoldHost(); }
Example 3
Source File: EntityExtractorService.java From CLIFF with Apache License 2.0 | 5 votes |
public ExtractedEntities extractEntities(String textToParse, boolean manuallyReplaceDemonyms, String language){ ExtractedEntities e = new ExtractedEntities(); try { Iterator<EntityExtractor> extractors = loader.iterator(); while (extractors != null && extractors.hasNext()) { EntityExtractor currentExtractor = extractors.next(); ExtractedEntities e2 = currentExtractor.extractEntities(textToParse, manuallyReplaceDemonyms, language); e.merge(e2); } } catch (ServiceConfigurationError serviceError) { e = null; serviceError.printStackTrace(); } return e; }
Example 4
Source File: IIORegistry.java From jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
/** * Registers all available service providers found on the * application class path, using the default * <code>ClassLoader</code>. This method is typically invoked by * the <code>ImageIO.scanForPlugins</code> method. * * @see javax.imageio.ImageIO#scanForPlugins * @see ClassLoader#getResources */ public void registerApplicationClasspathSpis() { // FIX: load only from application classpath ClassLoader loader = Thread.currentThread().getContextClassLoader(); Iterator categories = getCategories(); while (categories.hasNext()) { Class<IIOServiceProvider> c = (Class)categories.next(); Iterator<IIOServiceProvider> riter = ServiceLoader.load(c, loader).iterator(); while (riter.hasNext()) { try { // Note that the next() call is required to be inside // the try/catch block; see 6342404. IIOServiceProvider r = riter.next(); registerServiceProvider(r); } catch (ServiceConfigurationError err) { if (System.getSecurityManager() != null) { // In the applet case, we will catch the error so // registration of other plugins can proceed err.printStackTrace(); } else { // In the application case, we will throw the // error to indicate app/system misconfiguration throw err; } } } } }
Example 5
Source File: IIORegistry.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
/** * Registers all available service providers found on the * application class path, using the default * <code>ClassLoader</code>. This method is typically invoked by * the <code>ImageIO.scanForPlugins</code> method. * * @see javax.imageio.ImageIO#scanForPlugins * @see ClassLoader#getResources */ public void registerApplicationClasspathSpis() { // FIX: load only from application classpath ClassLoader loader = Thread.currentThread().getContextClassLoader(); Iterator categories = getCategories(); while (categories.hasNext()) { Class<IIOServiceProvider> c = (Class)categories.next(); Iterator<IIOServiceProvider> riter = ServiceLoader.load(c, loader).iterator(); while (riter.hasNext()) { try { // Note that the next() call is required to be inside // the try/catch block; see 6342404. IIOServiceProvider r = riter.next(); registerServiceProvider(r); } catch (ServiceConfigurationError err) { if (System.getSecurityManager() != null) { // In the applet case, we will catch the error so // registration of other plugins can proceed err.printStackTrace(); } else { // In the application case, we will throw the // error to indicate app/system misconfiguration throw err; } } } } }
Example 6
Source File: IIORegistry.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
/** * Registers all available service providers found on the * application class path, using the default * <code>ClassLoader</code>. This method is typically invoked by * the <code>ImageIO.scanForPlugins</code> method. * * @see javax.imageio.ImageIO#scanForPlugins * @see ClassLoader#getResources */ public void registerApplicationClasspathSpis() { // FIX: load only from application classpath ClassLoader loader = Thread.currentThread().getContextClassLoader(); Iterator categories = getCategories(); while (categories.hasNext()) { Class<IIOServiceProvider> c = (Class)categories.next(); Iterator<IIOServiceProvider> riter = ServiceLoader.load(c, loader).iterator(); while (riter.hasNext()) { try { // Note that the next() call is required to be inside // the try/catch block; see 6342404. IIOServiceProvider r = riter.next(); registerServiceProvider(r); } catch (ServiceConfigurationError err) { if (System.getSecurityManager() != null) { // In the applet case, we will catch the error so // registration of other plugins can proceed err.printStackTrace(); } else { // In the application case, we will throw the // error to indicate app/system misconfiguration throw err; } } } } }
Example 7
Source File: IIORegistry.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
/** * Registers all available service providers found on the * application class path, using the default * <code>ClassLoader</code>. This method is typically invoked by * the <code>ImageIO.scanForPlugins</code> method. * * @see javax.imageio.ImageIO#scanForPlugins * @see ClassLoader#getResources */ public void registerApplicationClasspathSpis() { // FIX: load only from application classpath ClassLoader loader = Thread.currentThread().getContextClassLoader(); Iterator categories = getCategories(); while (categories.hasNext()) { Class<IIOServiceProvider> c = (Class)categories.next(); Iterator<IIOServiceProvider> riter = ServiceLoader.load(c, loader).iterator(); while (riter.hasNext()) { try { // Note that the next() call is required to be inside // the try/catch block; see 6342404. IIOServiceProvider r = riter.next(); registerServiceProvider(r); } catch (ServiceConfigurationError err) { if (System.getSecurityManager() != null) { // In the applet case, we will catch the error so // registration of other plugins can proceed err.printStackTrace(); } else { // In the application case, we will throw the // error to indicate app/system misconfiguration throw err; } } } } }
Example 8
Source File: IIORegistry.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * Registers all available service providers found on the * application class path, using the default * <code>ClassLoader</code>. This method is typically invoked by * the <code>ImageIO.scanForPlugins</code> method. * * @see javax.imageio.ImageIO#scanForPlugins * @see ClassLoader#getResources */ public void registerApplicationClasspathSpis() { // FIX: load only from application classpath ClassLoader loader = Thread.currentThread().getContextClassLoader(); Iterator categories = getCategories(); while (categories.hasNext()) { Class<IIOServiceProvider> c = (Class)categories.next(); Iterator<IIOServiceProvider> riter = ServiceLoader.load(c, loader).iterator(); while (riter.hasNext()) { try { // Note that the next() call is required to be inside // the try/catch block; see 6342404. IIOServiceProvider r = riter.next(); registerServiceProvider(r); } catch (ServiceConfigurationError err) { if (System.getSecurityManager() != null) { // In the applet case, we will catch the error so // registration of other plugins can proceed err.printStackTrace(); } else { // In the application case, we will throw the // error to indicate app/system misconfiguration throw err; } } } } }
Example 9
Source File: IIORegistry.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Registers all available service providers found on the * application class path, using the default * <code>ClassLoader</code>. This method is typically invoked by * the <code>ImageIO.scanForPlugins</code> method. * * @see javax.imageio.ImageIO#scanForPlugins * @see ClassLoader#getResources */ public void registerApplicationClasspathSpis() { // FIX: load only from application classpath ClassLoader loader = Thread.currentThread().getContextClassLoader(); Iterator categories = getCategories(); while (categories.hasNext()) { Class<IIOServiceProvider> c = (Class)categories.next(); Iterator<IIOServiceProvider> riter = ServiceLoader.load(c, loader).iterator(); while (riter.hasNext()) { try { // Note that the next() call is required to be inside // the try/catch block; see 6342404. IIOServiceProvider r = riter.next(); registerServiceProvider(r); } catch (ServiceConfigurationError err) { if (System.getSecurityManager() != null) { // In the applet case, we will catch the error so // registration of other plugins can proceed err.printStackTrace(); } else { // In the application case, we will throw the // error to indicate app/system misconfiguration throw err; } } } } }
Example 10
Source File: IIORegistry.java From Java8CN with Apache License 2.0 | 5 votes |
/** * Registers all available service providers found on the * application class path, using the default * <code>ClassLoader</code>. This method is typically invoked by * the <code>ImageIO.scanForPlugins</code> method. * * @see javax.imageio.ImageIO#scanForPlugins * @see ClassLoader#getResources */ public void registerApplicationClasspathSpis() { // FIX: load only from application classpath ClassLoader loader = Thread.currentThread().getContextClassLoader(); Iterator categories = getCategories(); while (categories.hasNext()) { Class<IIOServiceProvider> c = (Class)categories.next(); Iterator<IIOServiceProvider> riter = ServiceLoader.load(c, loader).iterator(); while (riter.hasNext()) { try { // Note that the next() call is required to be inside // the try/catch block; see 6342404. IIOServiceProvider r = riter.next(); registerServiceProvider(r); } catch (ServiceConfigurationError err) { if (System.getSecurityManager() != null) { // In the applet case, we will catch the error so // registration of other plugins can proceed err.printStackTrace(); } else { // In the application case, we will throw the // error to indicate app/system misconfiguration throw err; } } } } }
Example 11
Source File: IIORegistry.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
/** * Registers all available service providers found on the * application class path, using the default * <code>ClassLoader</code>. This method is typically invoked by * the <code>ImageIO.scanForPlugins</code> method. * * @see javax.imageio.ImageIO#scanForPlugins * @see ClassLoader#getResources */ public void registerApplicationClasspathSpis() { // FIX: load only from application classpath ClassLoader loader = Thread.currentThread().getContextClassLoader(); Iterator categories = getCategories(); while (categories.hasNext()) { Class<IIOServiceProvider> c = (Class)categories.next(); Iterator<IIOServiceProvider> riter = ServiceLoader.load(c, loader).iterator(); while (riter.hasNext()) { try { // Note that the next() call is required to be inside // the try/catch block; see 6342404. IIOServiceProvider r = riter.next(); registerServiceProvider(r); } catch (ServiceConfigurationError err) { if (System.getSecurityManager() != null) { // In the applet case, we will catch the error so // registration of other plugins can proceed err.printStackTrace(); } else { // In the application case, we will throw the // error to indicate app/system misconfiguration throw err; } } } } }
Example 12
Source File: IIORegistry.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Registers all available service providers found on the * application class path, using the default * {@code ClassLoader}. This method is typically invoked by * the {@code ImageIO.scanForPlugins} method. * * @see javax.imageio.ImageIO#scanForPlugins * @see ClassLoader#getResources */ public void registerApplicationClasspathSpis() { // FIX: load only from application classpath ClassLoader loader = Thread.currentThread().getContextClassLoader(); Iterator<Class<?>> categories = getCategories(); while (categories.hasNext()) { @SuppressWarnings("unchecked") Class<IIOServiceProvider> c = (Class<IIOServiceProvider>)categories.next(); Iterator<IIOServiceProvider> riter = ServiceLoader.load(c, loader).iterator(); while (riter.hasNext()) { try { // Note that the next() call is required to be inside // the try/catch block; see 6342404. IIOServiceProvider r = riter.next(); registerServiceProvider(r); } catch (ServiceConfigurationError err) { if (System.getSecurityManager() != null) { // In the applet case, we will catch the error so // registration of other plugins can proceed err.printStackTrace(); } else { // In the application case, we will throw the // error to indicate app/system misconfiguration throw err; } } } } }
Example 13
Source File: IIORegistry.java From Bytecoder with Apache License 2.0 | 5 votes |
/** * Registers all available service providers found on the * application class path, using the default * {@code ClassLoader}. This method is typically invoked by * the {@code ImageIO.scanForPlugins} method. * * @see javax.imageio.ImageIO#scanForPlugins * @see ClassLoader#getResources */ public void registerApplicationClasspathSpis() { // FIX: load only from application classpath ClassLoader loader = Thread.currentThread().getContextClassLoader(); Iterator<Class<?>> categories = getCategories(); while (categories.hasNext()) { @SuppressWarnings("unchecked") Class<IIOServiceProvider> c = (Class<IIOServiceProvider>)categories.next(); Iterator<IIOServiceProvider> riter = ServiceLoader.load(c, loader).iterator(); while (riter.hasNext()) { try { // Note that the next() call is required to be inside // the try/catch block; see 6342404. IIOServiceProvider r = riter.next(); registerServiceProvider(r); } catch (ServiceConfigurationError err) { if (System.getSecurityManager() != null) { // In the applet case, we will catch the error so // registration of other plugins can proceed err.printStackTrace(); } else { // In the application case, we will throw the // error to indicate app/system misconfiguration throw err; } } } } }
Example 14
Source File: IIORegistry.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Registers all available service providers found on the * application class path, using the default * <code>ClassLoader</code>. This method is typically invoked by * the <code>ImageIO.scanForPlugins</code> method. * * @see javax.imageio.ImageIO#scanForPlugins * @see ClassLoader#getResources */ public void registerApplicationClasspathSpis() { // FIX: load only from application classpath ClassLoader loader = Thread.currentThread().getContextClassLoader(); Iterator categories = getCategories(); while (categories.hasNext()) { Class<IIOServiceProvider> c = (Class)categories.next(); Iterator<IIOServiceProvider> riter = ServiceLoader.load(c, loader).iterator(); while (riter.hasNext()) { try { // Note that the next() call is required to be inside // the try/catch block; see 6342404. IIOServiceProvider r = riter.next(); registerServiceProvider(r); } catch (ServiceConfigurationError err) { if (System.getSecurityManager() != null) { // In the applet case, we will catch the error so // registration of other plugins can proceed err.printStackTrace(); } else { // In the application case, we will throw the // error to indicate app/system misconfiguration throw err; } } } } }
Example 15
Source File: IIORegistry.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Registers all available service providers found on the * application class path, using the default * <code>ClassLoader</code>. This method is typically invoked by * the <code>ImageIO.scanForPlugins</code> method. * * @see javax.imageio.ImageIO#scanForPlugins * @see ClassLoader#getResources */ public void registerApplicationClasspathSpis() { // FIX: load only from application classpath ClassLoader loader = Thread.currentThread().getContextClassLoader(); Iterator categories = getCategories(); while (categories.hasNext()) { Class<IIOServiceProvider> c = (Class)categories.next(); Iterator<IIOServiceProvider> riter = ServiceLoader.load(c, loader).iterator(); while (riter.hasNext()) { try { // Note that the next() call is required to be inside // the try/catch block; see 6342404. IIOServiceProvider r = riter.next(); registerServiceProvider(r); } catch (ServiceConfigurationError err) { if (System.getSecurityManager() != null) { // In the applet case, we will catch the error so // registration of other plugins can proceed err.printStackTrace(); } else { // In the application case, we will throw the // error to indicate app/system misconfiguration throw err; } } } } }
Example 16
Source File: IIORegistry.java From JDKSourceCode1.8 with MIT License | 5 votes |
/** * Registers all available service providers found on the * application class path, using the default * <code>ClassLoader</code>. This method is typically invoked by * the <code>ImageIO.scanForPlugins</code> method. * * @see javax.imageio.ImageIO#scanForPlugins * @see ClassLoader#getResources */ public void registerApplicationClasspathSpis() { // FIX: load only from application classpath ClassLoader loader = Thread.currentThread().getContextClassLoader(); Iterator categories = getCategories(); while (categories.hasNext()) { Class<IIOServiceProvider> c = (Class)categories.next(); Iterator<IIOServiceProvider> riter = ServiceLoader.load(c, loader).iterator(); while (riter.hasNext()) { try { // Note that the next() call is required to be inside // the try/catch block; see 6342404. IIOServiceProvider r = riter.next(); registerServiceProvider(r); } catch (ServiceConfigurationError err) { if (System.getSecurityManager() != null) { // In the applet case, we will catch the error so // registration of other plugins can proceed err.printStackTrace(); } else { // In the application case, we will throw the // error to indicate app/system misconfiguration throw err; } } } } }
Example 17
Source File: IIORegistry.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * Registers all available service providers found on the * application class path, using the default * <code>ClassLoader</code>. This method is typically invoked by * the <code>ImageIO.scanForPlugins</code> method. * * @see javax.imageio.ImageIO#scanForPlugins * @see ClassLoader#getResources */ public void registerApplicationClasspathSpis() { // FIX: load only from application classpath ClassLoader loader = Thread.currentThread().getContextClassLoader(); Iterator categories = getCategories(); while (categories.hasNext()) { Class<IIOServiceProvider> c = (Class)categories.next(); Iterator<IIOServiceProvider> riter = ServiceLoader.load(c, loader).iterator(); while (riter.hasNext()) { try { // Note that the next() call is required to be inside // the try/catch block; see 6342404. IIOServiceProvider r = riter.next(); registerServiceProvider(r); } catch (ServiceConfigurationError err) { if (System.getSecurityManager() != null) { // In the applet case, we will catch the error so // registration of other plugins can proceed err.printStackTrace(); } else { // In the application case, we will throw the // error to indicate app/system misconfiguration throw err; } } } } }
Example 18
Source File: IIORegistry.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Registers all available service providers found on the * application class path, using the default * <code>ClassLoader</code>. This method is typically invoked by * the <code>ImageIO.scanForPlugins</code> method. * * @see javax.imageio.ImageIO#scanForPlugins * @see ClassLoader#getResources */ public void registerApplicationClasspathSpis() { // FIX: load only from application classpath ClassLoader loader = Thread.currentThread().getContextClassLoader(); Iterator categories = getCategories(); while (categories.hasNext()) { Class<IIOServiceProvider> c = (Class)categories.next(); Iterator<IIOServiceProvider> riter = ServiceLoader.load(c, loader).iterator(); while (riter.hasNext()) { try { // Note that the next() call is required to be inside // the try/catch block; see 6342404. IIOServiceProvider r = riter.next(); registerServiceProvider(r); } catch (ServiceConfigurationError err) { if (System.getSecurityManager() != null) { // In the applet case, we will catch the error so // registration of other plugins can proceed err.printStackTrace(); } else { // In the application case, we will throw the // error to indicate app/system misconfiguration throw err; } } } } }
Example 19
Source File: IIORegistry.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
/** * Registers all available service providers found on the * application class path, using the default * <code>ClassLoader</code>. This method is typically invoked by * the <code>ImageIO.scanForPlugins</code> method. * * @see javax.imageio.ImageIO#scanForPlugins * @see ClassLoader#getResources */ public void registerApplicationClasspathSpis() { // FIX: load only from application classpath ClassLoader loader = Thread.currentThread().getContextClassLoader(); Iterator categories = getCategories(); while (categories.hasNext()) { Class<IIOServiceProvider> c = (Class)categories.next(); Iterator<IIOServiceProvider> riter = ServiceLoader.load(c, loader).iterator(); while (riter.hasNext()) { try { // Note that the next() call is required to be inside // the try/catch block; see 6342404. IIOServiceProvider r = riter.next(); registerServiceProvider(r); } catch (ServiceConfigurationError err) { if (System.getSecurityManager() != null) { // In the applet case, we will catch the error so // registration of other plugins can proceed err.printStackTrace(); } else { // In the application case, we will throw the // error to indicate app/system misconfiguration throw err; } } } } }
Example 20
Source File: ObfuscationServices.java From Mixin with MIT License | 4 votes |
/** * Initialise services * * @param ap annotation processor */ public void initProviders(IMixinAnnotationProcessor ap) { boolean defaultIsPresent = false; try { for (IObfuscationService service : this.serviceLoader) { if (!this.services.contains(service)) { this.services.add(service); String serviceName = service.getClass().getSimpleName(); // ap.printMessage(Kind.NOTE, "Preparing service " + serviceName); Collection<ObfuscationTypeDescriptor> obfTypes = service.getObfuscationTypes(ap); if (obfTypes != null) { for (ObfuscationTypeDescriptor obfType : obfTypes) { try { ObfuscationType type = ObfuscationType.create(obfType, ap); ap.printMessage(Kind.NOTE, serviceName + " supports type: \"" + type + "\""); defaultIsPresent |= type.isDefault(); } catch (Exception ex) { ex.printStackTrace(); } } } } } } catch (ServiceConfigurationError serviceError) { ap.printMessage(Kind.ERROR, serviceError.getClass().getSimpleName() + ": " + serviceError.getMessage()); serviceError.printStackTrace(); } if (!defaultIsPresent) { String defaultEnv = ap.getOption(SupportedOptions.DEFAULT_OBFUSCATION_ENV); if (defaultEnv == null) { ap.printMessage(Kind.WARNING, "No default obfuscation environment was specified and \"" + ObfuscationType.DEFAULT_TYPE + "\" is not available. Please ensure defaultObfuscationEnv is specified in your build configuration"); } else { ap.printMessage(Kind.WARNING, "Specified default obfuscation environment \"" + defaultEnv.toLowerCase(Locale.ROOT) + "\" was not defined. This probably means your build configuration is out of date or a required service is missing"); } } }