0 Replies Latest reply: May 28, 2012 7:24 AM by Georg Kompacher RSS

    Using jersey libraries with JBoss AS 7

    Georg Kompacher Newbie

      Hi!

       

      I am trying to get JBoss AS 7 to work with my jersey webservice client. I am trying to use the jersey client api to call other webservices from my ejbs, but I am having major problems getting jersey-core-1.12.jar and jersey-client-1.12.jar to be found be the application server. The EJBs are  deployed without getting an error but when I am trying to access the Client class from the jersey library I am getting this exception:

       

       

      Caused by: java.lang.NoClassDefFoundError: com/sun/jersey/api/client/Client
          at org.jboss.as.quickstarts.ejb.remote.stateless.CalculatorBean.add(CalculatorBean.java:19)
          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.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
          at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
          at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:228)
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:304)
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ejb3.remote.EJBRemoteTransactionPropagatingInterceptor.processInvocation(EJBRemoteTransactionPropagatingInterceptor.java:80)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:43)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
          at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165)
          at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.invokeMethod(MethodInvocationMessageHandler.java:302)
          at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.access$200(MethodInvocationMessageHandler.java:64)
          at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler$1.run(MethodInvocationMessageHandler.java:196)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
          at java.util.concurrent.FutureTask.run(FutureTask.java:138)
          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:680)
          at org.jboss.threads.JBossThread.run(JBossThread.java:122)
      Caused by: java.lang.ClassNotFoundException: com.sun.jersey.api.client.Client from [Module "deployment.jboss-as-ejb-remote-app.jar:main" from Service Module Loader]
          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
          at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)
          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
          ... 47 more
      

       

      I have already tried to make modules with the 2 libs but without any sucess. Can anybody help me out?

       

      Thx, Georg