I declared an @Stateful bean implementation to also be an @WebService. When I did this, I got the following exception. I scanned the code of StatefulContainer and it appeared to extend/implement the same interfaces as Stateless container. In addition, with the assert in front of of the cast.. I dont believe this exception should occur.
Any advice on what I may have done wrong?
java.lang.ClassCastException: org.jboss.ejb3.stateful.StatefulContainer cannot be cast to org.jboss.wsf.spi.invocation.integration.ServiceEndpointContainer
at org.jboss.wsf.container.jboss50.invocation.InvocationHandlerEJB3.lazyInitializeInvocationTarget(InvocationHandlerEJB3.java:79)
at org.jboss.wsf.container.jboss50.invocation.InvocationHandlerEJB3.invoke(InvocationHandlerEJB3.java:89)
at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:219)
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:498)
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:295)
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:205)
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:131)
at org.jboss.wsf.common.servlet.AbstractEndpointServlet.service(AbstractEndpointServlet.java:109)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
Can web service be stateful?
see http://www.coderanch.com/t/419120/Web-Services-Certification-SCDJWS/certification/Stateful-Web-Service