Home
TOC Index |
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
andshutdown.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 callingstartup.sh
, the server messages are logged to<
JWSDP_HOME
>/logs/catalina.out
. The progress of loading Web applications can be viewed in the file<
JWSDP_HOME
>/logs/jwsdp_log.<
date
>.txt
.Compilation 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
build.properties
file match a user name and password with the role ofmanager
in thetomcat-users.xml
file. For more information on setting up this information, see Creating the Build Properties File.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 <JWSDP_HOME
>/docs/tutorial/examples/gs/
directory, or from the directory where you created the application. If you want to runAnt
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 <JWSDP_HOME
>/docs/tutorial/examples/gs/build.xml buildThe 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 providedSolution: 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 theAnt
files to build the application,<
JWSDP_HOME
>/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:<JWSDP_HOME>
/docs/tutorial/examples/gs/build.xml:82: java.net.ConnectException: Connection refusedSolution: 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 callingstartup.sh
, the server messages are logged to<
JWSDP_HOME
>/logs/catalina.out
. The progress of loading Web applications can be viewed in the file<
JWSDP_HOME
>/logs/jwsdp_log.<
date
>.txt
.Deployment Errors
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: Sometimes 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 accesslocalhost
.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: Deploy the application. For more detail, see Deploying the Application.
"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 /GSApp BUILD FAILED<JWSDP_HOME
>/docs/tutorial/examples/gs/build.xml:82: FAIL - Application already exists at path /GSAppThis 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, that would be the first step. If you have successfully deployed the application by running
ant remove
,ant build
,ant install
,ant reload
, and you're still getting the error, read on.If Tomcat is loaded, but has not yet loaded all of the existing contexts, you will also 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.
Home
TOC Index |
This tutorial contains information on the 1.0 version of the Java Web Services Developer Pack.
All of the material in The Java Web Services Tutorial is copyright-protected and may not be published in other works without express written permission from Sun Microsystems.