0 Replies Latest reply on Feb 11, 2009 9:12 AM by Jean Deruelle

    JBoss 5 EJB Container JNDI question

    Jean Deruelle Newbie


      We are currently porting our implementation of Sip Servlets (see http://www.mobicents.org/products_sip_servlets.html) on top of JBoss 5 (currently working on Tomcat and Jboss AS 4.2.3).

      Our source code for the port is currently available from http://code.google.com/p/mobicents/source/browse/trunk/servers/sip-servlets/sip-servlets-jboss5 (svn browsing)

      The Sip Servlets spec mandates that for converged containers, a SipFactory would appear as java:/comp/env/sip///SipFactory (where appname is the name of the sip servlets application deployed similarly to a web applciation) in the JNDI mapping or injected as an @Resource annotation. This annotation can be used in any SIP Servlet or a JEE application component deployed on the converged container in the same EAR archive file.

      The SipFactory is an interface for a variety of SIP Servlet API abstractions, which could allow an EJB to initiate a sip call by example.

      In an EAR, we could have many Sip Servlets Applications, so we would need when deploying the sip applications (Tomcat Contexts) to be able to access the private naming context (java:/comp/env/) of the JEE components in the EAR file (EJB, webservices, mdb, ...) to inject the SipFactory of each app bundled within the EAR.

      I was currently able to do it quite easily (see http://code.google.com/p/mobicents/source/browse/trunk/servers/sip-servlets/sip-servlets-jboss5/src/main/java/org/jboss/web/tomcat/service/deployers/TomcatConvergedDeployment.java?spec=svn4763&r=4763#413)

      But I want to be 100% this will work in all cases so here is my questions :
      Can I be 100% sure that the EJB Containers will always be deployed before the web applications ? On what is based the deploy ordering of components within an EAR ?

      To detect that a deployment unit has JEE componenst I check if it has an Ejb3Deployment attached to its deployment unit (see http://code.google.com/p/mobicents/source/browse/trunk/servers/sip-servlets/sip-servlets-jboss5/src/main/java/org/jboss/web/tomcat/service/deployers/TomcatConvergedDeployment.java?spec=svn4763&r=4763#431), may I miss some other JEE components this way ?

      Thanks in advance
      Best regards
      Jean Deruelle,
      JBoss, a division of Red Hat