Troubleshooting

   

ClassNotFoundException Was Thrown

I get a ClassNotFoundException when I try to run my JNDI application.

Be sure that you have the jndi.jar and the JAR files required by your JNDI service provider in your system classpath. If you are using a SDK version prior to 1.3, check the JNDI documentation for where these go so that they can be found.

Incompatible Java Platform Versions

I get an exception complaining about missing Java files.

Be sure you are using a version of Java higher than 1.2.2. If possible, you should download and use Java 2 SDK 1.3. You can download it from http://java.sun.com/products/jdk.

NoClassDefFoundError

I get a NoClassDefFoundError when I run my JNDI application.

This is a runtime error that happens because one or more of the necessary classes were not found in the classpath. Check to make sure that you have the jndi.jar and the JAR files required by your service provider in the system classpath.

No Initial Context

I get a NoInitialContextException when I try to run my JNDI application.

You either did not specify the java.naming.initial.context environment property or it could not be found. This property is required to create the InitialContext .

CommunicationException Was Thrown

I get a CommunicationException when I run my JNDI application.

This can happen for several reasons, but commonly it's because you specified incorrect configuration information about where the JNDI service is running. Check that the host and post that you've specified are correct.

jndi.properties Resource File Wasn't Found

My JNDI client is unable to locate the jndi.properties file.

The location of the jndi.properties file is very important because the JNDI libraries must be able to find it. Typically, as long as the file is located somewhere within the system classpath, it will be found. If that doesn't work, try the <JAVA_HOME>/lib directory. You must be careful if you have more than one copy of the jndi.properties file on your machine. The first one that JNDI finds will be used.

NameNotFoundException Was Thrown

I get a NameNotFoundException when I run my JNDI application.

Usually this happens because you specified a name in the lookup method that doesn't exist in the JNDI service or you didn't specify the name correctly as you need to. Some JNDI services force you to use java:/comp/env prefixed to the name of an enterprise when using the lookup method, while others allow you to just specify the name.



Special Edition Using Enterprise JavaBeans 2.0
Special Edition Using Enterprise JavaBeans 2.0
ISBN: 0789725673
EAN: 2147483647
Year: 2000
Pages: 223

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net