0 Replies Latest reply on Dec 1, 2010 5:40 PM by Kuntal Mondal

    Web Service client fails  with Spring Security throwing "java.lang.NoClassDefFoundError: org/springframework/beans/BeansException"

    Kuntal Mondal Newbie

      Hi,

      I am using latest JBoss 6.0.0-CR1 release with Spring Security 3.0.3.

      I have two WAR modules - so I put all the Spring jars as part of EAR so that both the WARs can access them from EAR module.

       

      Now, I have a web service client (based on JAX-WS).

      I get following exception when the WS client is invoked.

      I do not know why CXF client is dependednt on Spring library. Both CXF and Spring are two independent library.

       

      If I put all the Spring libraries in JBOSS_HOME/common/lib then my WAR module can not find the Spring classes any more.

      I am totally lost.

      Can anyone make any recommendation?

       

      Is it possible to "instruct" the JBoss's Base classloader to look (instead of loading) for Spring jars from application EAR module?

       

      Thanks in advance,

       

       

      Caused by: java.lang.NoClassDefFoundError: org/springframework/beans/BeansException
              at org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory.getSpringBusFactory(JBossWSBusFactory.java:120) [:3.4.0.CR3]
              at org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory.createBus(JBossWSBusFactory.java:54) [:3.4.0.CR3]
              at org.jboss.wsf.stack.cxf.client.ProviderImpl.createServiceDelegate(ProviderImpl.java:69) [:3.4.0.CR3]
              at javax.xml.ws.Service.<init>(Service.java:57) [:1.0.0.Final]

              at com.towersoft.schema.webservice.trim2.Engine.<init>(Engine.java:58) [:]
              at com.im.server.edm.datasource.trim.TrimSession.createTrimSession(TrimSession.java:73) [:]
              at com.im.server.edm.datasource.trim.TrimDatasource.createSession(TrimDatasource.java:60) [:]
              at com.im.server.edm.datasource.trim.TrimDatasource.createSession(TrimDatasource.java:15) [:]
              at com.im.server.edm.datasource.SessionCache.acquire(SessionCache.java:34) [:]
              at com.im.server.edm.datasource.Datasource.openSession(Datasource.java:96) [:]
              at com.im.server.edm.buslogic.DatasourceBL.persistTrimCustomFields(DatasourceBL.java:186) [:]
              at com.im.server.edm.buslogic.InstallBL.createDatasources(InstallBL.java:210) [:]
              at com.im.server.edm.buslogic.InstallBL.createDevDatasources(InstallBL.java:171) [:]
              at com.im.server.edm.buslogic.InstallBL.initializeApplication(InstallBL.java:39) [:]
              at com.im.server.edm.ejb.ApplicationBean.initializeApplication(ApplicationBean.java:42) [:]
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_18]
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_18]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_18]
              at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_18]
              at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122) [jboss-aop.jar:2.2.1.Alpha3]
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111) [jboss-aop.jar:2.2.1.Alpha3]
              at org.jboss.ejb3.interceptors.container.ContainerMethodInvocationWrapper.invokeNext(ContainerMethodInvocationWrapper.java:72) [:1.0.8]
              at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:76) [:1.0.8]
              at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:62) [:1.0.8]
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_18]
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_18]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_18]
              at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_18]
              at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174) [jboss-aop.jar:2.2.1.Alpha3]
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.Alpha3]
              at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:72) [:1.0.8]
              at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_18846124.invoke(InvocationContextInterceptor_z_fillMethod_18846124.java)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.Alpha3]
              at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88) [:1.0.8]
              at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_18846124.invoke(InvocationContextInterceptor_z_setup_18846124.java)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.Alpha3]
              at org.jboss.ejb3.async.impl.interceptor.FutureSerializingInterceptor.invoke(FutureSerializingInterceptor.java:88) [:1.0.0-alpha-5]
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.Alpha3]
              at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62) [:1.6.3]
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.Alpha3]
              at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56) [:1.6.3]
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.Alpha3]
              at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47) [:1.6.3]
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.Alpha3]
              at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42) [:1.0.3]
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.Alpha3]
              at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68) [:1.6.3]
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.Alpha3]
              at org.jboss.ejb3.core.context.SessionInvocationContextAdapter.proceed(SessionInvocationContextAdapter.java:91) [:1.6.3]
              at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:247) [:0.0.1]
              ... 117 more
      Caused by: java.lang.ClassNotFoundException: org.springframework.beans.BeansException from BaseClassLoader@11f91ac{vfs:///C:/Workspace/DM1.0/dependencies/repository/jboss/jboss-6.0.0.20
      101110-CR1/server/default/conf/jboss-service.xml}
              at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:480) [jboss-classloader.jar:2.2.0.Alpha9]
              at java.lang.ClassLoader.loadClass(ClassLoader.java:248) [:1.6.0_18]
              ... 167 more