DefaultPackageScanClassResolver can't read entries in an eclipse rcp app 
because it can't handle bundleresource - protocol
--------------------------------------------------------------------------------------------------------------------------

                 Key: CAMEL-2663
                 URL: https://issues.apache.org/activemq/browse/CAMEL-2663
             Project: Apache Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 2.2.0
         Environment: Windows, Eclipse 3.5.2
            Reporter: Christoph Dittberner


scenario:

I have an eclipse rcp based app and use the apache camel libs within my plugin, 
i.e. the libs are one classpath of the plugin. I use a route using camel-mail 
to process some mailqueues.

CamelContext context = new DefaultCamelContext();
context.addRoutes(new RouteBuilder() {
    public void configure()     {
        
from("imaps://mailserver?username=user&password=password&consumer.delay=5000&delete=false&unseen=true")
            .to("log: new mail");
   }});
   context.start();

When I start my app all seems to be ok. But in my log I get a lot of error 
messages regarding the loading of converters. If I ask my context to find a 
converter f.i. to converty to byte[] form inputstream (as I did see in another 
mail example reagding attachments) I get null because the context can't find 
one.

I debugged  deeper into the camel code and it seems that the 
DefaultPackageScanClassResolver can't load from urls starting with 
bundleresource like 
"bundleresource://109.fwk32380043:4/org/apache/camel/component/file/"

using camel-osgi didn't worked because all camel libs are loaded as inner libs 
of my single plugin and not as plugins. (loading as plugins didn't worked but 
thats another problem/bug)

 
LOG Messages:

2010-04-21 11:15:34,829 DEBUG 
org.apache.camel.impl.converter.DefaultTypeConverter loadTypeConverters - 
Loading type converters ...
2010-04-21 11:15:34,829 DEBUG 
org.apache.camel.impl.DefaultPackageScanClassResolver findAnnotated - Searching 
for annotations of org.apache.camel.Converter in packages: 
[org.apache.camel.component.file, org.apache.camel.component.bean, 
org.apache.camel.converter, org.apache.camel.component.mail, 
org.apache.camel.component.spring.integration.converter]
2010-04-21 11:15:34,829 DEBUG 
org.apache.camel.impl.DefaultPackageScanClassResolver getClassLoaders - The 
thread context class loader: 
org.eclipse.core.runtime.internal.adaptor.contextfin...@1a76eff  is used to 
load the class
2010-04-21 11:15:34,829 DEBUG 
org.apache.camel.impl.DefaultPackageScanClassResolver find - Searching for: 
annotated with @Converter in package: org/apache/camel/component/file using 
classloader: org.eclipse.core.runtime.internal.adaptor.ContextFinder
2010-04-21 11:15:39,954 DEBUG 
org.apache.camel.impl.DefaultPackageScanClassResolver getResources - Getting 
resource URL for package: org/apache/camel/component/file with classloader: 
org.eclipse.core.runtime.internal.adaptor.contextfin...@1a76eff
2010-04-21 11:16:44,970 DEBUG 
org.apache.camel.impl.DefaultPackageScanClassResolver find - URL from 
classloader: bundleresource://109.fwk32380043:4/org/apache/camel/component/file/
2010-04-21 11:17:01,642 DEBUG 
org.apache.camel.impl.DefaultPackageScanClassResolver find - Decoded urlPath: 
/org/apache/camel/component/file/ with protocol: bundleresource
2010-04-21 11:23:59,814 DEBUG 
org.apache.camel.impl.DefaultPackageScanClassResolver find - isLocalFileSystem: 
false
2010-04-21 11:24:00,470 DEBUG 
org.apache.camel.impl.DefaultPackageScanClassResolver find - Scanning for 
classes in [/org/apache/camel/component/file/] matching criteria: annotated 
with @Converter
2010-04-21 11:24:16,079 DEBUG 
org.apache.camel.impl.DefaultPackageScanClassResolver find - Loading from jar 
using http/https: /org/apache/camel/component/file/
2010-04-21 11:24:26,626 DEBUG 
org.apache.camel.impl.DefaultPackageScanClassResolver find - Cannot read 
entries in url: 
bundleresource://109.fwk32380043:4/org/apache/camel/component/file/
java.net.MalformedURLException: no protocol: /org/apache/camel/component/file/
        at java.net.URL.<init>(URL.java:567)
        at java.net.URL.<init>(URL.java:464)
        at java.net.URL.<init>(URL.java:413)
        at 
org.apache.camel.impl.DefaultPackageScanClassResolver.find(DefaultPackageScanClassResolver.java:264)
        at 
org.apache.camel.impl.DefaultPackageScanClassResolver.find(DefaultPackageScanClassResolver.java:180)
        at 
org.apache.camel.impl.DefaultPackageScanClassResolver.findAnnotated(DefaultPackageScanClassResolver.java:100)
        at 
org.apache.camel.impl.converter.AnnotationTypeConverterLoader.load(AnnotationTypeConverterLoader.java:63)
        at 
org.apache.camel.impl.converter.DefaultTypeConverter.loadTypeConverters(DefaultTypeConverter.java:361)
        at 
org.apache.camel.impl.converter.DefaultTypeConverter.doStart(DefaultTypeConverter.java:384)
        at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:53)
        at 
org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:49)
        at 
org.apache.camel.impl.DefaultCamelContext.startServices(DefaultCamelContext.java:1174)
        at 
org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:644)
        at 
org.apache.camel.impl.DefaultCamelContext.getTypeConverter(DefaultCamelContext.java:691)
        at 
org.apache.camel.util.CamelContextHelper.convertTo(CamelContextHelper.java:68)


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to