1 Reply Latest reply on Jun 10, 2011 9:48 AM by Heiner Lamprecht

    Class loading problem

    Heiner Lamprecht Newbie

      Hi all,

       

      I have a problem with the class loader.  My application is deployed as an EAR-file with the following structure:

       

      lib/myapi.jar

      mydatamanager.jar

      mywebservice.war

       

      The datamanager and the webservice both use interfaces and classes defined in the api package.  The problem occurs, when the datamanager tries to access an external web service, that is also based on the same api.  In other words, the application offers the webservice to the outside world, but also consumes such a service on other hosts.

       

      javax.ejb.EJBTransactionRolledbackException: Could not generate wrapper type: com.in.omd.configurationservice.jaxws.SetConfigurationResponse

          at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:115)

          at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)

          at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:194)

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

          at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

          at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:80)

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

          at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

          at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

          at org.jboss.ejb3.interceptor.EJB3TCCLInterceptor.invoke(EJB3TCCLInterceptor.java:86)

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

          at org.jboss.ejb3.mdb.MessagingContainer.localInvoke(MessagingContainer.java:282)

          at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.delivery(MessageInflowLocalProxy.java:299)

          at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.invoke(MessageInflowLocalProxy.java:152)

          at $Proxy362.onMessage(Unknown Source)

          at org.jboss.resource.adapter.jms.inflow.JmsServerSession.onMessage(JmsServerSession.java:178)

          at org.jboss.jms.client.container.ClientConsumer.callOnMessageStatic(ClientConsumer.java:160)

          at org.jboss.jms.client.container.SessionAspect.handleRun(SessionAspect.java:831)

          at org.jboss.aop.advice.org.jboss.jms.client.container.SessionAspect_z_handleRun_22629283.invoke(SessionAspect_z_handleRun_22629283.java)

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

          at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:170)

          at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:86)

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

          at org.jboss.jms.client.delegate.ClientSessionDelegate.run(ClientSessionDelegate.java)

          at org.jboss.jms.client.JBossSession.run(JBossSession.java:199)

          at org.jboss.resource.adapter.jms.inflow.JmsServerSession.run(JmsServerSession.java:234)

          at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:205)

          at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

          at java.lang.Thread.run(Thread.java:662)

      Caused by: org.jboss.ws.WSException: Could not generate wrapper type: com.in.omd.configurationservice.jaxws.SetConfigurationResponse

          at org.jboss.ws.core.jaxws.DynamicWrapperGenerator.generate(DynamicWrapperGenerator.java:136)

          at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilder.processWebMethod(JAXWSMetaDataBuilder.java:956)

          at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilder.processWebMethods(JAXWSMetaDataBuilder.java:1070)

          at org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder.rebuildEndpointMetaData(JAXWSClientMetaDataBuilder.java:303)

          at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.getPortInternal(ServiceDelegateImpl.java:234)

          at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.getPort(ServiceDelegateImpl.java:543)

          at javax.xml.ws.Service.getPort(Service.java:99)

          at com.in.omd.configurationservice.ConfigurationServiceClient.getConfigurationService(ConfigurationServiceClient.java:74)

          at com.in.omd.module.configurationpublisher.ConfigurationPublisher.publishConfiguration(ConfigurationPublisher.java:96)

          at com.in.omd.module.configurationpublisher.ConfigurationPublisher.onMessage(ConfigurationPublisher.java:78)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

          at java.lang.reflect.Method.invoke(Method.java:597)

          at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)

          at org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:69)

          at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:76)

          at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:62)

          at sun.reflect.GeneratedMethodAccessor275.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

          at java.lang.reflect.Method.invoke(Method.java:597)

          at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

          at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:72)

          at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_22629283.invoke(InvocationContextInterceptor_z_fillMethod_22629283.java)

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

          at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88)

          at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_22629283.invoke(InvocationContextInterceptor_z_setup_22629283.java)

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

          at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

          at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

          at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

          at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

          at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

          at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)

          ... 32 more

      Caused by: javassist.CannotCompileException: by java.lang.LinkageError: loader (instance of  org/jboss/classloader/spi/base/BaseClassLoader): attempted  duplicate class definition for name: "com/in/omd/configurationservice/jaxws/SetConfigurationResponse"

          at javassist.ClassPool.toClass(ClassPool.java:1035)

          at javassist.ClassPool.toClass(ClassPool.java:978)

          at org.jboss.ws.core.jaxws.DynamicWrapperGenerator.generate(DynamicWrapperGenerator.java:131)

          ... 72 more

      Caused by: java.lang.LinkageError: loader (instance of  org/jboss/classloader/spi/base/BaseClassLoader): attempted  duplicate class definition for name: "com/in/omd/configurationservice/jaxws/SetConfigurationResponse"

          at java.lang.ClassLoader.defineClass1(Native Method)

          at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)

          at java.lang.ClassLoader.defineClass(ClassLoader.java:616)

          at java.lang.ClassLoader.defineClass(ClassLoader.java:466)

          at sun.reflect.GeneratedMethodAccessor117.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

          at java.lang.reflect.Method.invoke(Method.java:597)

          at javassist.ClassPool.toClass2(ClassPool.java:1047)

          at javassist.ClassPool.toClass(ClassPool.java:1029)

          ... 74 more

       

      As one can see, the problem relates to the classes that are beeing generated for the SOAP stuff.  I get those stack traces for more or less all wrapper classes needed.  The funny thing is, that the application itself is working perfectly, only it creates these messages.

       

      In the beginning, I used EJB-based web services.  With such a design, I didn't had any problems.  It all started when switching to "normal" WAR-based web services.

       

      Is there anything, that could be configured, ... to get rid of the exceptions?

       

       

      Bestens,

       

      Heiner

        • 1. Re: Class loading problem
          Heiner Lamprecht Newbie

          Small update:

           

          the ear file contains several api-manager-webservice triple.  The above mentioned problem only occurs for one of them.  The difference between this and the rest is, that the web service client, that opens the external web service connection, is a message driven bean, called via JMS.  Without JMS, there are no exceptions and the connection works correctly.

           

          All the best,

           

           

              Heiner