Java EE Common mistakes (put here for future reference)--excerpt from the Java tutorial

Source: Internet
Author: User
Tags command line config contains interface variables reference version port number
j2ee| Error
Common problems and their solutions

Unable to start the Java EE server

Naming directory Service port conflict symptoms: When you use the-verbose option to start the Java EE server, the following information is displayed: Java EE server listen port:1050 runtimeexception:could not initialize serve R... Workaround: The other program uses port 1050. If the Java EE service is already running, you can stop the service by typing j2ee-stop. If other programs use this port, you can change the default port (1050) by modifying the Config/orb.properties file installed by your Java EE SDK. For more information about the default port number, see the Configuration Wizard that is available when downloading the Java EE SDK.

Web Service port Conflict Symptom: When you start the Java service using the-verbose option, the following information is displayed: lifecycleexception:httpconnector[8000].open:java.net.bindexception: Address by use ... Workaround: The other program uses port 8000. You can change the default port (8000) by modifying the Config/orb.properties file installed by your Java EE SDK.

Bad XML parsing symptom: When you start the Java service with the-verbose option, the following message appears: Exception in thread "main" Javax.xml.parsers.FactoryConfigurationError: Org.apache.xerces.jaxp.SAXParserFactoryImpl at ... Workaround: Remove the Jre/lib/jaxp.properties file from your J2SE installation directory.

Compile error

Ant cannot find the construction file symptom: When you enter Ant Converter, the following message appears: Buildfile:build.xml does not exist! Build failed. Solution: Go to the J2EETUTORIAL/EXAMPLES/SRC directory before running Ant. If you want to run ant in the current directory, you must specify the construction file on the command line. For example, in a window you need to enter the following command on the same line: Ant-buildfile C:j2eetutorialexamplessrcuild.xml Converter

The compiler cannot parse symbol symptoms: When you enter Ant Converter, the compiler reports many errors, including: cannot resolve symbol ... Build FAILED ... Compile failed, messages should have been provided solution: Make sure you have configured the J2ee_home environment variables correctly. For more information, see Checking environment variables.

Ant 1.4 Cannot compile sample symptoms after you run the client: Ant 1.4 Displays the following error: The filename, directory name, or volume label syntax is incorrect. Workaround: Use Ant's version 1.3. For version 1.4, the scripts for the Ant.bat script and the Java EE SDK Use the JAVACMD environment variable. The Runclient.bat script for the SDK may set the Javacmd, which creates a ant.bat problem.

Deployment errors

Bad XML parsing symptom in your classpath: Display the following error: ... []java.rmi.remoteexception:error saving/opening

Deployment Error:bad mapping of Key{0} Class{1}, not Found:com.sum.enterprise.deployment.xml.ApplicationNode Workaround: Delete the Jaxp.jar file from the Jre/lib/ext subdirectory of your J2SE installation directory. This jar file contains XML parsers that are incompatible with the Java EE server. If you don't have a Jaxp.jar file, your classpath might refer to a Tomcat-installed XML program. In this case, you need to remove the environment from your classpath.

The remote home interface is specified as a local home interface symptom: The following error is displayed: Localhomeimpl must be declared abstract. It does not define Javax.ejb.HomeHandle Gethomehandle () from interface Javax.ejb.EJBHome. Workaround: Remove the Enterprise bean (editdelete) from the ear file and create a new bean using the new Enterprise Bean Wizard. In the wizard's Comprehensive dialog box, select the remote home interface and remote interface combo box.

Java EE application client run error

The client throws a Noclassdeffounderror symptom: The client reports the following exceptions: Java.lang.NoClassDefFoundError:converter. Converterhome Workaround: The cause of this error is that the client cannot find the class in the Converterappclient.jar file. Please check carefully to see if you are performing correctly in the deployment of the Java application client.

The client cannot find the Converterapp.ear symptom: The client reports the following exceptions: IOException:ConverterApp.ear does not exist Workaround: Carefully check that the Converterapp.ear file exists and specify the-client option for it: Runclient-client converterapp.ear-name converterclient For more information about creating converterapp.ear files, see Creating a Java EE application and running the Java EE application client.

The client cannot find the Converterclient component symptom: The client displays the following information: No application client descriptors defined for: ... Workaround: Check to see if you have established the Converterclient component and whether the-name option has been specified in the runclient command. For more information on setting up the Converterclient component, see Packaging the Java application client.

Logon failure symptom: After logging in, the following message appears: Incorrect login and/or password solution: Enter guest name at login prompt, password input guest123.

Java EE applications are not deployed symptoms: The client reports the following exceptions: Namenotfoundexception. Root exception is org.omg.CosNaming ... Workaround: Deploy the application For more information, see Deploying the Java EE application.

Jndi naming Error Symptom: Client reports the following exception: Namenotfoundexception. Root exception is org.omg.CosNaming ... Workaround: In the Jndi naming panel marked Converterapp, check that the Converterbean's Jndi name matches Ejb/simpleconverter. Re-specify the correct Jndi naming and redeploy the application.

Web Client Run Error

Incorrect URL environment for Web: Browser report page not found (HTTP 404). Workaround: Check whether the Web URL environment (converter) matches the one you specified in the Component General Properties dialog box (see Packaging Web clients). In particular attention to the case of the problem.

Java EE application not deployed symptom: Browser report page not found (HTTP 404). Workaround: Deploy the application.

Jndi naming error Symptom: When you click the Submit button on the Web page, the browser reports a Servlet Exception has occurred. Workaround: In the Jndi naming panel marked Converterapp, check the Converterbean jndi naming and Converterwar Jndi naming matches. Re-specify the correct Jndi naming and redeploy the application.

The Error proofing tool (verifier) found by the checksum tool discovers inconsistencies between the deployment description and the method features. These contradictions often lead to deployment and run-time errors. In Deploytool, you can run the GUI version of Verifier by selecting Toolsverifier. You can also run Verifier's GUI version or command-line version alone. Please refer to Appendix B for more information.

Compare your ear file with ours for the vast majority of this example, the downloaded file contains an ear file for the Java application, which is located in the J2eetutorial/examples/ears directory.

Other errors If none of the above suggestions solve the problem, you may need to reinstall the application and clear the contents of the server by running the cleanup script. Of course you also need to shut down and reboot the server: j2ee-stop cleanup j2ee-verbose


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.