users@glassfish.java.net

Exception calling a WS from a stateful bean with Glassfish 2.1

From: <glassfish_at_javadesktop.org>
Date: Thu, 25 Feb 2010 07:37:21 PST

Hi all,

I'm getting an error when my application try to call a Web Service from a stateful session Bean. The exception occures after this line:

[b]dispatch = service.createDispatch(portQName, SOAPMessage.class, Service.Mode.MESSAGE);[/b]


Here is the output:
[i] at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1011)
        at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:175)
        at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2920)
        at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4011)
        at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:203)
        at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:117)
        at $Proxy137.drawLeistung(Unknown Source)
        at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:154)
        at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:687)
        at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:227)
        at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1846)
        at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1706)
        at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:1088)
        at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:223)
        at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:806)
        at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch(CorbaMessageMediatorImpl.java:563)
        at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork(CorbaMessageMediatorImpl.java:2567)
        at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
[/i]



My bean:
[i]@Stateful
@Remote(EAP.class)
public class EAPBean implements EAP {

    @PersistenceContext(type = PersistenceContextType.TRANSACTION)
    private EntityManager em;

...etc...

   @Override
    public AuftragsEntity drawLeistung() throws EAPException {
        QName serviceQName = new QName(this.nameSpace,this.serviceName,"");
        QName portQName = new QName(this.nameSpace,this.portName,"");

        // Create a dynamic Service instance
        Service service = Service.create(serviceQName);

        // Add a port to the Service
        service.addPort(portQName, SOAPBinding.SOAP11HTTP_BINDING, endpointURL);

        //Create a dispatch instance
[b] Dispatch<SOAPMessage> dispatch = service.createDispatch(portQName, SOAPMessage.class, Service.Mode.MESSAGE);[/b]

... etc

        } catch (Exception e) {
            throw new EAPException(e.getMessage());
        }
    }
}
[/i]


Does anybody can help me?

Best regards,
bhj2
[Message sent by forum member 'bhj2' (bhj2_at_bfh.ch)]

http://forums.java.net/jive/thread.jspa?messageID=388684