7 Replies Latest reply on Aug 31, 2012 10:29 AM by Tomohisa igarashi

    CDI Bean error, help

    Gustavo Pires Newbie

      Hello,

       

      I'm trying to follow an example detailed here and doing some trivial (I hope) changes to see if everything works. The logic is somewhat the same as the example given. I have a home.xhtml file that calls a Called object for an atribute and also a method which in turn calls a method from an injected CDI bean HelloWorldBean.

       

      The service is successfully deployed but when I go to home.jsf in the browser and use the button to call the method, the server spews out the following.

       

       

      15:52:10,107 SEVERE [javax.faces.event] (http--127.0.0.1-8080-1) Received 'java.lang.reflect.UndeclaredThrowableException' when invoking action listener '#{called.yellow}' for component 'j_idt9'

      15:52:10,114 SEVERE [javax.faces.event] (http--127.0.0.1-8080-1) java.lang.reflect.UndeclaredThrowableException

          at $Proxy25.helloWorld(Unknown Source)

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

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

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

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

          at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:44)

          at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105)

          at org.jboss.weld.proxies.HelloWorld$1366014918$Proxy$_$$_WeldClientProxy.helloWorld(HelloWorld$1366014918$Proxy$_$$_WeldClientProxy.java)

          at com.it.app.Called.yellow(Called.java:32)

          at com.it.app.Called$Proxy$_$$_WeldClientProxy.yellow(Called$Proxy$_$$_WeldClientProxy.java)

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

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

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

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

          at org.apache.el.parser.AstValue.invoke(AstValue.java:262)

          at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278)

          at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:39)

          at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)

          at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:153)

          at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)

          at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:769)

          at javax.faces.component.UICommand.broadcast(UICommand.java:300)

          at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)

          at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)

          at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)

          at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

          at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)

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

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

          at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62)

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

          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.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)

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

          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:368)

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

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

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

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

      Caused by: org.switchyard.component.bean.BeanComponentException: A service reference to service 'HelloWorld' is not bound into this client proxy instance.  A reference configuration to the service may be required in the application configuration.

          at org.switchyard.component.bean.ClientProxyBean$ClientProxyInvocationHandler.invoke(ClientProxyBean.java:274)

          ... 44 more

       

      15:52:10,199 SEVERE [javax.enterprise.resource.webcontainer.jsf.context] (http--127.0.0.1-8080-1) JSF1073: javax.faces.event.AbortProcessingException caught during processing of INVOKE_APPLICATION 5 : UIComponent-ClientId=jsfexample:j_idt9, Message=java.lang.reflect.UndeclaredThrowableException

      15:52:10,210 SEVERE [javax.enterprise.resource.webcontainer.jsf.context] (http--127.0.0.1-8080-1) java.lang.reflect.UndeclaredThrowableException: javax.faces.event.AbortProcessingException: java.lang.reflect.UndeclaredThrowableException

          at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:182) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

          at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

          at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:769) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

          at javax.faces.component.UICommand.broadcast(UICommand.java:300) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

          at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

          at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

          at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) [jsf-impl-2.1.7-jbossorg-2.jar:]

          at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.7-jbossorg-2.jar:]

          at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [jsf-impl-2.1.7-jbossorg-2.jar:]

          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

          at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]

          at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]

          at java.lang.Thread.run(Thread.java:679) [rt.jar:1.6.0_24]

      Caused by: java.lang.reflect.UndeclaredThrowableException

          at $Proxy25.helloWorld(Unknown Source)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_24]

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.6.0_24]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.6.0_24]

          at java.lang.reflect.Method.invoke(Method.java:616) [rt.jar:1.6.0_24]

          at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:44) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

          at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

          at org.jboss.weld.proxies.HelloWorld$1366014918$Proxy$_$$_WeldClientProxy.helloWorld(HelloWorld$1366014918$Proxy$_$$_WeldClientProxy.java) [weld-core-1.1.6.Final.jar:]

          at com.it.app.Called.yellow(Called.java:32) [classes:]

          at com.it.app.Called$Proxy$_$$_WeldClientProxy.yellow(Called$Proxy$_$$_WeldClientProxy.java) [classes:]

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

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.6.0_24]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.6.0_24]

          at java.lang.reflect.Method.invoke(Method.java:616) [rt.jar:1.6.0_24]

          at org.apache.el.parser.AstValue.invoke(AstValue.java:262) [jbossweb-7.0.13.Final.jar:]

          at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278) [jbossweb-7.0.13.Final.jar:]

          at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:39) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

          at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

          at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:153) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

          ... 25 more

      Caused by: org.switchyard.component.bean.BeanComponentException: A service reference to service 'HelloWorld' is not bound into this client proxy instance.  A reference configuration to the service may be required in the application configuration.

          at org.switchyard.component.bean.ClientProxyBean$ClientProxyInvocationHandler.invoke(ClientProxyBean.java:274) [switchyard-component-bean-0.5.0.Final.jar:0.5.0.Final]

          ... 44 more

       

       

      Any help would be welcome.

       

      Attached are the project source in a tar.gz and the compiled package in a war container.

        • 1. Re: CDI Bean error, help
          Rob Cernich Master

          Hey Gustavo,

           

          You should have a look at the webapp-deploy quickstart in the demos directory.  I think you're missing a bunch of jars required to run in a simple web container (i.e. not as7 with SwitchYard installed).

           

          Hope that helps,

          Rob

          • 2. Re: CDI Bean error, help
            Gustavo Pires Newbie

            What do I have to look for?

             

            I ran mvn package on the webapp-deploy folder and successfully deployed the resulting jar and war files. When I tried browsing for http://localhost:8080/switchyard-quickstart-demo-webapp-deploy/BaseWebService, the following xml was displayed:

             

            <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

                 <soap:Body>

                      <soap:Fault>

                           <faultcode>soap:Server</faultcode>

                           <faultstring>Fault occurred while processing.</faultstring>

                      </soap:Fault>

                 </soap:Body>

            </soap:Envelope>

             

            along with the following error on the server:

             

            16:38:49,436 ERROR [org.jboss.ws.common.invocation.InvocationHandlerJAXWS] (http--127.0.0.1-8080-1) Method invocation failed with exception: null: java.lang.reflect.InvocationTargetException

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

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.6.0_24]

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.6.0_24]

            at java.lang.reflect.Method.invoke(Method.java:616) [rt.jar:1.6.0_24]

            at org.jboss.ws.common.invocation.AbstractInvocationHandlerJSE.invoke(AbstractInvocationHandlerJSE.java:111)

            at org.jboss.wsf.stack.cxf.JBossWSInvoker._invokeInternal(JBossWSInvoker.java:181)

            at org.jboss.wsf.stack.cxf.JBossWSInvoker.invoke(JBossWSInvoker.java:127)

            at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)

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

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

            at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.6.0_24]

            at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)

            at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)

            at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)

            at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)

            at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:207)

            at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:91)

            at org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:169)

            at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:87)

            at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:185)

            at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:113)

            at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) [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)

            at org.jboss.wsf.spi.deployment.WSFServlet.service(WSFServlet.java:140) [jbossws-spi-2.0.3.GA.jar:2.0.3.GA]

            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) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

            at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]

            at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]

            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]

            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]

            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]

            at java.lang.Thread.run(Thread.java:679) [rt.jar:1.6.0_24]

            Caused by: java.lang.NullPointerException

            at org.switchyard.component.soap.endpoint.BaseWebService.invoke(BaseWebService.java:113) [switchyard-component-soap-0.5.0.Final.jar:0.5.0.Final]

            at org.switchyard.component.soap.endpoint.BaseWebService.invoke(BaseWebService.java:43) [switchyard-component-soap-0.5.0.Final.jar:0.5.0.Final]

            ... 41 more

             

            16:38:49,483 WARNING [org.apache.cxf.phase.PhaseInterceptorChain] (http--127.0.0.1-8080-1) Application {http://endpoint.soap.component.switchyard.org/}BaseWebServiceService has thrown exception, unwinding now: org.apache.cxf.interceptor.Fault

            at org.jboss.wsf.stack.cxf.JBossWSInvoker.createFault(JBossWSInvoker.java:246)

            at org.jboss.wsf.stack.cxf.JBossWSInvoker._invokeInternal(JBossWSInvoker.java:201)

            at org.jboss.wsf.stack.cxf.JBossWSInvoker.invoke(JBossWSInvoker.java:127)

            at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)

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

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

            at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.6.0_24]

            at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)

            at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)

            at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)

            at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)

            at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:207)

            at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:91)

            at org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:169)

            at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:87)

            at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:185)

            at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:113)

            at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) [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)

            at org.jboss.wsf.spi.deployment.WSFServlet.service(WSFServlet.java:140) [jbossws-spi-2.0.3.GA.jar:2.0.3.GA]

            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) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

            at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62) [weld-core-1.1.6.Final.jar:2012-03-21 18:52]

            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]

            at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]

            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]

            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]

            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]

            at java.lang.Thread.run(Thread.java:679) [rt.jar:1.6.0_24]

            Caused by: java.lang.NullPointerException

            at org.switchyard.component.soap.endpoint.BaseWebService.invoke(BaseWebService.java:113) [switchyard-component-soap-0.5.0.Final.jar:0.5.0.Final]

            at org.switchyard.component.soap.endpoint.BaseWebService.invoke(BaseWebService.java:43) [switchyard-component-soap-0.5.0.Final.jar:0.5.0.Final]

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

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.6.0_24]

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.6.0_24]

            at java.lang.reflect.Method.invoke(Method.java:616) [rt.jar:1.6.0_24]

            at org.jboss.ws.common.invocation.AbstractInvocationHandlerJSE.invoke(AbstractInvocationHandlerJSE.java:111)

            at org.jboss.wsf.stack.cxf.JBossWSInvoker._invokeInternal(JBossWSInvoker.java:181)

            ... 35 more

             

            • 3. Re: CDI Bean error, help
              Rob Cernich Master

              Gustavo,

               

              Are you trying to deploy to a generic web container or are you using the SwitchYard AS7 Distribution (from the SwitchYard downloads page)?

               

              FYI, the webapp-deploy quickstart does not include a web page, so you'd have to send a valid soap message to the service (using something like soap ui).  This demo is also for deploying to a generic web container.  If you're deploying to an instance of thw SwitchYard AS7 distro, I would recommend looking at the orders demo (demos/orders).

               

              Best,

              Rob

              1 of 1 people found this helpful
              • 4. Re: CDI Bean error, help
                Magesh Bojan Master

                I think your problem is that you are trying to @Inject a SwitchYard @Reference into a CDI Bean. I am not sure that has been implemented or if that is a bug. I tested it in AS7 and from the logs, the reference proxy is being called, but the Service is not set on the proxy. I filed a JIRA.

                 

                https://issues.jboss.org/browse/SWITCHYARD-1016

                 

                You can use Camel route or SOAP binding to call a SwitchYard service.

                • 5. Re: CDI Bean error, help
                  Keith Babo Master

                  You can use @Inject in a CDI Bean without @Service.  Here's an example:

                  https://github.com/jboss-switchyard/quickstarts/blob/master/demos/orders/src/main/java/org/switchyard/quickstarts/demos/orders/Order.java

                   

                  That quickstart doesn't run as part of our release test suite, so it might be possible there's been a regression.  I will try it out with 0.6 right now to make sure it still works.

                   

                  As Rob mentioned above, there's a good chance this is due to the fact that the app is being deployed to Tomcat instead of AS 7.  To be perfectly honest, our documentation on deploying to Tomcat sucks.  There is an example app out there, but the user has to gather up a bunch of runtime dependencies on their own (CDI ,etc.) and package it up with the app.  It would be nice if we could eventually produce a jar/zip out of our release build which contained all this stuff and then users could just dump that into their app or Tomcat lib.  Definitely an area which could use some improvement.

                  1 of 1 people found this helpful
                  • 7. Re: CDI Bean error, help
                    Tomohisa igarashi Master

                    And your app works by

                     

                    1) move WEB-INF/classes/META-INF/switchyard.xml to META-INF/switchyard.xml

                    2) add "Called" component definition into switchyard.xml

                     

                    orders demo Keith mentioned has these answers though... just had a look for my curiousity