Yes, this is definitely a class loader issue. In DefaultfactoryFinder:

    private <T> T newInstance(String key, Injector injector, String
propertyPrefix, Class<T> expectedType)
        throws IOException, ClassNotFoundException {
        Class<?> type = findClass(key, propertyPrefix);
        Object value = injector.newInstance(type);
        if (expectedType.isInstance(value)) {
            return expectedType.cast(value);
        } else {
            throw new ClassCastException("Not instanceof " +
expectedType.getName() + " value: " + value);
        }
    }

Stepping through the code, the Object 'value' created by the injector has
the classloader from the Maven Jetty plugin, whereas the 'expectedType'
classloader is null (the bootstrap class loader I assume), so isInstance is
always going to be false.

I'll look more closely at the web app and see why this is the case.



--
View this message in context: 
http://camel.465427.n5.nabble.com/java-lang-ClassCastException-Not-instanceof-org-apache-camel-TypeConverter-value-org-apache-camel-cor-tp5755390p5755432.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to