Download
FAQ
History
HomeHomeNext API
Search
Feedback
Divider

Common Problems and Their Solutions

Use the following guidelines for troubleshooting any problems you have creating, compiling, installing, deploying, and running the example application.

Errors Starting Tomcat

"Out of Environment Space" Error

Symptom: An "out of environment space" error when running the startup and shutdown batch files in Microsoft Windows 9X/ME-based operating systems.

Solution: In the Microsoft Windows Explorer, right-click on the startup.bat and shutdown.bat files. Select Properties, then select the Memory tab. Increase the Initial Environment field to something like 4096. Select Apply.

After you select Apply, shortcuts will be created in the directory you use to start and stop the container.

"Unable to Locate the Server localhost:8080" Error

Symptom: an "unable to locate server" error when trying to load a Web application in a browser.

Solution: Tomcat can take quite some time before fully loading, so first of all, make sure you've allowed at least 5 minutes for Tomcat to load before continuing troubleshooting. To verify that Tomcat is running, point your browser to http://localhost:8080. When the Tomcat index screen displays, you may continue. If the index screen does not load immediately, wait up to several minutes and then retry. If Tomcat still has not loaded, check the log files, as explained below, for further troubleshooting information.

When Tomcat starts up, it initializes itself and then loads all the Web applications in <JWSDP_HOME>/webapps. When you run Tomcat by calling startup.sh, the server messages are logged to <JWSDP_HOME>/logs/launcher.server.log. The progress of loading Web applications can be viewed in the file <JWSDP_HOME>/logs/jwsdp_log.<date>.txt.

Compilation Errors

Ant Cannot Locate the Build File

Symptom: When you type ant build, these messages appear:

Buildfile: build.xml does not exist!
Build failed. 

Solution: Start Ant from the <INSTALL>/jwstutorial12/examples/gs/ directory, or from the directory where you created the application. If you want to run Ant from your current directory, then you must specify the build file on the command line. For example, you would type this command on a single line:

ant -buildfile <INSTALL>/jwstutorial12/examples/gs/build.xml
build 
BUILD FAILED for Unknown Reason

Symptom: When you type ant build, the compiler returns this message:

file: <INSTALL>/jwstutorial12/examples/web/common/targets.xml:3: Directory /jwstutorial12/examples/gs/build creation was not successful for an unknown reason

Solution: Make sure that you have entered the directory into which the tutorial was installed, your user name, and your password into the <INSTALL>/examples/common/build.properties file, as discussed in Modifying the Build Properties File.

The Compiler Cannot Resolve Symbols

Symptom: When you type ant build, the compiler reports many errors, including these:

cannot resolve symbol
. . .
BUILD FAILED
. . .
Compile failed, messages should have been provided 

Solution: Make sure you are using the version of Ant that ships with this version of the Java WSDP. The best way to ensure that you are using this version is to use the full PATH to the Ant files to build the application, <JWSDP_HOME>/apache-ant/bin/ant build. Other versions may not include all of the functionality expected by the example application build files.

"Connection refused" Error

Symptom: When you type ant install at the terminal prompt, you get the following message:

<INSTALL>/jwstutorial12/examples/gs/build.xml:82: 
java.net.ConnectException: Connection refused 

Solution: Tomcat has not fully started. Wait a few minutes, and then attempt to install the application again. For more information on troubleshooting Tomcat startup, see "Unable to Locate the Server localhost:8080" Error.

When attempting to run the install task, the system appears to hang.

Symptom: When you type ant install, the system appears to hang.

Solution: The Tomcat startup script starts Tomcat in the background and then returns the user to the command line prompt immediately. Even though you are returned to the command line, the startup script may not have completely started Tomcat. If the install task does not run immediately, wait up to several minutes and then retry the install task. To verify that Tomcat is running, point your browser to http://localhost:8080. When the Tomcat index screen displays, you may continue. If the splash screen does not load immediately, wait up to several minutes and then retry. If Tomcat still has not loaded, check the log files, as explained below, for further troubleshooting information.

When Tomcat starts up, it initializes itself and then loads all the Web applications in <JWSDP_HOME>/webapps. When you run Tomcat by calling startup.sh, the server messages are logged to <JWSDP_HOME>/logs/launcher.server.log. The progress of loading Web applications can be viewed in the file <JWSDP_HOME>/logs/jwsdp_log.<date>.txt.

Deployment Errors

Server returned HTTP response code: 401 for URL

Symptom: When you type ant install, these message appear:

BUILD FAILED
/home/you/gs/build.xml:44:
java.io.IOException: Server returned HTTP response code: 401
for URL: http://localhost:8080/manager/install?path= ... 

Solution: Make sure that the user name and password in your <INSTALL>/jwstutorial12/examples/common/build.properties file match a user name and password with the role of manager in the tomcat-users.xml file. For more information on setting up this information, see Modifying the Build Properties File.

Failure to run client application

Symptom: The browser reports that the page cannot be found (HTTP 404).

Solution: The startup script starts the task in the background and then returns the user to the command line prompt immediately. Even though you are returned to the command line, the startup script may not have completely started Tomcat. If the Web Client does not run immediately, wait up to a minute and then retry to load the Web client. For more information on troubleshooting the startup of Tomcat, see "Unable to Locate the Server localhost:8080" Error.

The localhost Machine Is Not Found

Symptom: The browser reports that the page cannot be found (HTTP 404).

Solution: This may happen when you are behind a proxy and the firewall will not let you access the localhost machine. To fix this, change the proxy setting so that it does not use the proxy to access localhost.

To do this in the Netscape Navigator browser, select Edit -> Preferences -> Advanced -> Proxies and select No Proxy for: localhost. In Internet Explorer, select Tools -> Internet Options -> Connections -> LAN Settings.

The Application Has Not Been Deployed

Symptom: The browser reports that the page cannot be found (HTTP 404).

Solution: Install the application. For more detail, see Deploying the Application. If the application says that it was installed but you are still getting this message, it is likely that the build file is not copying the files to the correct location as expected by Tomcat. Check that the files are being copied to the directories as discussed in Organizing Web Applications.

"Build Failed: Application Already Exists at Path" Error

Symptom: When you enter ant install at a terminal prompt, you get this message:

[install] FAIL - Application already exists at path /gs 
BUILD FAILED 
<INSTALL>/jwstutorial12/examples/gs/build.xml:82: FAIL - 
Application already exists at path /gs 

This application has already been installed. If you've made changes to the application since it was installed, use ant reload to update the application in Tomcat.

HTTP 500: No Context Error

Symptom: Get a No Context Error when attempting to run a deployed application.

Solution: This error means that Tomcat is loaded, but it doesn't know about your application. If you have not deployed the application by running ant remove, ant build, ant install, ant reload, do so now.

Solution: If Tomcat is loading, but has not yet loaded all of the existing contexts, you will get this error. Continue to select the Reload or Refresh button on your browser until either the application loads or you get a different error message.

Solution: If the application says that it was installed but you are still getting this message, it is likely that the build file is not copying the files to the correct location as expected by Tomcat. Check that the files are being copied to the directories as discussed in Organizing Web Applications.

Divider
Download
FAQ
History
HomeHomeNext API
Search
Feedback
Divider

All of the material in The Java(TM) Web Services Tutorial is copyright-protected and may not be published in other works without express written permission from Sun Microsystems.