7 Replies Latest reply on May 2, 2002 1:19 PM by adrian.brock

    Call a local Interface from a Servlet

    iddy

      Hi

      I am try to pass the HttpservletRequest and HttpServletResponse objects to my EJB application layer. I have a servlet (Controller) that obtains a remote reference to a Session EJB (WorkflowController) and invokes its process method(HtppServletRequest, HttpServletResponse).

      However, this approach fails because the actual implementations of the request and response objects are not serializable and so cannot be passed in the remote call. I have made a working assumption that I can add a Local Interface to my session EJB and call the process method locally (passing the request and response objects by reference). I have created the Local interface and added it to my ejb jar file and ejb-jar.xml (below)



      <ejb-jar>
      <display-name>workflow</display-name>
      <enterprise-beans>

      <display-name>WorkflowControllerBean</display-name>
      <ejb-name>WorkflowController</ejb-name>
      com.intelligentdecisioning.excalibur.merlin.WorkflowControllerHome
      com.intelligentdecisioning.excalibur.merlin.WorkflowController
      <local-home>com.intelligentdecisioning.excalibur.merlin.WorkflowControllerLocalHome</local-home>
      com.intelligentdecisioning.excalibur.merlin.WorkflowControllerLocal
      <ejb-class>com.intelligentdecisioning.excalibur.merlin.WorkflowControllerBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Bean</transaction-type>
      <security-identity>

      <use-caller-identity></use-caller-identity>
      </security-identity>

      </enterprise-beans>
      </ejb-jar>



      However, I dont know how to get a reference to the Local Interface to make the call (i.e what is its jndi name ?). I have made serveral attempts but keep getting jndi lookup failures (name not bound) - could someone please explain how to get and call the local interface or send me an example

      I am using jboss_2.4.4 with tomcat 4.1 (running together)


      Thanks

      Iddy