4 Replies Latest reply on Jul 16, 2011 4:46 AM by jaikiran pai

    package org.jboss.injection

    Oved Ourfali Newbie

      Hey,

       

      I have a code that runs in jboss 5.1, using a class names WebServiceContextProxy, that is located in package org.jboss.injection.

       

      In which module can I find this class in as7?

       

      I fail with this weeoe:

       

      10:07:40,049 ERROR [org.jboss.as.webservices.invocation.InvocationHandlerEJB3] (http-vpn-203-50.tlv.redhat.com-10.35.203.50-8080-1) Method invocation failed with exception: Unexpected Error: javax.ejb.EJBException: Unexpected Error

              at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:201) [jboss-ejb3-tx2-impl-2.0.0-beta-1.jar:2.0.0-beta-1]

              at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275) [jboss-ejb3-tx2-impl-2.0.0-beta-1.jar:2.0.0-beta-1]

              at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:377) [jboss-ejb3-tx2-impl-2.0.0-beta-1.jar:2.0.0-beta-1]

              at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:233) [jboss-ejb3-tx2-impl-2.0.0-beta-1.jar:2.0.0-beta-1]

              at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:47)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

              at org.jboss.as.webservices.invocation.InvocationHandlerEJB3.invoke(InvocationHandlerEJB3.java:130)

              at org.jboss.wsf.stack.cxf.AbstractInvoker._invokeInternal(AbstractInvoker.java:169) [jbossws-cxf-server-4.0.0.Beta2.jar:4.0.0.Beta2]

              at org.jboss.wsf.stack.cxf.AbstractInvoker.invoke(AbstractInvoker.java:117) [jbossws-cxf-server-4.0.0.Beta2.jar:4.0.0.Beta2]

              at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58) [cxf-rt-core-2.4.1.jar:2.4.1]

              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [:1.6.0_24]

              at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [:1.6.0_24]

              at java.util.concurrent.FutureTask.run(FutureTask.java:138) [:1.6.0_24]

              at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37) [cxf-rt-core-2.4.1.jar:2.4.1]

              at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106) [cxf-rt-core-2.4.1.jar:2.4.1]

              at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263) [cxf-api-2.4.1.jar:2.4.1]

              at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:118) [cxf-rt-core-2.4.1.jar:2.4.1]

              at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:208) [cxf-rt-transports-http-2.4.1.jar:2.4.1]

              at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:88) [jbossws-cxf-server-4.0.0.Beta2.jar:4.0.0.Beta2]

              at org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:159) [jbossws-cxf-server-4.0.0.Beta2.jar:4.0.0.Beta2]

              at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:87) [jbossws-cxf-server-4.0.0.Beta2.jar:4.0.0.Beta2]

              at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:184) [cxf-rt-transports-http-2.4.1.jar:2.4.1]

              at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:107) [cxf-rt-transports-http-2.4.1.jar:2.4.1]

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

              at org.jboss.wsf.stack.cxf.CXFServletExt.service(CXFServletExt.java:135) [jbossws-cxf-server-4.0.0.Beta2.jar:4.0.0.Beta2]

              at org.jboss.wsf.spi.deployment.WSFServlet.service(WSFServlet.java:138) [jbossws-spi-2.0.0.Beta5.jar:2.0.0.Beta5]

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)

              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)

              at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57)

              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154)

              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)

              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667)

              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)

              at java.lang.Thread.run(Thread.java:662) [:1.6.0_24]

      Caused by: java.lang.NoClassDefFoundError: org/jboss/injection/WebServiceContextProxy

              at org.nogah.utils.CXFContextInterceptor.injectWebContextToThreadLocal(CXFContextInterceptor.java:25) [utils-3.0.0-0001.jar:]

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_24]

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_24]

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_24]

              at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_24]

              at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptor.java:66)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:45)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:44)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

              at org.jboss.as.ee.component.ViewDescription$ComponentDispatcherInterceptor.processInvocation(ViewDescription.java:202)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.as.ejb3.component.session.SessionInvocationContextInterceptor.processInvocation(SessionInvocationContextInterceptor.java:67)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:370)

              at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:271) [jboss-ejb3-tx2-impl-2.0.0-beta-1.jar:2.0.0-beta-1]

              ... 39 more

      Caused by: java.lang.ClassNotFoundException: org.jboss.injection.WebServiceContextProxy from [Module "deployment.rhevm.ear:main" from Service Module Loader]

              at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)

              at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)

              at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)

              ... 65 more

       

      10:07:40,061 WARNING [org.apache.cxf.phase.PhaseInterceptorChain] (http-vpn-203-50.tlv.redhat.com-10.35.203.50-8080-1) Application {http://service.org.nogah}IBackend#{http://service.org.nogah}RunPublicQuery has thrown exception, unwinding now: org.apache.cxf.interceptor.Fault: Unexpected Error

              at org.jboss.wsf.stack.cxf.AbstractInvoker.createFault(AbstractInvoker.java:234) [jbossws-cxf-server-4.0.0.Beta2.jar:4.0.0.Beta2]

              at org.jboss.wsf.stack.cxf.AbstractInvoker._invokeInternal(AbstractInvoker.java:195) [jbossws-cxf-server-4.0.0.Beta2.jar:4.0.0.Beta2]

              at org.jboss.wsf.stack.cxf.AbstractInvoker.invoke(AbstractInvoker.java:117) [jbossws-cxf-server-4.0.0.Beta2.jar:4.0.0.Beta2]

              at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58) [cxf-rt-core-2.4.1.jar:2.4.1]

              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [:1.6.0_24]

              at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [:1.6.0_24]

              at java.util.concurrent.FutureTask.run(FutureTask.java:138) [:1.6.0_24]

              at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37) [cxf-rt-core-2.4.1.jar:2.4.1]

              at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106) [cxf-rt-core-2.4.1.jar:2.4.1]

              at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263) [cxf-api-2.4.1.jar:2.4.1]

              at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:118) [cxf-rt-core-2.4.1.jar:2.4.1]

              at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:208) [cxf-rt-transports-http-2.4.1.jar:2.4.1]

              at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:88) [jbossws-cxf-server-4.0.0.Beta2.jar:4.0.0.Beta2]

              at org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:159) [jbossws-cxf-server-4.0.0.Beta2.jar:4.0.0.Beta2]

              at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:87) [jbossws-cxf-server-4.0.0.Beta2.jar:4.0.0.Beta2]

              at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:184) [cxf-rt-transports-http-2.4.1.jar:2.4.1]

              at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:107) [cxf-rt-transports-http-2.4.1.jar:2.4.1]

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

              at org.jboss.wsf.stack.cxf.CXFServletExt.service(CXFServletExt.java:135) [jbossws-cxf-server-4.0.0.Beta2.jar:4.0.0.Beta2]

              at org.jboss.wsf.spi.deployment.WSFServlet.service(WSFServlet.java:138) [jbossws-spi-2.0.0.Beta5.jar:2.0.0.Beta5]

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)

              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)

              at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57)

              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154)

              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)

              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667)

              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)

              at java.lang.Thread.run(Thread.java:662) [:1.6.0_24]

      Caused by: javax.ejb.EJBException: Unexpected Error

              at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:201) [jboss-ejb3-tx2-impl-2.0.0-beta-1.jar:2.0.0-beta-1]

              at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275) [jboss-ejb3-tx2-impl-2.0.0-beta-1.jar:2.0.0-beta-1]

              at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:377) [jboss-ejb3-tx2-impl-2.0.0-beta-1.jar:2.0.0-beta-1]

              at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:233) [jboss-ejb3-tx2-impl-2.0.0-beta-1.jar:2.0.0-beta-1]

              at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:47)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

              at org.jboss.as.webservices.invocation.InvocationHandlerEJB3.invoke(InvocationHandlerEJB3.java:130)

              at org.jboss.wsf.stack.cxf.AbstractInvoker._invokeInternal(AbstractInvoker.java:169) [jbossws-cxf-server-4.0.0.Beta2.jar:4.0.0.Beta2]

              ... 32 more

      Caused by: java.lang.NoClassDefFoundError: org/jboss/injection/WebServiceContextProxy

              at org.nogah.utils.CXFContextInterceptor.injectWebContextToThreadLocal(CXFContextInterceptor.java:25) [utils-3.0.0-0001.jar:]

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_24]

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_24]

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_24]

              at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_24]

              at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptor.java:66)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:45)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:44)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

              at org.jboss.as.ee.component.ViewDescription$ComponentDispatcherInterceptor.processInvocation(ViewDescription.java:202)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.as.ejb3.component.session.SessionInvocationContextInterceptor.processInvocation(SessionInvocationContextInterceptor.java:67)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:370)

              at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:271) [jboss-ejb3-tx2-impl-2.0.0-beta-1.jar:2.0.0-beta-1]

              ... 39 more

      Caused by: java.lang.ClassNotFoundException: org.jboss.injection.WebServiceContextProxy from [Module "deployment.rhevm.ear:main" from Service Module Loader]

              at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)

              at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)

              at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)

              ... 65 more

       

      Thank you,

      Oved

        • 1. Re: package org.jboss.injection
          jaikiran pai Master

          That's no longer available in AS7 and will not be. The org.nogah.utils.CXFContextInterceptor appears to be doing too much with the internals of JBoss AS. What's it trying to do?

          • 2. Re: package org.jboss.injection
            Oved Ourfali Newbie

            You are always the first to answer :-)

            I appreciate it.

             

            As for the problem, we have an interceptor that needs to take the session id from the http session, and plant it somewhere in the thread local context.

             

            The code is:

             

            package org.nogah.utils;

             

            import javax.interceptor.AroundInvoke;

            import javax.interceptor.InvocationContext;

            import javax.servlet.http.HttpSession;

            import javax.xml.ws.WebServiceContext;

            import javax.xml.ws.handler.MessageContext;

             

            import org.jboss.injection.WebServiceContextProxy;

             

            import org.nogah.common.config.Config;

            import org.nogah.common.config.ConfigValues;

            import org.nogah.compat.LogCompat;

            import org.nogah.compat.LogFactoryCompat;

             

            public class CXFContextInterceptor {

             

                // should take the context as a resource but doesn't work

                // @Resource WebServiceContext wsContext;

             

                private static LogCompat log = LogFactoryCompat.getLog(CXFContextInterceptor.class);

             

                @AroundInvoke

                public Object injectWebContextToThreadLocal(InvocationContext ic) throws Exception {

                    WebServiceContext wsContext = new WebServiceContextProxy();

                    MessageContext mc = wsContext.getMessageContext();

                    HttpSession session = ((javax.servlet.http.HttpServletRequest) mc.get(MessageContext.SERVLET_REQUEST))

                            .getSession();

                    session.setMaxInactiveInterval(Config.<Integer> GetValue(ConfigValues.UserSessionTimeOutInterval) * 60);

                    if (log.isDebugEnabled()) {

                        log.debug("session id=" + session.getId());

                    }

                    ThreadLocalParamsContainer.setHttpSessionId(session.getId());

                    return ic.proceed();

                }

            }

             

            In the remark of the code you can see:

                // should take the context as a resource but doesn't work

                // @Resource WebServiceContext wsContext;

            So probably the man who wrote it tried to get the context as a resource, and it didn't work....

             

            Should it work?

             

            Thank you,

            Oved

            • 3. Re: package org.jboss.injection
              Oved Ourfali Newbie

              It worked :-)

              Thank you

              • 4. Re: package org.jboss.injection
                jaikiran pai Master

                Yeah, interceptors are expected to be able to inject that WebServiceContext. Looks like it was an issue in some earlier version. Good to know it worked!