0 Replies Latest reply on May 15, 2002 10:26 AM by Jamal Karimi

    resolving ejb problem with embedded catalina

    Jamal Karimi Newbie

      Hello

      I have problems resolving ejb's from embedded catalina. But if I work with a standalone catalina 4.02 and RC1 I have no problems, all works.

      Can you please give me any howto resources, or some tips/steps which I can check?

      Thank you,
      Jamal

      Here are some source-pieces, which could be helpful (I hope).


      ** setting the servlet context in init() method of my servlet **

      Properties newProps = System.getProperties();
      newProps.put ("java.naming.factory.initial", getServletContext().getInitParameter ("java.naming.factory.initial"));
      newProps.put ("java.naming.provider.url", getServletContext().getInitParameter ("java.naming.provider.url"));
      System.setProperties (newProps);

      ** parameters come from my web.xml file **

      <context-param>
      <param-name>java.naming.factory.initial</param-name>
      <param-value>org.jnp.interfaces.NamingContextFactory</param-value>
      </context-param>
      <context-param>
      <param-name>java.naming.provider.url</param-name>
      <param-value>localhost:1099</param-value>
      </context-param>

      ***** ejb-declaration in web.xml ******

      <ejb-local-ref>
      <ejb-ref-name>MaskController</ejb-ref-name>
      <ejb-ref-type>Session</ejb-ref-type>
      <local-home>de.cursor.jevi.server.system.MaskControllerLocal</local-home>
      de.cursor.jevi.server.system.MaskController
      <ejb-link>MaskController</ejb-link>
      </ejb-local-ref>

      *** referencing to the declaration in ejb-jar.xml ***


      [CDATA[the maskcontrollerbean is the accesspoint for the client is possible to create,delete an to get mask information]]
      <display-name>MaskController</display-name>
      <ejb-name>MaskController</ejb-name>
      de.cursor.jevi.server.mask.MaskControllerHome
      de.cursor.jevi.server.mask.MaskController
      <local-home>de.cursor.jevi.server.mask.MaskControllerLocalHome</local-home>
      de.cursor.jevi.server.mask.MaskControllerLocal
      <ejb-class>de.cursor.jevi.server.mask.MaskControllerBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>
      <resource-ref>
      <res-ref-name>MainDS</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>