[jboss-jira] [JBoss JIRA] Commented: (EJBTHREE-641) entitymanager is null then using @WebService and @Stateless annotations in one class

Jason T. Greene (JIRA) jira-events at jboss.com
Tue Nov 14 12:46:42 EST 2006


    [ http://jira.jboss.com/jira/browse/EJBTHREE-641?page=comments#action_12347015 ] 
            
Jason T. Greene commented on EJBTHREE-641:
------------------------------------------

2006-06-29 17:24:02,815 ERROR [STDERR] at com.sun.xml.ws.api.server.InstanceResolver$1.invoke(InstanceResolver.java:127)
2006-06-29 17:24:02,815 ERROR [STDERR] at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:247)
2006-06-29 17:24:02,815 ERROR [STDERR] at com.sun.xml.ws.server.sei.SEIInvokerPipe.process(SEIInvokerPipe.java:97)
2006-06-29 17:24:02,815 ERROR [STDERR] at com.sun.xml.ws.protocol.soap.ServerMUPipe.process(ServerMUPipe.java:62)
2006-06-29 17:24:02,815 ERROR [STDERR] at com.sun.xml.ws.server.WSEndpointImpl$1.process(WSEndpointImpl.java:139)
2006-06-29 17:24:02,815 ERROR [STDERR] at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:139)
2006-06-29 17:24:02,815 ERROR [STDERR] at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:211)
2006-06-29 17:24:02,815 ERROR [STDERR] at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:97)
2006-06-29 17:24:02,815 ERROR [STDERR] at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:161)
2006-06-29 17:24:02,815 ERROR [STDERR] at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:49) 


You are using the Sun WS stack instead of ours, EJB3 integration requires container specific hooks, so the Sun stack will only integrate with EJB3 on the Sun EJB3 implementation, and our EJB3 implementation can only be used with the jbossws stack.

If you want to continue using the Sun stack, then you will need to use the servlet model instead of the EJB3 model, and then delgate to the EJB3. 
Otherwise, if you want to use ours, you do not need to deploy a war, you simply annotate the bean and deploy. We however do not yet support the full JAX-WS spec, we only support JSR-181. So at the current jbossws release of 1.0.3SP1, you could not use the SOAP 1.2 binding. Full JAX-WS support is our top priority and will be included in jbossws 2.0, which will also be a part of jboss 5.

http://labs.jboss.com/portal/jbossws/user-guide/en/html/endpoints.html#jsr181-endpoints

Also, 4.0.4 comes with jbossws 1.0.0, so I recommend upgrading it:

http://labs.jboss.com/portal/jbossws/downloads

-Jason

> entitymanager is null then using @WebService and @Stateless annotations in one class
> ------------------------------------------------------------------------------------
>
>                 Key: EJBTHREE-641
>                 URL: http://jira.jboss.com/jira/browse/EJBTHREE-641
>             Project: EJB 3.0
>          Issue Type: Bug
>    Affects Versions: EJB 3.0 RC8 - FD
>            Reporter: Ramil Israfilov
>             Fix For: EJB 3.0 RC10 - FD
>
>
> I have a class with both @Stateless and @WebService annotation and injected entitymanager:
> @WebService(name = "WebServiceTest", 
>         targetNamespace = "http://accesspoint.jc/server" )
> @SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
> @BindingType(value=javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_MTOM_BINDING)
> @Remote(ServerInterface.class)
> public class Server implements ServerInterface {
>       @PersistenceContext(unitName="CertiOneAccessPoint")
> 	EntityManager em;
>     @WebMethod
>     public SessionResponse createSession(SessionRequest sessionRequest) {
>         log.debug("sessionRequest"+sessionRequest);
>         SessionResponse resp = new SessionResponse();
>         Session session = new Session();
>         session=(Session) em.persist(session);
>         resp.setSessionId(session.getId());
>         return resp;
>     }
> }
> I can successfully package and deploy EAR file.
> If I access EJB3 bean from remote application using JNDI lookup then everything works ok.
> But if I try to access webservice I got null pointer exception on line: session=(Session) em.persist(session);
> 2006-06-29 17:24:02,815 DEBUG [be.certipost.jc.accesspoint.server.impl.Server] sessionRequestbe.certipost.jc.accesspoint.server.SessionRequest at fbf04a
> 2006-06-29 17:24:02,815 ERROR [STDERR] java.lang.NullPointerException
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at be.certipost.jc.accesspoint.server.impl.Server.createSession(Server.java:51)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at java.lang.reflect.Method.invoke(Method.java:585)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at com.sun.xml.ws.api.server.InstanceResolver$1.invoke(InstanceResolver.java:127)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:247)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at com.sun.xml.ws.server.sei.SEIInvokerPipe.process(SEIInvokerPipe.java:97)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at com.sun.xml.ws.protocol.soap.ServerMUPipe.process(ServerMUPipe.java:62)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at com.sun.xml.ws.server.WSEndpointImpl$1.process(WSEndpointImpl.java:139)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:139)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:211)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:97)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:161)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:49)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
> 2006-06-29 17:24:02,815 ERROR [STDERR] 	at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
> 2006-06-29 17:24:02,831 ERROR [STDERR] 	at java.lang.Thread.run(Thread.java:595)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list