0 Replies Latest reply on Dec 25, 2009 4:19 PM by Markus Weiss

    Webservice in GlassFish

    Markus Weiss Newbie

      Hi,


      I've got the following problem. I have a little Seam application (EAR) wich was initially made with seam-gen and uses seam generated entities for persistence. This application works after I followed the instructions for deploying in GlassFish really well.


      Now I just want to provide some Webservices for the base entities because it should be used in a SOA environment with the basic functions like create, update... I followed the instructions in chapter 24 of the seam documentation and created a stateless webservice (with standard-jaxws-endpoint-config.xml ...). Everytime I try to call the webservice from outside I get a:


      org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.web.session
              at org.jboss.seam.Component.newInstance(Component.java:2144)
              at org.jboss.seam.Component.getInstance(Component.java:2021)
              at org.jboss.seam.Component.getInstance(Component.java:2000)
              at org.jboss.seam.Component.getInstance(Component.java:1994)
              at org.jboss.seam.Component.getInstance(Component.java:1967)
              at org.jboss.seam.web.Session.getInstance(Session.java:122)
              at org.jboss.seam.contexts.Contexts.flushAndDestroyContexts(Contexts.java:375)
              at org.jboss.seam.contexts.Lifecycle.endRequest(Lifecycle.java:154)
              at org.jboss.seam.webservice.SOAPRequestHandler.close(SOAPRequestHandler.java:159)
              at com.sun.xml.ws.handler.HandlerProcessor.closeHandlers(HandlerProcessor.java:414)
              at com.sun.xml.ws.handler.HandlerTube.closeServersideHandlers(HandlerTube.java:280)
              at com.sun.xml.ws.handler.ServerSOAPHandlerTube.closeHandlers(ServerSOAPHandlerTube.java:172)
              at com.sun.xml.ws.handler.HandlerTube.close(HandlerTube.java:223)
              at com.sun.xml.ws.handler.HandlerTube.close(HandlerTube.java:218)
              at com.sun.xml.ws.handler.ServerMessageHandlerTube.initiateClosing(ServerMessageHandlerTube.java:116)
              at com.sun.xml.ws.handler.HandlerTube.processException(HandlerTube.java:178)
              at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:590)
              at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
              at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
              at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
              at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:106)
              at com.sun.enterprise.webservice.MonitoringPipe.process(MonitoringPipe.java:147)
              at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)
              at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
              at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
              at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
              at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
              at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:106)
              at com.sun.xml.ws.tx.service.TxServerPipe.process(TxServerPipe.java:317)
              at com.sun.enterprise.webservice.CommonServerSecurityPipe.processRequest(CommonServerSecurityPipe.java:222)
              at com.sun.enterprise.webservice.CommonServerSecurityPipe.process(CommonServerSecurityPipe.java:133)
              at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)
              at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
              at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
              at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
              at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
              at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
              at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:444)
              at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
              at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
              at com.sun.enterprise.webservice.Ejb3MessageDispatcher.handlePost(Ejb3MessageDispatcher.java:113)
              at com.sun.enterprise.webservice.Ejb3MessageDispatcher.invoke(Ejb3MessageDispatcher.java:87)
              at com.sun.enterprise.webservice.EjbWebServiceServlet.dispatchToEjbEndpoint(EjbWebServiceServlet.java:231)
              at com.sun.enterprise.webservice.EjbWebServiceServlet.service(EjbWebServiceServlet.java:157)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
              at com.sun.enterprise.web.AdHocContextValve.invoke(AdHocContextValve.java:114)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
              at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:87)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
              at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1093)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
              at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1093)
              at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:291)
              at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:666)
              at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:597)
              at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:872)
              at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
              at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
              at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
              at com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:382)
              at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:264)
              at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
      Caused by: java.lang.NullPointerException
              at org.jboss.seam.servlet.ServletRequestSessionMap.put(ServletRequestSessionMap.java:88)
              at org.jboss.seam.servlet.ServletRequestSessionMap.put(ServletRequestSessionMap.java:25)
              at org.jboss.seam.contexts.BasicContext.set(BasicContext.java:84)
              at org.jboss.seam.Component.newInstance(Component.java:2126)
              ... 69 more
      WSTX-SERVICE-5015: Handling exception to complete JTA transaction created by WS-TX service handler
      org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.core.conversationEntries
              at org.jboss.seam.Component.newInstance(Component.java:2144)
              at org.jboss.seam.Component.getInstance(Component.java:2021)
              at org.jboss.seam.Component.getInstance(Component.java:2000)
              at org.jboss.seam.Component.getInstance(Component.java:1994)
              at org.jboss.seam.Component.getInstance(Component.java:1967)
              at org.jboss.seam.core.ConversationEntries.getInstance(ConversationEntries.java:103)
              at org.jboss.seam.core.Manager.removeCurrentConversationAndDestroyNestedContexts(Manager.java:493)
              at org.jboss.seam.core.Manager.endRequest(Manager.java:462)
              at org.jboss.seam.webservice.SOAPRequestHandler.handleOutbound(SOAPRequestHandler.java:116)
              at org.jboss.seam.webservice.SOAPRequestHandler.handleMessage(SOAPRequestHandler.java:56)
              at com.sun.xml.ws.handler.HandlerProcessor.callHandleMessageReverse(HandlerProcessor.java:336)
              at com.sun.xml.ws.handler.HandlerProcessor.callHandlersResponse(HandlerProcessor.java:207)
              at com.sun.xml.ws.handler.ServerSOAPHandlerTube.callHandlersOnResponse(ServerSOAPHandlerTube.java:160)
              at com.sun.xml.ws.handler.HandlerTube.processResponse(HandlerTube.java:160)
              at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:605)
              at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
              at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
              at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
              at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:106)
              at com.sun.enterprise.webservice.MonitoringPipe.process(MonitoringPipe.java:147)
              at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)
              at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
              at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
              at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
              at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
              at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:106)
              at com.sun.xml.ws.tx.service.TxServerPipe.process(TxServerPipe.java:317)
              at com.sun.enterprise.webservice.CommonServerSecurityPipe.processRequest(CommonServerSecurityPipe.java:222)
              at com.sun.enterprise.webservice.CommonServerSecurityPipe.process(CommonServerSecurityPipe.java:133)
              at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)
              at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
              at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
              at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
              at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
              at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
              at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:444)
              at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
              at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
              at com.sun.enterprise.webservice.Ejb3MessageDispatcher.handlePost(Ejb3MessageDispatcher.java:113)
              at com.sun.enterprise.webservice.Ejb3MessageDispatcher.invoke(Ejb3MessageDispatcher.java:87)
              at com.sun.enterprise.webservice.EjbWebServiceServlet.dispatchToEjbEndpoint(EjbWebServiceServlet.java:231)
              at com.sun.enterprise.webservice.EjbWebServiceServlet.service(EjbWebServiceServlet.java:157)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
              at com.sun.enterprise.web.AdHocContextValve.invoke(AdHocContextValve.java:114)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
              at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:87)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
              at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1093)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
              at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1093)
              at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:291)
              at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:666)
              at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:597)
              at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:872)
              at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
              at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
              at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
              at com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:382)
              at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:264)
              at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
      Caused by: java.lang.NullPointerException
              at org.jboss.seam.servlet.ServletRequestSessionMap.put(ServletRequestSessionMap.java:88)
              at org.jboss.seam.servlet.ServletRequestSessionMap.put(ServletRequestSessionMap.java:25)
              at org.jboss.seam.contexts.BasicContext.set(BasicContext.java:84)
              at org.jboss.seam.Component.newInstance(Component.java:2126)
              ... 67 more



      I also noticed the seambay example, but it is written for JBoss. I'm really tired of this problem, because I try to find a solution for it for some days now and I just don't know what I am doing wrong. I just wanted to use standard J2EE functionality together with seam in order to build some basic webservices and I can't get it working.


      Any help would be highly appriciated. Maybe someone could also provide a running example for GlassFish?


      Thx Markus