Java EE Common mistakes (put here for future reference)
Source: Internet
Author: User
j2ee| Error
common problems and their solutions
cannot start the Java EE server
Naming directory Service port conflict
Symptom: 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 server ...
Workaround: The other program uses 1050 ports. 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 use the-verbose option to start the Java EE Service, the following information is displayed:
Lifecycleexception:httpconnector[8000].open:
java.net.BindException:Address in 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.
XML parsing of
errors
Symptom: When you start the Java service using the-verbose option, the following information is displayed:
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.
compilation Error
Ant could not find the construction file
Symptom: When you enter Ant Converter, the following message appears:
Buildfile:build.xml does not exist!
build failed.
workaround: 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
compiler cannot parse symbol
Symptom: When you enter Ant Converter, the compiler reports a number of errors, including the following:
cannot resolve symbol
. . .
Build FAILED
. . .
Compile failed, messages should have been provided,
Workaround: Make sure you have properly configured the J2EE_HOME environment variable. For more information, see Checking environment variables.
After you run the client, Ant 1.4 cannot compile the example
symptom: 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 Error
XML parsing error in your classpath
Symptom: 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 designated as a local home interface
Symptom: Display the following error:
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.
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.
Client cannot find Converterapp.ear
Symptom: Client reports the following exceptions:
IOException:ConverterApp.ear does not exist
Workaround: Carefully check the existence of the Converterapp.ear file and specify the-client option for it:
For more information about creating converterapp.ear files, see Creating a Java EE application and running the Java EE application client.
client Cannot find 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 is specified in the runclient command. For more information on setting up the Converterclient component, see Packaging the Java application client.
Login Failed
symptom: After logging in, display the following message:
incorrect login and/or password
Solution: Enter guest name at login prompt, password input guest123.
Java application is not deployed
Symptom: Client reports the following exceptions:
Namenotfoundexception. Root exception is org.omg.CosNaming ...
Solution: Deploy the application, for more information, see Deploying the Java EE application.
Jndi naming Error
Symptom: Client reports the following exceptions:
namenotfoundexception. Root exception is org.omg.CosNaming ...
workaround: In the Jndi naming panel marked Converterapp, check that the Converterbean Jndi name matches the Ejb/simpleconverter. Re-specify the correct Jndi naming and redeploy the application.
Web Client Run error
The URL environment for the
Web is incorrect
Symptom: Browser report page not found (HTTP 404).
Workaround: Check to see if 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 application is 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.
Errors found by the
verification tool
The
checksum tool (verifier) discovers inconsistencies between deployment descriptions and 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.
to compare your ear file with ours
for the most part of this example, the downloaded file contains the 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:
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