You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by "Guillaume Nodet (JIRA)" <ji...@apache.org> on 2009/02/19 10:35:59 UTC

[jira] Commented: (SMX4NMR-97) The JBI components classloader sometime fails to load classes or resources

    [ https://issues.apache.org/activemq/browse/SMX4NMR-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=49769#action_49769 ] 

Guillaume Nodet commented on SMX4NMR-97:
----------------------------------------

Sending        jbi/deployer/pom.xml
Sending        jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/ComponentInstaller.java
Transmitting file data ..
Committed revision 745789.

This patch uses extracted jars to create the component classloader instead of looking at the jar using bundle:// urls

> The JBI components classloader sometime fails to load classes or resources
> --------------------------------------------------------------------------
>
>                 Key: SMX4NMR-97
>                 URL: https://issues.apache.org/activemq/browse/SMX4NMR-97
>             Project: ServiceMix NMR
>          Issue Type: Bug
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: 1.0.0
>
>
> ProcessStoreImpl-1@24390 daemon, priority=5, in group 'main', status: 'RUNNING'
>          at org.apache.felix.framework.URLHandlersBundleStreamHandler.openConnection(URLHandlersBundleStreamHandler.java:69)
>          at java.net.URL.openConnection(URL.java:943)
>          at sun.net.www.protocol.jar.JarURLConnection.<init>(JarURLConnection.java:64)
>          at sun.net.www.protocol.jar.Handler.openConnection(Handler.java:24)
>          at java.net.URL.openConnection(URL.java:943)
>          at java.net.URL.openStream(URL.java:1,007)
>          at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1,216)
>          at java.lang.Class.getResourceAsStream(Class.java:1,998)
>          at org.apache.openjpa.conf.OpenJPAVersion.<clinit>(OpenJPAVersion.java:50)
>          at org.apache.openjpa.kernel.AbstractBrokerFactory.getFactoryInitializationBanner(AbstractBrokerFactory.java:663)
>          at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:616)
>          at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:183)
>          at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
>          at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192)
>          at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:145)
>          at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56)
>          at org.apache.ode.store.jpa.DbConfStoreConnectionFactory.getConnection(DbConfStoreConnectionFactory.java:49)
>          at org.apache.ode.store.ProcessStoreImpl.getConnection(ProcessStoreImpl.java:549)
>          at org.apache.ode.store.ProcessStoreImpl.access$300(ProcessStoreImpl.java:74)
>          at org.apache.ode.store.ProcessStoreImpl$Callable.call(ProcessStoreImpl.java:698)
>          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
>          at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>          at java.lang.Thread.run(Thread.java:613)
> The reason is that the jbi classloader is create with bundle urls
> pointing to the libraries embedded in the component.
> For example:
>    bundle://72.0:1/lib/openjpa-1.1.0.jar
> Those URLs are resolved correctly to locate resources, so we end up
> with urls like:
>    jar:bundle://72.0:1/lib/openjpa-1.1.0.jar!/org/apache/openjpa/kernel/localizer.properties
> Now, the problem is that they fail to be opened at the above point in
> the code.  THis is because Felix is trying to find on the stack trace
> a classloader which is of  type
> org.apache.felix.framework.searchpolicy.ContentClassLoader (in the
> URLHandlers#getFrameworkContext() method).  But there's none because
> all classes  are loaded from the JBI component classloader instead of
> a felix classloader in this case.

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