1 Reply Latest reply on Jun 10, 2009 5:13 AM by diegomansua

    Problems with JNDIBindingServiceMgr

      Hi. I'm migrating from Tomcat to JBoss and I'm facing a problem with a Tomcat valve we're using. This valve expected a resource declared using GlobalNamingResources, which, AFAIK, is not supported in JBoss and we're told to use JNDIBindingServiceMgr instead (https://jira.jboss.org/jira/browse/JBAS-1826).

      So, I've declared a JNDI binding using JNDIBindingServiceMgr on my jboss-service.xml, where I put the object that previously was bound using GlobalNamingResources.

      The problem is that this valve implements org.apache.catalina.Lifecycle, and it performs the JNDI lookup on its start() method, maybe too early because it seems JNDIBindingServiceMgr hasn't bound the object yet and throws a NameNotFoundException.

      I've made a simple web app with a servlet which performs a lookup for the same name and it retrieves the object correctly. It also shows on JNDIView.

      In my logs, it seems that JNDIBindingServiceMgr is created before the valve tries to get the object:

      2009-06-10 09:28:10,859 DEBUG [org.jboss.system.ServiceController] Creating service jboss.tests:service=JNDIBindingServiceMgr
      2009-06-10 09:28:10,859 DEBUG [org.jboss.naming.JNDIBindingServiceMgr] Creating jboss.tests:service=JNDIBindingServiceMgr
      2009-06-10 09:28:10,859 DEBUG [org.jboss.naming.JNDIBindingServiceMgr] Created jboss.tests:service=JNDIBindingServiceMgr
      ...
      2009-06-10 09:28:19,765 ERROR [org.apache.catalina.startup.Catalina] Catalina.start:
      LifecycleException: javax.naming.NameNotFoundException: protocolConfiguration not bound
      


      Is there anything I can do?

      Thanks in advance