1 Reply Latest reply on Aug 14, 2005 1:50 PM by Anirban Basu

    Web service (session) bean calling another entity bean

    Anirban Basu Newbie


      I have a session bean that exposes a Web service endpoint interface. I have generated WSDL, and all the necessary artefacts (using wscompile), packaged it and deployed it (on JBoss 4.0.2) all fine. This session bean makes some calls to another entity bean, which is also deployed on the same server but as a different enterprise application. While compiling my code for the web service session bean, I have used a JAR to reference the entity bean that is called. If I place this JAR in the server's lib (and restart), an EJBException (invalid invocation) is thrown when I call a method on the web service, which communicates with the entity bean in the other application. If I do not put the JAR in the lib directory, then a NoClassDefFoundError is thrown for the local interface of the entity bean I am trying to access. How do I get this deployment right.

      Generalizing the situation, the question is more like: how does a session bean from one enterprise application access an entity bean or a session bean in another enterprise application given that it meets the security constraint requirements and is deployed in the same server (so should be able to access local interfaces?)?

      Thanks in advance.


        • 1. Re: Web service (session) bean calling another entity bean
          Anirban Basu Newbie

          Never got a reply to this post but I have figured out the solution anyway. For anyone, who might face this situation: for a local call, both the beans must exist inside the same EAR (not necessarily inside the same ejb-jar). I was under the impression that according to J2EE specs, a local call can succeed if the caller and the callee are running inside the same EJB container inside the same JVM but with JBoss it looks like the caller and the callee must be inside the same enterprise application - makes more sense from a security perspective anyway :-)