-
1. Re: Running Interest Example from Client
phykell Feb 5, 2002 12:19 PM (in response to phykell)OK sorted it.
There were a few simple mistakes in the above command line mainly no closing % for the env variables. However, to run the Interest example from the command line you have to specify the following on your class path:
1. %JBOSS_HOME%\client\jboss-j2ee.jar
2. %JBOSS_HOME%\client\jboss-client.jar
3. %JBOSS_HOME%\client\jnp-client.jar
4. %JBOSS_HOME%\client\jndi.jar
5. c:\examples\build-examples\interest\classes
6. c:\examples\resources
Line 4 represents the root relative to the EJB's package name, in the example's case:
org.jboss.docs.interest
This means that the InterestClient class is located at:
c:\examples\build-examples\interest\classes\org\jboss\docs\interest
Note that your command line must refer to the InterestClient class as such e.g.
java -cp -D<property list> org.jboss.docs.interest.InterestClient
Line 6 of the class path list includes the resources directory and simply contains the jndi.properties file which in turn contains the following:
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=localhost:1099
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
Alternatively, you can specify each of these using the -D option.
So we have the final command line:
java -cp %CLASSPATH%;%JBOSS_HOME%\client\jboss-j2ee.jar;%JBOSS_HOME%\client\jboss-client.jar;%JBOSS_HOME%\client\jnp-client.jar;c:\examples\build-examples\interest\classes;%JBOSS_HOME%\client\jndi.jar;c:\examples\resources;. org.jboss.docs.interest.InterestClient
OR if you want to specify the jndi properties on the same line and not use the jndi.properties file in the resources directory:
java -cp %CLASSPATH%;%JBOSS_HOME%\client\jboss-j2ee.jar;%JBOSS_HOME%\client\jboss-client.jar;%JBOSS_HOME%\client\jnp-client.jar;c:\examples\build-examples\interest\classes;%JBOSS_HOME%\client\jndi.jar;c:\examples\resources;. -Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory -Djava.naming.provider.url=localhost:1099 -Djava.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces org.jboss.docs.interest.InterestClient
Hope that helps.