|
Home TOC Index |
|
Search
Feedback |
Common Problems and Their Solutions
Cannot Start the J2EE Server
Naming and Directory Service Port Conflict
Symptom: When you start the J2EE server with the
-verboseoption, it displays these lines:
J2EE server listen port: 1050 RuntimeException: Could not initialize server. . .Solution: Another process is using port 1050. If the J2EE server is already running, you can stop it by typing
j2ee -stop. If some other program is using the port, then you can change the default port number (1050) by editing theconfig/orb.propertiesfile of your J2EE SDK installation.For more information about default port numbers, see the Configuration Guide in the download bundle of the J2EE SDK.
Web Service Port Conflict
Symptom: When you start the J2EE server with the
-verboseoption, it displays these lines:LifecycleException: HttpConnector[8000].open: java.net.BindException: Address in use. . .Solution: Another process is using port 8000. You can change the default port number (8000) by editing the
config/web.propertiesfile of your J2EE SDK installation.Incorrect XML Parser
Symptom: When you start the J2EE server with the
-verboseoption, it displays these lines:Exception in thread "main" javax.xml.parsers.FactoryConfigurationError: org.apache.xerces.jaxp.SAXParserFactoryImpl at . . .Solution: Remove the
jre/lib/jaxp.propertiesfile from your J2SE installation.Compilation Errors
ant Cannot Locate the Build File
Symptom: When you type
ant converter, these messages appear:Buildfile: build.xml does not exist! Build failed.Solution: Before running
ant, go to thej2eetutorial/examples/srcdirectory. If you want to runantfrom your current directory, you must specify the build file on the command line. For example, on Windows you would type this command on a single line:ant -buildfile C:\j2eetutorial\examples\src\build.xml converterThe Compiler Cannot Resolve Symbols
Symptom: When you type
antconverter, the compiler reports many errors, including these:cannot resolve symbol . . . BUILD FAILED . . . Compile failed, messages should have been providedSolution: Make sure that you've set the J2EE_HOME environment variable correctly. See Checking the Environment Variables.
ant 1.4 Will Not Compile the Example after You Run the Client
Symptom: ant 1.4 displays this error:
The filename, directory name, or volume label syntax is incorrect.Solution: Use version 1.3 of
ant. The 1.4 version of theant.batscript and the scripts of the J2EE SDK all use theJAVACMDenvironment variable. The SDK'srunclient.batscript, for example, setsJAVACMDto a value that causes problems forant.bat.Deployment Errors
The Incorrect XML Parser Is in Your Classpath
Symptom: The error displayed has the following text:
. . . []java.rmi.RemoteException:Error saving/opening Deployment Error:Bad mapping of key{0} class{1}, not found: com.sum.enterprise.deployment.xml.ApplicationNodeSolution: Remove the
jaxp.jarfile from thejre/lib/extdirectory of your J2SE installation. This JAR file contains XML parsing routines that are incompatible with the J2EE server. If you do not have ajaxp.jarfile, then perhaps your classpath refers to the XML routines of a Tomcat installation. In this case, you should remove that reference from your classpath.The Remote Home Interface Was Specified as a Local Home Interface
Symptom: An error such as the following is displayed:
LocalHomeImpl must be declared abstract. It does not define javax.ejb.HomeHandle getHomeHandle() from interface javax.ejb.EJBHome.Solution: Remove the enterprise bean from the EAR file (Edit
Delete) and create a new bean with the New Enterprise Bean wizard. In the General dialog box of the wizard, select values from the Remote Home Interface and Remote Interface combo boxes.
J2EE Application Client Runtime Errors
The Client Throws a NoClassDefFoundError
Symptom: The client reports this exception:
java.lang.NoClassDefFoundError:converter.ConverterHomeSolution: This error occurs if the client cannot find the classes in the
ConverterAppClient.jarfile. Make sure that you've correctly followed the steps outlined in Running the J2EEApplication Client.
The Client Cannot Find ConverterApp.ear
Symptom: The client reports this exception:
IOException: ConverterApp.ear does not existSolution: Ensure that the
ConverterApp.earfile exists and that you've specified it with the-clientoption:runclient -client ConverterApp.ear -name ConverterClientYou created the
ConverterApp.earfile in the section, Creating the J2EEApplication. See also the section Running the J2EE
Application Client.
The Client Cannot Find the ConverterClient Component
Symptom: The client displays this line:
No application client descriptors defined for: . . .Solution: Verify that you've created the
ConverterClientcomponent and that you've specified it for the-nameoption of therunclientcommand. You created theConverterClientcomponent in the section, Packaging the J2EE Application Client.The Login Failed
Symptom: After you log in, the client displays this line:
Incorrect login and/or passwordSolution: At the login prompts, enter
guestas the user name andguest123as the password.The J2EE Application Has Not Been Deployed
Symptom: The client reports the following exception:
NameNotFoundException. Root exception is org.omg.CosNaming. . .Solution: Deploy the application. For instructions, see Deploying the J2EE
Application.
The JNDI Name Is Incorrect
Symptom: The client reports the following exception:
NameNotFoundException. Root exception is org.omg.CosNaming. . .Solution: In the JNDI Names tabbed pane of the
ConverterApp, make sure that the JNDI names for theConverterBeanand theejb/SimpleConvertermatch. Edit the appropriate JNDI Name field and then redeploy the application.Web Client Runtime Errors
The Web Context in the URL Is Incorrect
Symptom: The browser reports that the page cannot be found (HTTP 404).
Solution: Verify that the Web context (
converter) in the URL matches the one you specified in the Component General Properties dialog box (See the section Packaging the Web Client). The case (upper or lower) of the Web context is significant.The J2EE Application Has Not Been Deployed
Symptom: The browser reports that the page cannot be found (HTTP 404).
Solution: Deploy the application.
The JNDI Name Is Incorrect
Symptom: When you click Submit on the Web page, the browser reports
A Servlet Exception Has Occurred.Solution: In the JNDI Names tabbed pane of the
ConverterApp, make sure that the JNDI names for theConverterBeanand theConverterWARmatch. Edit the appropriate JNDI Name field and then redeploy the application.Detecting Problems With the Verifier Tool
The verifier tool (
verifier) can detect inconsistencies in deployment descriptors and method signatures. These inconsistencies often cause deployment or runtime errors. Fromdeploytool, you can run the GUI version ofverifierby selecting ToolsVerifier. You can also run a stand-alone GUI or command-line version of
verifier. For more information, see Appendix B.Comparing Your EAR Files with Ours
For most of the examples, the download bundle of the tutorial includes J2EE application EAR files, which are located in the
j2eetutorial/examples/earsdirectory.When All Else Fails
If none of these suggestions fixes the problem, you can uninstall the application and clean out the server's repository by running the
cleanupscript. You'll also need to shut down and restart the server:j2ee -stop cleanup j2ee -verbose
|
Home TOC Index |
|
Search
Feedback |