Examples of ServiceConfigurationError


Examples of java.util.ServiceConfigurationError

    /**
     * @tests {@link java.util.ServiceConfigurationError#ServiceConfigurationError(String)}
     */
    @SuppressWarnings("nls")
    public void test_ConstructorLjava_lang_String() {
        ServiceConfigurationError e = new ServiceConfigurationError("fixture");
        assertEquals("fixture", e.getMessage());
        assertNull(e.getCause());
    }
View Full Code Here

Examples of java.util.ServiceConfigurationError

     */
    @SuppressWarnings("nls")
    public void test_ConstructorLjava_lang_StringLjava_lang_Throwable() {
        IllegalArgumentException iae = new IllegalArgumentException(
                "info in the IAE");
        ServiceConfigurationError e = new ServiceConfigurationError("fixture",
                iae);
        assertEquals("fixture", e.getMessage());
        assertEquals(iae, e.getCause());
        assertEquals("info in the IAE", e.getCause().getMessage());
    }
View Full Code Here

Examples of java.util.ServiceConfigurationError

     * @throws Exception
     * @tests serialization/deserialization.
     */
    @SuppressWarnings("nls")
    public void testSerializationSelf() throws Exception {
        SerializationTest.verifySelf(new ServiceConfigurationError("fixture"));
        SerializationTest.verifySelf(new ServiceConfigurationError("fixture",
                new IllegalArgumentException("info in the IAE")));
    }
View Full Code Here

Examples of java.util.ServiceConfigurationError

     * @throws Exception
     * @tests serialization/deserialization compatibility with RI.
     */
    @SuppressWarnings("nls")
    public void testSerializationCompatibility() throws Exception {
        ServiceConfigurationError e = new ServiceConfigurationError("fixture",
                new IllegalArgumentException("info in the IAE"));
        SerializationTest.verifyGolden(this, e);
    }
View Full Code Here

Examples of java.util.ServiceConfigurationError

    this.clazz = clazz;
    try {
      final String fullName = META_INF_SERVICES + clazz.getName();
      this.profilesEnum = (loader == null) ? ClassLoader.getSystemResources(fullName) : loader.getResources(fullName);
    } catch (IOException ioe) {
      throw new ServiceConfigurationError("Error loading SPI profiles for type " + clazz.getName() + " from classpath", ioe);
    }
    this.loader = (loader == null) ? ClassLoader.getSystemClassLoader() : loader;
    this.linesIterator = Collections.<String>emptySet().iterator();
  }
View Full Code Here

Examples of java.util.ServiceConfigurationError

          priorE = ioe;
        } finally {
          IOUtils.closeWhileHandlingException(priorE, in);
        }
      } catch (IOException ioe) {
        throw new ServiceConfigurationError("Error loading SPI class list from URL: " + url, ioe);
      }
      if (!lines.isEmpty()) {
        this.linesIterator = lines.iterator();
        return true;
      }
View Full Code Here

Examples of java.util.ServiceConfigurationError

    final String c = linesIterator.next();
    try {
      // don't initialize the class (pass false as 2nd parameter):
      return Class.forName(c, false, loader).asSubclass(clazz);
    } catch (ClassNotFoundException cnfe) {
      throw new ServiceConfigurationError(String.format(Locale.ROOT, "A SPI class of type %s with classname %s does not exist, "+
        "please fix the file '%s%1$s' in your classpath.", clazz.getName(), c, META_INF_SERVICES));
    }
  }
View Full Code Here

Examples of java.util.ServiceConfigurationError

    static JmsUpdateAgentParameters load(final URL source) {
        try {
            return parse(JAXB.unmarshal(source,
                                        JmsUpdateAgentParametersCi.class));
        } catch (Exception ex) {
            throw new ServiceConfigurationError(String.format(
                    "Failed to load configuration from %s .", source),
                    ex);
        }
    }
View Full Code Here

Examples of java.util.ServiceConfigurationError

                @Override
                public T next() {
                    try {
                        return delegate.next().newInstance();
                    } catch (Exception ex) {
                        throw new ServiceConfigurationError(ex.getLocalizedMessage(), ex);
                    }
                }

                @Override
                public void remove() {
View Full Code Here

Examples of java.util.ServiceConfigurationError

                        return clazz;
                    } else {
                        return (T) Class.forName(clazzName, true, classLoader);
                    }
                } catch (Exception ex) {
                    throw new ServiceConfigurationError(ex.getLocalizedMessage(), ex);
                } finally {
                    clazz = null;
                    clazzName = null;
                }
            } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.