3 Replies Latest reply on Nov 7, 2003 4:23 AM by jonlee

    Problems accessing JNDI from Tomcat

    shanepreater

      My collegues and I are trying to connect our web app to the JBoss JNDI from a standalone instance of Tomcat.

      This instance is the one bundled with Netbeans 3.5

      We have loaded the jndi.properties from the jboss installation and entered these into the InitialContext of the servlet.

      This throws the following exception:
      javax.naming.CommunicationException [Root exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.net.MalformedURLException: no protocol: Files/j2sdk_nb/netbeans3.5.1/tomcat406/classes/]

      The jndi.properties we are using are:
      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
      java.naming.provider.url=jnp://10.0.13.40:1099

      Any help would be much obliged.

      Thanks,
      Shane Preater

        • 1. Re: Problems accessing JNDI from Tomcat
          darranl

          The web application will need to have the jars in {jboss.server}/client available in it's classpath somewhere.

          When you say We have loaded the jndi.properties from the jboss installation which jndi.properties do you mean?

          If you mean that you have changed the one in {jboss.server}/server/default/conf you need to change it back to it's original values and give the client it's own jndi.properties.

          • 2. Re: Problems accessing JNDI from Tomcat
            shanepreater

            Sorry yes we have made a copy of the jndi.properties file the only item we have changed is the URI of the server as it is no longer localhost.

            We have also copied all the required Jar's into Tomcats lib directory but this problem still persists.

            • 3. Re: Problems accessing JNDI from Tomcat
              jonlee

              Don't have NetBeans (and thus the Tomcat instance) installed in a directory path with a space in it. Note the complaint of no protocol - you will probably find it got confused with the space between Program and Files.
              e.g. "Program Files/j2sdk_nb/netbeans3.5.1/tomcat406/classes/" became
              "Files/j2sdk_nb/netbeans3.5.1/tomcat406/classes/".

              It should also be better for NetBeans in general.