top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

NoClassDefErrors found in Tomcat 5.5

+2 votes
175 views

In a set up, where we have Tomcat 5.5 running on Java 1.6, I have been seeing NoClassDefErrors thrown for a set of classes. I am not too sure as to why these exceptions occur? And this particular error happens at times, and when it happens, Tomcat will not respond.The packaged jar files are found in the CLASSPATH.

I am suspecting about Garbage Collection and as JVM might have unloaded some of these classes. But, I am not too very sure at the moment.

Is there anything in Tomcat's Classloading mechanism that can provide a clue?

posted Sep 29, 2013 by Amit Parthsarthi

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote
  1. Tomcat 5.5.x (what is your x?) is no longer supported
  2. Java 1.6 is no longer supported unless you have a contract
  3. CLASSPATH is almost never the place to put web dependencies

Steps to address the issue:

1. Move to the latest Tomcat 6 or Tomcat 7 (preferably 7)
2. Move to the latest JRE (1.7.0_40)
3. Remove extra stuff from your CLASSPATH
4. For your application dependencies
 a. put all classes in WEB-INF/classes
 b. put all libs in WEB-INF/lib
 c. Container-managed resources go in CATALINA_BASE/lib

Most people writing about issues with classpath are using Eclipse. Are you trying to run this from Eclipse?
If so, follow the above, and do the following:

1. Use the latest (or next to latest) J2EE version of Eclipse
2. Use either Eclipse's project structure or Maven
 a. If you're using Maven
 i. Use the latest Eclipse
 ii. I like JBoss Tools plugin as well
 iii. Maven takes care of dependencies for you
 b. If you're using the standard Eclipse environment
 i. extra libs go in WebContent/WEB-INF/lib
 ii. extra classes go in WebContent/WEB-INF/classes
 iii. Eclipse adds these to the build path for you
 iv. Eclipse places compiled sources in classes
3. Add the Tomcat server to a Servers project (follow the wizard)
answer Sep 29, 2013 by anonymous
Similar Questions
0 votes

It's a little bit frustrating to configure Tomcat 8.5.8 with log4j2.

I put the following jars in $CATALINA_HOME/lib
log4j 2 core (log4j-core-2.6.2.jar)
log4j 2 api (log4j-api-2.6.2.jar)

Delete the file $CATALINA_HOME/conf/logging.properties
Put the new log4j 2 config file (log4j2.xml) in $CATALINA_HOME/lib

No errors but the created catalina.out file is empty and the console layout doesn't change, What else to check or change?

+2 votes

I got a Problem with Tomcat deployment. I am using TC 7.0.42, OS: Win2k8r2, J 1.7.0._45.

We used to deploy unpacked webapps (dirs) on a Tomcat 5.0.26 outside the Webapps-dir. We used the manager (web-IF) to deploy these apps, giving the context name and the local directory. The tomcat ran the app from this location. It creates a .xml in it's config dir.

Now in TC7, the tomcat COPIES the APP from the given location to the default Webapps directory. But we want it to run from where it is, not a copy. One way to archieve this is to manually create a .xml file in the conf/server/localhost dir. But our deployment process needs it to be done via web interface. So, is there any possibility to configure tomcat 7 to behave like tomcat 5 when deploying local webapp directories from outside the webapps dir? I tried autoDeploy and unpackWars to false, but it didn't help. :(

0 votes

We are using Tomcat 6.x version and we need to implement the following headers in our environment.

Headers:
1) Strict-Transport-Security
2) Content-Security-Policy
3) Public-Key-Pins
4) X-Frame-Options
5) X-XSS-Protection
6) X-Content-Type-Options
7) X-Robots-Tag

When I checked the Tomcat 6 version webpage (https://tomcat.apache.org/tomcat-6.0-doc/config/filter.html), I don't see any filters that implement any these headers. Some of them are available in Tomcat 7 version webpage (https://tomcat.apache.org/tomcat-7.0-doc/config/filter.html), but we cannot upgrade to Tomcat 7.x version due to some constraints.

Can you kindly guide me how to implement these headers in Tomcat 6.x version. All your comments on this topic are welcome.

...