ServiceMix has the spring jars inside its classpath, so it is also available to the components. But if you want your component to be container independant, you have to include it.
Cheers, Guillaume Nodet On 4/29/06, Hossam Karim <[EMAIL PROTECTED]> wrote:
I guess you mean the component class loader. Do I really need to do that, add the library to the runtime and deploy it again with the component installation artifact? This means also that Spring libraries have to be in the component class path as well in order to create the beans. -----Original Message----- From: Guillaume Nodet [mailto:[EMAIL PROTECTED] Sent: Friday, April 28, 2006 11:03 PM To: [email protected] Subject: Re: Class loading problem Did you put your jar in the bootstrap class loader (in your jbi descriptor) ? Not only in the runtime class loader ? Cheers, Guillaume Nodet On 4/28/06, Hossam Karim <[EMAIL PROTECTED]> wrote: > BTW, I set the bean reader to use the component's class loader, but still > Spring can't find the class. > > On 4/28/06, Hossam Karim <[EMAIL PROTECTED]> wrote: > > > > Thanks Guillaume and congratulations, > > > > OK, then. I am not going to argue about why this is not the case in the > > JBoss environment since it is not supported. > > Now I moved the shared code to the lib directory, so the Bootstrap is > > initialized. The component implementation base class is also in this shared > > code, I am trying to load some beans from the shared code, and the bean > > class comes with the component installation artifact, so I am asking the JBI > > class loader to load resources available only to the component class loader > > which is also NOT JBI complaint, right? > > Do you suggest a solution for this? > > > > INFO - AbstractBootstrapAdapter.init(17) | init > > INFO - AbstractBootstrapAdapter.onInstall(30) | onInstall > > INFO - AbstractBootstrapAdapter.cleanUp(21) | cleanUp > > INFO - ComponentMBeanImpl.start(206) | Starting component: > > com.gaiati.jbi.component.csi.CsiBinding > > INFO - ComponentMBeanImpl.init(184) | Initializing component: > > com.gaiati.jbi.component.csi.CsiBinding > > INFO - AbstractComponentAdapter.getLifeCycle (35) | getLifeCycle > > INFO - AbstractComponentAdapter.init(45) | init > > ERROR - ComponentMBeanImpl.start(215) | Could not start component > > org.springframework.beans.factory.BeanDefinitionStoreException: Error > > registering bean with name 'serviceUnitManager' defined in resource loaded > > through InputStream: Bean class > > com.gaiati.jbi.component.csi.CsiServiceUnitManager] not found; nested > > exception is java.lang.ClassNotFoundException: > > com.gaiati.jbi.component.csi.CsiServiceUnitManager > > java.lang.ClassNotFoundException: > > com.gaiati.jbi.component.csi.CsiServiceUnitManager > > at > > org.apache.servicemix.jbi.loaders.ParentFirstClassLoader.loadClass( > > ParentFirstClassLoader.java:83) > > > > at > > org.apache.servicemix.jbi.loaders.InstallationClassLoader.loadClass( > > InstallationClassLoader.java :99) > > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) > > at java.lang.Class.forName0(Native Method) > > at java.lang.Class.forName(Class.java:242) > > at org.springframework.util.ClassUtils.forName (ClassUtils.java > > :108) > > at > > org.springframework.beans.factory.support.BeanDefinitionReaderUtils.createBe anDefinition > > (BeanDefinitionReaderUtils.java:65) > > at > > org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBe anDefinitionElement( > > DefaultXmlBeanDefinitionParser.java:426) > > at > > org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBe anDefinitionElement > > (DefaultXmlBeanDefinitionParser.java:392) > > at > > org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBe anDefinitions( > > DefaultXmlBeanDefinitionParser.java:307) > > at > > org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.registe rBeanDefinitions > > (DefaultXmlBeanDefinitionParser.java:191) > > at > > org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDe finitions( > > XmlBeanDefinitionReader.java:295) > > at > > org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefi nitions > > (XmlBeanDefinitionReader.java:223) > > at > > org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefini tions( > > XmlBeanDefinitionReader.java:173) > > at > > org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefini tions > > (XmlBeanDefinitionReader.java:148) > > at com.gaiati.jbi.component.support.AbstractComponentAdapter.init( > > AbstractComponentAdapter.java:60) > > at org.apache.servicemix.jbi.framework.ComponentMBeanImpl.init( > > ComponentMBeanImpl.java:192) > > at org.apache.servicemix.jbi.framework.ComponentMBeanImpl.doStart( > > ComponentMBeanImpl.java :279) > > at org.apache.servicemix.jbi.framework.ComponentMBeanImpl.start( > > ComponentMBeanImpl.java:208) > > at org.apache.servicemix.jbi.framework.InstallationService.install > > (InstallationService.java:377) > > > > at org.apache.servicemix.jbi.framework.InstallationService.install > > (InstallationService.java:342) > > at > > org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive( > > AutoDeploymentService.java:220) > > at org.apache.servicemix.jbi.framework.AutoDeploymentService$2.run > > (AutoDeploymentService.java:507) > > at org.apache.geronimo.connector.work.WorkerContext.run( > > WorkerContext.java:291) > > at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source) > > at java.lang.Thread.run(Thread.java:595) > > > > On 4/28/06, Guillaume Nodet <[EMAIL PROTECTED] > wrote: > > > > > > AFAIK, this is not JBI compliant. > > > See section 7.3 of the jbi spec. > > > > > > Cheers, > > > Guillaume Nodet > > > > > > On 4/28/06, Hossam Karim <[EMAIL PROTECTED]> wrote: > > > > Hi All, > > > > I have a class loading problem that is only happening when running > > > SM in > > > > standalone mode. When SM is hosted inside JBoss, there is no problem. > > > > The situation is like this: > > > > I have component with its Bootstrap implementation class extending a > > > class > > > > in an installed shared library. The component is referencing the > > > shared > > > > library in its deployment descriptor. I install the shared library > > > first > > > > then install the component, NoClassDefFoundError exception is thrown > > > upon > > > > installation. > > > > > > > > Here is the trace: > > > > > > > > INFO - AutoDeploymentService$2.run(504) | Directory: install: Archive > > > > changed: processing csi-0.1.jar ... > > > > ERROR - InstallationService.initializeInstaller(528) | Deployment of > > > > Component failed > > > > java.lang.NoClassDefFoundError: > > > > com/gaiati/jbi/component/support/AbstractBootstrapAdapter > > > > at java.lang.ClassLoader.defineClass1(Native Method) > > > > at java.lang.ClassLoader.defineClass (ClassLoader.java:620) > > > > at java.security.SecureClassLoader.defineClass( > > > > SecureClassLoader.java:124) > > > > at java.net.URLClassLoader.defineClass(URLClassLoader.java > > > :260) > > > > at java.net.URLClassLoader.access$100(URLClassLoader.java:56) > > > > at java.net.URLClassLoader$1.run(URLClassLoader.java:195) > > > > at java.security.AccessController.doPrivileged(Native Method) > > > > at java.net.URLClassLoader.findClass(URLClassLoader.java:188) > > > > at > > > > org.apache.servicemix.jbi.loaders.InstallationClassLoader.findClass( > > > > InstallationClassLoader.java:88) > > > > at > > > > org.apache.servicemix.jbi.loaders.ParentFirstClassLoader.loadClass( > > > > ParentFirstClassLoader.java:74) > > > > at > > > > org.apache.servicemix.jbi.loaders.InstallationClassLoader.loadClass( > > > > InstallationClassLoader.java :99) > > > > at > > > > org.apache.servicemix.jbi.framework.InstallerMBeanImpl.createBootstrap > > > ( > > > > InstallerMBeanImpl.java:84) > > > > at org.apache.servicemix.jbi.framework.InstallerMBeanImpl.<init>( > > > > > > > InstallerMBeanImpl.java:74) > > > > at > > > > > > > org.apache.servicemix.jbi.framework.InstallationService.initializeInstaller > > > ( > > > > InstallationService.java:520) > > > > at > > > > > > > org.apache.servicemix.jbi.framework.InstallationService.doInstallComponent( > > > > InstallationService.java:475) > > > > at > > > > > > > org.apache.servicemix.jbi.framework.InstallationService.doInstallArchive > > > ( > > > > InstallationService.java:427) > > > > at > > > org.apache.servicemix.jbi.framework.InstallationService.install ( > > > > InstallationService.java:349) > > > > at > > > org.apache.servicemix.jbi.framework.InstallationService.install( > > > > InstallationService.java:342) > > > > at > > > > > > > org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive( > > > > AutoDeploymentService.java:220) > > > > at > > > org.apache.servicemix.jbi.framework.AutoDeploymentService$2.run( > > > > AutoDeploymentService.java:507) > > > > at org.apache.geronimo.connector.work.WorkerContext.run ( > > > > WorkerContext.java:291) > > > > at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run > > > (Unknown > > > > Source) > > > > at java.lang.Thread.run(Thread.java:595) > > > > > > > > Any thoughts? > > > > > > > > > > > > > > > > >
