Java Tutorial - Java Script :
Troubleshooting Your Tomcat Installation
There are only a few things that are likely to go wrong with a Tomcat installation. First, you should know that Tomcat logs error messages to the file catalina.out in the CATALINA_BASE/logs directory. This is the first place to look for clues if Tomcat does not seem to be working. The most common installation problems for Tomcat are:
· The server port is occupied.
· Tomcat is using the JRE and not the JDK.
· Directories are configured with the wrong access privileges.
· The network configuration on the machine is incorrect.
We will look at this last problem first. If you are sure Tomcat is running butTomcat does not generate a response to the localhost URL in the previous paragraph, then you can check the network by entering the following command at either a Linux or Windows command prompt: ping localhost If you get a “request timed out” response, then there is a problem with your network configuration that needs to be addressed. Further troubleshooting of this issue is beyond the scope of this book. If the server port is occupied or in use by another process, Tomcat places a message in its output log (catalina.out). Look for a message that says something like: java.net.BindException: Address already in use: JVM_Bind:8080 Often, this means that Tomcat was already started and is running as a service under Windows or Linux. You can run the Tomcat shutdown script (shutdown.bat for Windows and shutdown.sh for Linux) to end any other Tomcat instance that may be using the port. The netstat command can also be used to see if another process is listening on the port. Use the command: netstat –a on either Windows or Linux to see if another process is listening on the port in question. The final common problem is Tomcat’s using the JRE instead of the JDK. The primary symptom of this is that servlets work fine but JSPs do not. The error message in the log file will complain that the classloader cannot find com.sun.javac.Main. Jasper may even diagnose the problem and suggest that the JRE is in use instead of the JDK. The fix is to check that the JDK is actually installed (and not just the JRE) and make sure that JAVA_HOME is set correctly to use the JDK.
