I don't think this is a good idea to do that. See section 7.3 of the JBI specs: the boostrap classloader should not include the shared libraries:
"The execution class loader adds one more item to be supported: shared libraries, which are described in section 7.3.2, below." Could you please revert the commit and close the bug with "Work as designed" ? On Tue, Feb 24, 2009 at 05:19, <[email protected]> wrote: > Author: ffang > Date: Tue Feb 24 04:19:59 2009 > New Revision: 747272 > > URL: http://svn.apache.org/viewvc?rev=747272&view=rev > Log: > [SMX4KNL-209]ComponentInstaller.createBootstrap() should add component's > SharedLib when create MultipleParentClassLoader > > Modified: > > servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/ComponentInstaller.java > > Modified: > servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/ComponentInstaller.java > URL: > http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/ComponentInstaller.java?rev=747272&r1=747271&r2=747272&view=diff > ============================================================================== > --- > servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/ComponentInstaller.java > (original) > +++ > servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/ComponentInstaller.java > Tue Feb 24 04:19:59 2009 > @@ -320,12 +320,24 @@ > ClassLoader oldCl = Thread.currentThread().getContextClassLoader(); > ComponentDesc descriptor = installationContext.getDescriptor(); > try { > + List<SharedLibrary> libs = new ArrayList<SharedLibrary>(); > + if (descriptor.getSharedLibraries() != null) { > + for (SharedLibraryList sll : > descriptor.getSharedLibraries()) { > + SharedLibrary lib = > deployer.getSharedLibrary(sll.getName()); > + if (lib == null) { > + // TODO: throw exception here ? > + } else { > + libs.add(lib); > + } > + } > + } > + SharedLibrary[] aLibs = libs.toArray(new > SharedLibrary[libs.size()]); > ClassLoader cl = createClassLoader( > getBundle(), > installationContext.getInstallRoot(), > descriptor.getBootstrapClassPath().getPathElements(), > descriptor.isBootstrapClassLoaderDelegationParentFirst(), > - null); > + aLibs); > Thread.currentThread().setContextClassLoader(cl); > Class bootstrapClass = > cl.loadClass(descriptor.getBootstrapClassName()); > return (Bootstrap) bootstrapClass.newInstance(); > > > -- Cheers, Guillaume Nodet ------------------------ Blog: http://gnodet.blogspot.com/ ------------------------ Open Source SOA http://fusesource.com
