1 Reply Latest reply on Aug 12, 2008 2:41 AM by jaikiran pai

    JBoss 4.2, Tomcat, and @Service ...

    Aaron Alpar Newbie

      Hi All,

      I have a service (singleton) that I want to access from a Tomcat servlet. The tomcat servlet cannot find the service using the MBean server's JNDI name - I always get the name not found exception.
      The service I have registered is using @Service annotation without the deployment descriptor. The creation, registration and starting of my singleton @Service object is successfully in the MBean server with the default JNDI name (I didn't assign one). The service has a @Local and @Management interface with no home interface to speak of. I don't anticipate that I will ever need a remote interface or binding since the service will always be used within the same JVM.

      - I've tried using the usual <resource-ref> <ejb-ref> in the "web.xml" with associated entries in the "jboss-web.xml" to map the "java:/comp/env/ejb/*" entry to the "jboss.j2ee:*" entry. Each time the tomcat end complains that it cannot find the JNDI name of the "jboss.j2ee:" service as registered in the MBean server (tomcat DOES follow the "java:comp/env/ejb" link successfully).
      - I've tried deployment of the tomcat "context.xml" file in META-INF to tell it about the JNDI bindings with the same result.

      Any ideas?!?! Any suggestions will be appreciated.