3 Replies Latest reply on Dec 26, 2005 2:12 AM by asha_vade

    application resource file:  java.naming.factory.initial

    bill.burke

      (sorry for duplicated posting in Benchmarking forum).
      We are trying to test JBoss on AS/400 and Mainframe installations.

      However, I'm having problems building the testsuite (still on W2K). I could not find the right place to define the classpath. I tried to add entries in the build.bat file, but are not recognized by the builder. Example error message:

      "BUILD FAILED
      C:\JBoss\jboss-3.2.5-src\testsuite\build.xml:955: Can't create a jbossnet elemen
      t under webserviceejbdoclet. Make sure the jar file containing the corresponding
      subtask class is on the classpath specified in the that defined {2}."



      I would really appreciate any help.

      Thanks,

      Jack

        • 1. Re: application resource file:  java.naming.factory.initial
          murtuza52

          From the discussion in other forum, i understand that we need to include jndi.properties in the classpath of the client. The jndi.properties is as follows (this assumes that you are running JBoss and client on the same machine or u'll need to make appropariate changes)

          java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
          java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
          java.naming.provider.url=localhost


          I get following error when i run myclient even when i have the property file in the class path. I am sure we need to include more class libraries in the path which is not very clear even in the tutorial.

          Exception in thread "main" javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
          at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
          at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
          at javax.naming.InitialContext.init(Unknown Source)
          at javax.naming.InitialContext.(Unknown Source)
          at com.kt.test.order.Client.main(Client.java:20)
          Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory
          at java.net.URLClassLoader$1.run(Unknown Source)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(Unknown Source)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          at java.lang.ClassLoader.loadClassInternal(Unknown Source)
          at java.lang.Class.forName0(Native Method)
          at java.lang.Class.forName(Unknown Source)
          at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)
          ... 5 more


          Can anyone tell us what libraries we need to include to run simple Client.java file included in Entity tutorial. Here is the code that throws error:

          InitialContext ctx = new InitialContext();
          ShoppingCart cart = (ShoppingCart) ctx.lookup(ShoppingCart.class.getName());


          Thanks in advance
          Murtuza

          • 2. Re: application resource file:  java.naming.factory.initial
            murtuza52

            I finally got the client running, this link will give you some information http://www.jboss.org/index.html?module=bb&op=viewtopic&t=61562 but it is not full list (atleast it did not run the client for me), here is the full list

            client/
            jbossall-client.jar
            concurrent.jar
            jboss-common-client.jar
            jboss-j2ee.jar
            jboss-transaction-client.jar
            jbosssx-client.jar
            jnp-client.jar

            server/all/lib/
            jboss-remoting.jar

            server/all/deploy/ejb3.deployer/
            jboss-ejb3.jar
            jboss-ejb3.jar
            hibernate3.jar
            commons-loggin.jar
            commons-httpclient.jar

            server/all/deploy/jboss-aop-jdk50.deployer/
            jboss-aop-jdk50.jar
            jboss-aspect-library-jdk50.jar

            Murtuza

            • 3. Re: application resource file:  java.naming.factory.initial
              asha_vade

              Hey there, thanks a ton for this info. I have been struggling with this problem too for a long time. And now after including all the jar files, my client is up and running :)


              "murtuza52" wrote:
              From the discussion in other forum, i understand that we need to include jndi.properties in the classpath of the client. The jndi.properties is as follows (this assumes that you are running JBoss and client on the same machine or u'll need to make appropariate changes)

              java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
              java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
              java.naming.provider.url=localhost


              I get following error when i run myclient even when i have the property file in the class path. I am sure we need to include more class libraries in the path which is not very clear even in the tutorial.

              Exception in thread "main" javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
              at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
              at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
              at javax.naming.InitialContext.init(Unknown Source)
              at javax.naming.InitialContext.<init>(Unknown Source)
              at com.kt.test.order.Client.main(Client.java:20)
              Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory
              at java.net.URLClassLoader$1.run(Unknown Source)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(Unknown Source)
              at java.lang.ClassLoader.loadClass(Unknown Source)
              at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
              at java.lang.ClassLoader.loadClass(Unknown Source)
              at java.lang.ClassLoader.loadClassInternal(Unknown Source)
              at java.lang.Class.forName0(Native Method)
              at java.lang.Class.forName(Unknown Source)
              at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)
              ... 5 more


              Can anyone tell us what libraries we need to include to run simple Client.java file included in Entity tutorial. Here is the code that throws error:

              InitialContext ctx = new InitialContext();
              ShoppingCart cart = (ShoppingCart) ctx.lookup(ShoppingCart.class.getName());


              Thanks in advance
              Murtuza