]
Carlo de Wolf updated EJBTHREE-641:
-----------------------------------
Fix Version/s: AS 4.2.0 CR2
(was: AS 4.2.0 CR1)
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: AS 4.2.0 CR2
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@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: