Hi. I'm really grateful for your quick answer. I had already tried without any locations, but I was getting a BeanDefinitionStoreException. That's why I thought I needed to specify all of the jars. The exception was caused because I had the sping-beans jar both in my SU lib and in the servicemix/lib (in case someone runs into the same error), so I fixed that and now it's working perfectly.
Thanks a lot. Sebastian Gomez. On Mon, Sep 22, 2008 at 5:35 PM, Guillaume Nodet <[EMAIL PROTECTED]> wrote: > No, unless you use the default settings. > If you don't set any <location/> elements, the default locations list > should be used ( "." + "lib/*.jar" + "lib/*.zip"). > It should work. Try with: > > <classpath inverse="true" /> > > It should use self-first delegation while still using the defaut locations. > > On Mon, Sep 22, 2008 at 5:30 PM, Sebastian Gomez <[EMAIL PROTECTED]> wrote: >> Does anyone know if it's possible to add a whole directory instead of >> adding the jars one by one? I wouldn't like to have to add the whole >> list of jars to the xbean file. What is the best way to go? >> >> Thanks. >> >> Sebastian Gomez. >> >> On Tue, Sep 16, 2008 at 11:54 AM, Sebastian Gomez <[EMAIL PROTECTED]> wrote: >>> Hi Gert. >>> >>> Thanks a lot, that worked. >>> >>> Now a smaller issue is bothering me: Is there any way I can add all >>> the JARs without being so explicit? i.e, not having to specify the >>> name of the jar? Something like using "*" or just the directory name? >>> I've tried using <location>lib</location> and >>> <location>lib/*.jar</location> and both don't seem to work. I guess >>> I'm not forced to list every jar I use, or am I? >>> >>> Hope you can also help me out with this one. >>> >>> Best regards, >>> >>> Sebastian Gomez. >>> >>> >>> On Tue, Sep 16, 2008 at 10:11 AM, Gert Vanthienen >>> <[EMAIL PROTECTED]> wrote: >>>> L.S., >>>> >>>> Could you try explicitly adding <location/> elements for the JAR files you >>>> want to use in your SU? I'm not sure the default settings are still used >>>> if >>>> you add your own classpath configuration. >>>> >>>> Regards, >>>> >>>> Gert >>>> >>>> Sebastian Gomez wrote: >>>>> >>>>> Hi everyone. >>>>> >>>>> I'm trying to deploy a SA that contains a servicemix-bean SU that uses >>>>> older versions of some of the jars in the "lib" and "sharedlibs" >>>>> directories of ServiceMix. As I need to use my versions instead of the >>>>> ones that come with SM, I've thought I must need to use self-first >>>>> delegation in the classloading. I tried adding >>>>> >>>>> <classpath inverse="true"> >>>>> <location>.</location> >>>>> </classpath> >>>>> >>>>> in the xbean.xml file, but when the deployment starts I get a >>>>> "java.lang.NoClassDefFoundError" referring to one of the classes in my >>>>> Maven dependencies. >>>>> >>>>> I already tried self-first delegation in a servicemix-saxon SU with no >>>>> problems, but I didn't have any beans declared in it (only endpoints). >>>>> Is it possible there's some problem in loading classes declared in a >>>>> bean that's declared in the xbean.xml file? Could it be that there's >>>>> some kind of clash between the SpringLoader and SMX's classloader? >>>>> >>>>> I hope someone can help me out with this, because I can't remove the >>>>> newer version jars from the lib and sharedlibs directories because >>>>> other SUs will need them. >>>>> >>>>> Thanks in advance. >>>>> >>>>> Sebastian Gomez. >>>>> >>>>> PS: This is the stack trace in case anyone finds it useful: >>>>> >>>>> org.apache.xbean.k >>>>> ernel.ServiceRegistrationException: >>>>> org.springframework.beans.factory.BeanDefini >>>>> tionStoreException: Unexpected exception parsing XML document from file >>>>> [Z:\my\ >>>>> smx\directory\data\smx\service-assemblies\my-su\xbean.xml]; nested except >>>>> ion is java.lang.NoClassDefFoundError: class/it/doesn't/Find >>>>> at >>>>> org.apache.xbean.kernel.standard.ServiceManagerRegistry.registerServi >>>>> ce(ServiceManagerRegistry.java:424) >>>>> at >>>>> org.apache.xbean.kernel.standard.StandardKernel.registerService(Stand >>>>> ardKernel.java:220) >>>>> at >>>>> org.apache.xbean.server.spring.loader.SpringLoader.load(SpringLoader. >>>>> java:152) >>>>> at >>>>> org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(Abstr >>>>> actXBeanDeployer.java:83) >>>>> at >>>>> org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServ >>>>> iceUnitManager.java:88) >>>>> at >>>>> org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServic >>>>> eUnitManager.java:69) >>>>> at >>>>> org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAs >>>>> sembly(DeploymentService.java:508) >>>>> at >>>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServi >>>>> ceAssembly(AutoDeploymentService.java:353) >>>>> at >>>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchi >>>>> ve(AutoDeploymentService.java:256) >>>>> at >>>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateExter >>>>> nalArchive(AutoDeploymentService.java:204) >>>>> at >>>>> org.apache.servicemix.jbi.container.JBIContainer.updateExternalArchiv >>>>> e(JBIContainer.java:476) >>>>> at >>>>> org.apache.servicemix.jbi.container.JBIContainer.updateExternalArchiv >>>>> e(JBIContainer.java:486) >>>>> at >>>>> org.apache.servicemix.jbi.framework.AdminCommandsService.deployServic >>>>> eAssembly(AdminCommandsService.java:209) >>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>>> at >>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. >>>>> java:39) >>>>> at >>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces >>>>> sorImpl.java:25) >>>>> at java.lang.reflect.Method.invoke(Method.java:585) >>>>> at >>>>> org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.jav >>>>> a:216) >>>>> at >>>>> org.apache.servicemix.jbi.management.BaseStandardMBean.invoke(BaseSta >>>>> ndardMBean.java:323) >>>>> at >>>>> com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImp >>>>> l.java:213) >>>>> at >>>>> com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220) >>>>> at >>>>> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultM >>>>> BeanServerInterceptor.java:815) >>>>> at >>>>> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784 >>>>> ) >>>>> at >>>>> javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnecti >>>>> onImpl.java:1410) >>>>> at >>>>> javax.management.remote.rmi.RMIConnectionImpl.access$100(RMIConnectio >>>>> nImpl.java:81) >>>>> at >>>>> javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run >>>>> (RMIConnectionImpl.java:1247) >>>>> at java.security.AccessController.doPrivileged(Native Method) >>>>> at >>>>> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(R >>>>> MIConnectionImpl.java:1350) >>>>> at >>>>> javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImp >>>>> l.java:784) >>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>>> at >>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. >>>>> java:39) >>>>> at >>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces >>>>> sorImpl.java:25) >>>>> at java.lang.reflect.Method.invoke(Method.java:585) >>>>> at >>>>> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294) >>>>> at sun.rmi.transport.Transport$1.run(Transport.java:153) >>>>> at java.security.AccessController.doPrivileged(Native Method) >>>>> at sun.rmi.transport.Transport.serviceCall(Transport.java:149) >>>>> at >>>>> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4 >>>>> 66) >>>>> at >>>>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport >>>>> .java:707) >>>>> at java.lang.Thread.run(Thread.java:595) >>>>> Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: >>>>> Unexp >>>>> ected exception parsing XML document from file [Z:\my\ >>>>> smx\directory\data\smx\service-assemblies\my-su\xbean.xml]; >>>>> nested exception is java.lang.NoClassD >>>>> efFoundError: class/it/doesn't/Find >>>>> at >>>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB >>>>> eanDefinitions(XmlBeanDefinitionReader.java:375) >>>>> at >>>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea >>>>> nDefinitions(XmlBeanDefinitionReader.java:303) >>>>> at >>>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea >>>>> nDefinitions(XmlBeanDefinitionReader.java:280) >>>>> at >>>>> org.springframework.beans.factory.support.AbstractBeanDefinitionReade >>>>> r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131) >>>>> at >>>>> org.springframework.beans.factory.support.AbstractBeanDefinitionReade >>>>> r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147) >>>>> at >>>>> org.springframework.beans.factory.support.AbstractBeanDefinitionReade >>>>> r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:173) >>>>> at >>>>> org.springframework.context.support.AbstractXmlApplicationContext.loa >>>>> dBeanDefinitions(AbstractXmlApplicationContext.java:112) >>>>> at >>>>> org.apache.xbean.spring.context.FileSystemXmlApplicationContext.loadB >>>>> eanDefinitions(FileSystemXmlApplicationContext.java:168) >>>>> at >>>>> org.springframework.context.support.AbstractRefreshableApplicationCon >>>>> text.refreshBeanFactory(AbstractRefreshableApplicationContext.java:101) >>>>> at >>>>> org.springframework.context.support.AbstractApplicationContext.obtain >>>>> FreshBeanFactory(AbstractApplicationContext.java:389) >>>>> at >>>>> org.springframework.context.support.AbstractApplicationContext.refres >>>>> h(AbstractApplicationContext.java:324) >>>>> at >>>>> org.apache.xbean.server.spring.configuration.SpringConfiguration.<ini >>>>> t>(SpringConfiguration.java:63) >>>>> at >>>>> org.apache.xbean.server.spring.configuration.SpringConfigurationServi >>>>> ceFactory.createService(SpringConfigurationServiceFactory.java:106) >>>>> at >>>>> org.apache.xbean.kernel.standard.ServiceManager.start(ServiceManager. >>>>> java:420) >>>>> at >>>>> org.apache.xbean.kernel.standard.ServiceManager.initialize(ServiceMan >>>>> ager.java:200) >>>>> at >>>>> org.apache.xbean.kernel.standard.RegistryFutureTask$RegisterCallable. >>>>> call(RegistryFutureTask.java:110) >>>>> at >>>>> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269) >>>>> at java.util.concurrent.FutureTask.run(FutureTask.java:123) >>>>> at >>>>> org.apache.xbean.kernel.standard.ServiceManagerRegistry.registerServi >>>>> ce(ServiceManagerRegistry.java:409) >>>>> ... 39 more >>>>> Caused by: java.lang.NoClassDefFoundError: class/it/doesn't/Find >>>>> at java.lang.Class.getDeclaredMethods0(Native Method) >>>>> at java.lang.Class.privateGetDeclaredMethods(Class.java:2395) >>>>> at java.lang.Class.getDeclaredMethods(Class.java:1763) >>>>> at java.beans.Introspector$1.run(Introspector.java:1265) >>>>> at java.security.AccessController.doPrivileged(Native Method) >>>>> at >>>>> java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:12 >>>>> 63) >>>>> at >>>>> java.beans.Introspector.getTargetMethodInfo(Introspector.java:1129) >>>>> at java.beans.Introspector.getBeanInfo(Introspector.java:387) >>>>> at java.beans.Introspector.getBeanInfo(Introspector.java:159) >>>>> at >>>>> org.apache.xbean.spring.context.v2c.XBeanQNameHelper.getBeanInfo(XBea >>>>> nQNameHelper.java:78) >>>>> at >>>>> org.apache.xbean.spring.context.v2c.XBeanQNameHelper.coerceNamespaceA >>>>> warePropertyValues(XBeanQNameHelper.java:54) >>>>> at >>>>> org.apache.xbean.spring.context.v2c.XBeanBeanDefinitionParserDelegate >>>>> .parseBeanDefinitionElement(XBeanBeanDefinitionParserDelegate.java:63) >>>>> at >>>>> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.pa >>>>> rseBeanDefinitionElement(BeanDefinitionParserDelegate.java:341) >>>>> at >>>>> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.pa >>>>> rseBeanDefinitionElement(BeanDefinitionParserDelegate.java:310) >>>>> at >>>>> org.apache.xbean.spring.context.v2.XBeanBeanDefinitionDocumentReader. >>>>> processBeanDefinition(XBeanBeanDefinitionDocumentReader.java:174) >>>>> at >>>>> org.apache.xbean.spring.context.v2.XBeanBeanDefinitionDocumentReader. >>>>> parseDefaultElement(XBeanBeanDefinitionDocumentReader.java:101) >>>>> at >>>>> org.apache.xbean.spring.context.v2.XBeanBeanDefinitionDocumentReader. >>>>> parseBeanDefinitions(XBeanBeanDefinitionDocumentReader.java:81) >>>>> at >>>>> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe >>>>> ader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:90) >>>>> at >>>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registe >>>>> rBeanDefinitions(XmlBeanDefinitionReader.java:458) >>>>> at >>>>> org.apache.xbean.spring.context.v2.XBeanXmlBeanDefinitionReader.regis >>>>> terBeanDefinitions(XBeanXmlBeanDefinitionReader.java:79) >>>>> at >>>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB >>>>> eanDefinitions(XmlBeanDefinitionReader.java:353) >>>>> ... 57 more >>>>> >>>>> >>>> >>>> >>> >> > > > > -- > Cheers, > Guillaume Nodet > ------------------------ > Blog: http://gnodet.blogspot.com/ > ------------------------ > Open Source SOA > http://open.iona.com >
