6 Replies Latest reply on Feb 28, 2006 7:28 AM by erbora00

    How to run a stand alone application client

    shaiwolf

      Hi,

      I wrote a client application that uses a session bean and i want to test it.
      I packed it in a jar file and placed it in the deploy directory.
      Jboss recognized it by writing:
      [ClientDeployer] Client ENC bound under: TestClientApp

      However, I can't find the way to run it.
      How can I run the client application, so it can use the JBoss JNDI to look up for the bean and use it?

      Thanks you for yout help,
      Shai

        • 1. Re: How to run a stand alone application client
          poyge394

          You dont nead to deploy the client on the server. you just do a lookup on the JNDI server for finding your bean. you nead to have one jndi.propeties file in your classpath.
          sample jndi.properties

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



          / Poyan


          • 2. Re: How to run a stand alone application client

            Use a simple java class that can look up the JNDI name you have given.
            Once the lookup is successfull you can access the application.

            The stand alone java application need not be on the same server.


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

            if putting this piece of code in your stand alone program does not work
            put this part in the "jndi.properties" file and then put this file in the class path.


            Thanks in advance
            Ayusman

            • 3. Re: How to run a stand alone application client
              shaiwolf

              Hi,
              Thank you all for the replies.
              It really was the missing link in the code.
              Cheers,
              Shai :)

              • 4. Re: How to run a stand alone application client
                erbora00

                Hi,

                I have an issue on this even though I included the properties code as suggested.

                I can get the InitialContext but when I lookup the ejb I get:
                javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: com.etc.etc.HomeInterface (no security manager: RMI class loader disabled)]

                Is this a classpath issue? Any suggestions? I tried jbossall-client.jar etc...
                Couldn't make it work..

                Thanks.

                • 5. Re: How to run a stand alone application client
                  jaikiran

                   

                  Root exception is java.lang.ClassNotFoundException: com.etc.etc.HomeInterface


                  This class in not in the classpath. Put this class in the classpath

                  • 6. Re: How to run a stand alone application client
                    erbora00

                    Ok that was as simple as that. I forgot to add the jar :)
                    Thanks mate.