5 Replies Latest reply on Aug 6, 2002 9:52 PM by Meggie tran

    client fails to run on template project

    david freer Newbie

      Hi Jboss Developers,

      I have built and installed the JBOSS 3.0 template project and started JBOSS. However the client fails to run.

      I issue the run-cient.sh command and get the following

      javax.naming.NoInitialContextException: Need to specifiy
      class name in environment or system property, or as an
      applet parameter, or in an application resource file:

      at javax.naming.spi.NamingManger.getInitialContext(NamingM638)
      at javax.naming.InitialContext.getDefaultInitCtx(initialConte
      at javax.naming.InitialContext.getURLorDefaultInitCtx(InitialContext.java.278)
      at javax.naming.InitialContext.lookup(InitialContext.java.345)
      at test.client.TestClient.main(TestClient.java:21)

      I am using suse linux version 7.0

      When I use the jsp page:
      it works fine.

      Any help much appreciated.

      David Freer.

        • 1. Re: client fails to run on template project
          Stefan Lettmayer Newbie

          Do you have an file named "jndi.properties" in the directory from which you start the client which contains these lines:


          If not, make one.

          - Stefan

          • 2. Re: client fails to run on template project
            Joel Vogt Master

            Or something like:

            java.util.Hashtable props = new java.util.Hashtable();
            props.put(Context.PROVIDER_URL, localhost);
            props.put("java.naming.rmi.security.manager", "yes");
            props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces

            Context context = new InitialContext(props);

            If you don't want to/can't use a props file

            • 3. Re: client fails to run on template project
              Alwyn Schoeman Newbie


              What if it still fails with same error even though the file exists and have
              precisely the contents in your post?

              • 4. Re: client fails to run on template project
                dofo Newbie


                I think that there are some pieces missing, this worked for me.

                props.put(InitialContext.PROVIDER_URL, "localhost");
                props.put("java.naming.rmi.security.manager", "yes");
                props.put(InitialContext.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");

                Doei Diego

                • 5. Re: client fails to run on template project
                  Meggie tran Newbie


                  I have the exact same problem...My template's JSP is under the webapp/test/jsp/index.jsp. And under webapp/test/WEB_INF/lib, my *.jar and &.war files are there. Under webapp/WEB_INF, i have the web.xml et jboss-web.xml. I've mounted those directories. But still, when acessing the index.jsp, i have this message :

                  javax.naming.NamingException: Cannot create resource instance

                  What could I possibly forgot to set up?

                  oh, btw, where should i copy the jndi.properties file?