Prev | Next

TOC | Index

J2EETM Developer's Guide
Getting Started


Running the Client

To run the client you need the the ConverterAppClient.jar file. This jar file contains stub classes that allow the client to communicate with the enterprise bean instance that is running in the EJB container. You created the ConverterAppClient.jar file in the section, "Deploying the J2EE Application".

UNIX:

1. In the following script, testClient.sh, change <installation-location> to the directory in which you installed the J2EE SDK.

#!/bin/sh

J2EE_HOME=<installation-location>
CPATH=$J2EE_HOME/lib/j2ee.jar:ConverterAppClient.jar:.

java  -classpath "$CPATH" ConverterClient
2. Run the testClient.sh script.

Windows:

1. In the following script, testClient.bat, change <installation-location> to the directory in which you installed the J2EE SDK.

set J2EE_HOME=<installation-location>
set CPATH=.;%J2EE_HOME%\lib\j2ee.jar;ConverterAppClient.jar

java -classpath "%CPATH%" ConverterClient
2. Run the testClient.bat script.

Solutions to Common Problems

When running the ConverterClient, you may encounter one of the following errors.

1. java.lang.ClassCastException

The program could not locate the classes in the ConverterAppClient.jar file. Make sure that this file exists. You should have specified the ConverterAppClient.jar file in the section, "Deploying the J2EE Application".
2. java.lang.NoClassDefFoundError: ConverterClient

The java launcher could not locate the ConverterClient.class. Verify that you compiled ConverterClient.java in the section, "Compiling the Client's Code".
3. java.lang.NoClassDefFoundError: javax/naming/Context

The program could not locate a class it needed in the lib/j2ee.jar file. Make sure that you correctly defined the J2EE_HOME environment variable in the testClient.sh (UNIX) or testClient.bat (Windows) script.
4. javax.naming.NameNotFoundException: Lookup of name MyConverter failed.

The J2EE server could not locate the enterprise bean whose JNDI name is MyConverter. Either you did not deploy the enterprise bean, or you specified the wrong JNDI name in the section, "Deploying the J2EE Application".
5. javax.naming.NamingException: Error accessing repository: Cannot connect to ORB at . . . .

The J2EE server is not running. See step 1 in the section, "Creating the J2EE Application".


Prev | Next

TOC | Index


Copyright © 2000 Sun Microsystems, Inc. All rights reserved.