3 Replies Latest reply on Mar 21, 2003 1:23 PM by davidjencks

    Struts Actions and java: namespace

    sdrw98

      Hi All,

      I'm trying to access a datasource from one of my Struts Action subclasses. However, when I create an InitialContext, it is missing the java: namespace. I understand from reading the forum and docs that the java: namespace is only available from within the JBoss JVM, but I think that the default configuration for jboss-3.0.6_tomcat-4.1.18 is that tomcat and JBoss run in the same JVM.

      I am using a jndi.properties, and lookups to EJBs work fine - it's just the java: namespace that is eluding me.

      Any suggestions?

      Thanks,

      Scott

        • 1. Re: Struts Actions and java: namespace
          davidjencks

          try removing the jndi.properties. It's probably making your lookups go through tcp/ip outside the jboss vm.

          • 2. Re: Struts Actions and java: namespace
            sdrw98

            That may be so, but when I don't have the jndi.properties, the lookup throws a communication exception and doesn't even manage to connect to JBoss' JNDI.

            Is there something I can put in jndi.properties or in the InitialContext's hash map parameter that would allow me to specify in-JVM lookups?


            > try removing the jndi.properties. It's probably
            > making your lookups go through tcp/ip outside the
            > jboss vm.

            • 3. Re: Struts Actions and java: namespace
              davidjencks

              Maybe it's the servlet 2.3 classloading model. Does your jndi.properties look like this?

              java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
              java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
              # Do NOT uncomment this line as it causes in VM calls to go over
              # RMI!
              #java.naming.provider.url=localhost