ResolverUtil under OSGi error: Could not search jar file
'/org/apache/camel/converter'
--------------------------------------------------------------------------------------
Key: CAMEL-774
URL: https://issues.apache.org/activemq/browse/CAMEL-774
Project: Apache Camel
Issue Type: Bug
Components: camel-core, camel-osgi, camel-stream
Affects Versions: 1.4.0
Environment: Linux/Ubuntu, Maven 2.0.9, Camel 1.4.0, Spring 2.5.5,
Spring-DM 1.1.0
Reporter: Hendy Irawan
This is a sequel of CAMEL-577, which itself duplicated by CAMEL-558 and
CAMEL-522. Probably related to CAMEL-636, CAMEL-693, and CAMEL-689.
First of all, to even get this to "work" requires my own bundle to have this
manifest:
DynamicImport-Package: org.apache.camel.*
Failing to do so will result in more classloading errors.
Even so, it still fails with this:
[SpringOsgiExtenderThread-2] TRACE org.apache.camel.util.ResolverUtil - Testing
for class org.apache.camel.converter.jaxp.XmlConverter matches criteria
[annotated with @Converter]
[SpringOsgiExtenderThread-2] TRACE org.apache.camel.util.ResolverUtil - Found
class: class org.apache.camel.converter.jaxp.XmlConverter in classloader:
BundleDelegatingClassLoader for [org.elfattah.shell (org.elfattah.shell)]
[SpringOsgiExtenderThread-2] TRACE org.apache.camel.util.ResolverUtil - Testing
for class
org.apache.camel.converter.stream.StreamCacheConverter$StreamSourceCache
matches criteria [annotated with @Converter]
[SpringOsgiExtenderThread-2] TRACE org.apache.camel.util.ResolverUtil - Testing
for class
org.apache.camel.converter.stream.StreamCacheConverter$InputStreamCache matches
criteria [annotated with @Converter]
[SpringOsgiExtenderThread-2] TRACE org.apache.camel.util.ResolverUtil -
Searching for: annotated with @Converter in package: org/apache/camel/converter
using classloader: org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader
[SpringOsgiExtenderThread-2] TRACE org.apache.camel.util.ResolverUtil - It's
not an osgi bundle classloader
[SpringOsgiExtenderThread-2] TRACE org.apache.camel.util.ResolverUtil - Getting
resource URL for package: org/apache/camel/converter with classloader: [EMAIL
PROTECTED]
[SpringOsgiExtenderThread-2] TRACE org.apache.camel.util.ResolverUtil - URL
from classloader: bundleresource://20/org/apache/camel/converter
[SpringOsgiExtenderThread-2] TRACE org.apache.camel.util.ResolverUtil - Decoded
urlPath: /org/apache/camel/converter
[SpringOsgiExtenderThread-2] TRACE org.apache.camel.util.ResolverUtil -
Scanning for classes in [/org/apache/camel/converter] matching criteria:
annotated with @Converter
[SpringOsgiExtenderThread-2] DEBUG org.apache.camel.util.ResolverUtil - Loading
from jar: /org/apache/camel/converter
[SpringOsgiExtenderThread-2] ERROR org.apache.camel.util.ResolverUtil - Could
not search jar file '/org/apache/camel/converter' for classes matching
criteria: annotated with @Converter due to an IOException:
/org/apache/camel/converter (No such file or directory)
java.io.FileNotFoundException: /org/apache/camel/converter (No such file or
directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at
org.apache.camel.util.ResolverUtil.loadImplementationsInJar(ResolverUtil.java:476)
at org.apache.camel.util.ResolverUtil.find(ResolverUtil.java:362)
at org.apache.camel.util.ResolverUtil.find(ResolverUtil.java:277)
at
org.apache.camel.util.ResolverUtil.findAnnotated(ResolverUtil.java:253)
at
org.apache.camel.impl.converter.AnnotationTypeConverterLoader.load(AnnotationTypeConverterLoader.java:66)
at
org.apache.camel.impl.converter.DefaultTypeConverter.checkLoaded(DefaultTypeConverter.java:218)
at
org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:64)
at
org.apache.camel.util.IntrospectionSupport.convert(IntrospectionSupport.java:216)
at
org.apache.camel.util.IntrospectionSupport.setProperty(IntrospectionSupport.java:194)
at
org.apache.camel.util.IntrospectionSupport.setProperties(IntrospectionSupport.java:167)
at
org.apache.camel.impl.DefaultComponent.setProperties(DefaultComponent.java:187)
at
org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:89)
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:270)
at
org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:52)
at org.apache.camel.model.RouteType.resolveEndpoint(RouteType.java:100)
at
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:102)
at
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:108)
at org.apache.camel.model.FromType.resolveEndpoint(FromType.java:73)
at
org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:77)
at org.apache.camel.model.RouteType.addRoutes(RouteType.java:214)
at org.apache.camel.model.RouteType.addRoutes(RouteType.java:90)
at
org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:537)
at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:529)
at
org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:149)
at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:47)
at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
at
org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
at
org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:275)
at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:737)
at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.finishRefresh(AbstractDelegatedExecutionApplicationContext.java:306)
at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:279)
at
org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:145)
at java.lang.Thread.run(Thread.java:619)
[SpringOsgiExtenderThread-2] DEBUG org.apache.camel.util.ResolverUtil - Found:
[class org.apache.camel.converter.ObjectConverter, class
org.apache.camel.converter.jaxp.DomConverter, class
org.apache.camel.converter.IOConverter, class
org.apache.camel.converter.jaxp.StaxConverter, class
org.apache.camel.converter.jaxp.XmlConverter, class
org.apache.camel.converter.stream.StreamCacheConverter, class
org.apache.camel.converter.jaxp.StreamSourceConverter, class
org.apache.camel.converter.NIOConverter, class
org.apache.camel.converter.CollectionConverter, class
org.apache.camel.converter.CamelConverter]
The project that demonstrates this error is open source, check it out here:
http://svn.assembla.com/svn/elfattah/trunk
do mvn install on elfattah-api and elfattah-shell
Then go to elfattah-shell and:
mvn pax:provision
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.