June 10th, 2003, 06:08 PM
tomcat 4.1.x no longer comes up
I recently ran into this problem, where my standalone tomcat version 4.1.18 will no longer come up. Up to this point, I was able to create and deploy servlet and JSPs.
Environment variables %JAVA_HOME% and %CATALINA_HOME% are set up appropriately. In catalina.bat, I removed the "start" keywords from %_EXECJAVA% so that when I do the startup.bat from a cmd window, it does not launch a separate window.
Running startup.bat with the -debug option, I see that various class files are not found as server.xml is being read.
The first class not found is org.apache.catalina.mbeans.ServerLifecycleListener. I have found that this class file is in catalina.jar and this jar file is being included with the ClassLoadingFactory.
If I comment out the lines pertaining to the Listener tags, and again run startup.bat -debug, the very next class that is encountered in server.xml is flagged as not found.
This happens on the Connector tag and the class being flagged is org.apache.coyote.tomcat4.CoyoteConnector.
And this class I found to be in tomcat-coyote.jar which is also included during the startup.
Some other things that I have done, but still get the same results:
1. downloaded a later version of tomcat, 4.1.24.
2. Did a remove program of the SDK and reinstalled it - j2sdk1.4.1_01
3. Tried adding the jar files mentioned above into the %CLASSPATH% variable.
None of these affected the outcome.
I'm at a loss as to what is wrong. Any help is greatly appreciated!
June 13th, 2003, 02:13 PM
It's been a few days since you posted this, so hopefully you've figured out the source of the problem.
FWIW, I have run various version of Tomcat 4.1 standalone on Win 2K without seeing this problem. When Tomcat doesn't start for me, it is usually because the previous JVM running Tomcat has not given up control of the port it's using. I have not seen the problem where classes were not found. It sounds like something is wrong with the classpath. I would be suspicious of CATALINA_HOME too.
Have you looked for error messages in CATALINA_HOME/logs?
June 13th, 2003, 08:28 PM
Thank you for your reply. I'm still having the problem.
I was browsing the jakarta.apache.org mail-list archives and came across a posting where someone had almost the exact same problem. He was running a slightly different version of Tomcat, but other than that the symptoms were identical.
Unfortunately, he did not receive any replies or at least I could not find any replies.
I did clear the %CATALINA_HOME% log files and then attempted to start tomcat. The process does not get far enough to generate any logs, unfortunately.
I'm running Windows XP Pro and in a cmd window I executed the netstat -a -n command to view the port activity. It doesn't appear that I have any port contention.
What I am suspecting is the I have a .jar file issue, or perhaps a class loader issue.
The problem began shortly after I tried to install J2EE. Although I am not exactly sure if this caused it. I did deinstall J2EE though and the problem remains.
I have another system that has tomcat up and working and I doing a directory by directory comparison between the tomcat and JDK environment. In the system that is not working, I found a j2ee.jar file under %JAVA_HOME%\jre\lib\ext. I moved that out and put it in a temp directory. When I attempted to start tomcat, I got a different error.
Using CATALINA_BASE: c:\tomcat-4.1.18
Using CATALINA_HOME: c:\tomcat-4.1.18
Using CATALINA_TMPDIR: c:\tomcat-4.1.18\temp
Using JAVA_HOME: c:\j2sdk1.4.1_01
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/digester/RuleSet
at java.lang.Class.getDeclaredConstructors0(Native Method)
The original error (with j2ee.jar in place) was a ClassNotFoundException, while this error is a NoClassDefFoundError.
I'll have to dig some more..
June 14th, 2003, 05:20 PM
Tomcat is back up and working!
I got my tomcat back up and working this morning!
I decided to bring over an older version of the JDK from the desktop (where tomcat works) to my laptop. The version of the JDK is 1.4.0.
After setting %JAVA_HOME% to this, I tried bringing up the 3 versions of tomcat that I have installed on the laptop.
4.0.3, 4.1.18, and 4.1.24. With the previous JDK, 1.4.1_01, none of the versions of tomcat would come up.
With JDK1.4.0, tomcat versions 4.0.3 and 4.1.24 came up fine now.
I then decided to re-remove the new JDK (1.4.1_01) using the add/remove programs utitlity under Windows and I noticed that even through the utility finished stating that the program had been removed, the directory structure for the JDK remained.
I then deleted the complete directory and reinstalled JDK1.4.1_01.
Setting %JAVA_HOME% to this now, tomcat versions 4.0.3 and 4.1.24 came up fine, but 4.1.18 still would not come up.
This is where I have the bulk of my development (well, school work).
I then downloaded the source code for tomcat 4.1.18 and walked through the code in Bootstrap.java and located the line that was causing the problem. It was looking for Catalina.class.
Comparing the jar files, I found that there was a catalina.jar file under common/lib in tomcat. I moved that out and restarted tomcat and it then came up fine. Seems to be contradictory with what I found, but removing it from tomcat cause the problem to go away.
I'm not sure where this catalina.jar file came from, although it has the same date/time stamp of 12/19/2002 2:49 as the other jar files within tomcat 4.1.18.
I can't pinpoint exactly when the problem first started occuring but it showed up after I attempted to install j2ee.
That seems to have "altered" my Tomcat and JDK.