DZone
Java Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > Not all Tomcat 6 classloaders must be equal

Not all Tomcat 6 classloaders must be equal

Venkatt Guhesan user avatar by
Venkatt Guhesan
·
Jul. 02, 11 · Java Zone · Interview
Like (0)
Save
Tweet
5.28K Views

Join the DZone community and get the full member experience.

Join For Free

Today, while doing some Grails development I came across a peculiar issue that perplexed me and I’m documenting it for all others to benefit. (Also see my other blog from today for the issue that started this journey).

Here are my specifications:

Development Machine

  • Windows-7, 64-bit
  • java version “1.6.0_24″
    Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
    Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)
  • Grails 1.4.0.M1
  • Tomcat – apache-tomcat64-6.0.32

Local Deployment Server

  • Windows Vista, 32-bit
  • java version “1.6.0_26″
    Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
    Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)
  • Grails (does not matter since I’ll be deploying a WAR)
  • Tomcat – apache-tomcat-6.0.32 (32-bit version of Tomcat)

Since the issue we are taking about deals with Grails, let’s get into he details of how I ended up with the WAR. In Grails, I issued the following command:

grails war abcdefg.war

This creates a war file. When deployed under the 64-bit Tomcat, no issues. But when deployed under the 32-bit Tomcat. I was getting the

Jul 1, 2011 10:08:25 AM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart

(See my previous article on how I enabled debugging to get to the root cause of the issue.)

But after some debugging, what it boiled down to was a “Class Cannot Be Found” error:

Jul 1, 2011 11:29:25 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class org.codehaus.groovy.grails.web.util.Log4jConfigListener
java.lang.ClassNotFoundException: org.codehaus.groovy.grails.web.util.Log4jConfigListener

In examining the war file, the JAR file named “grails-web-1.4.0.M1.jar” under the “/WEB-INF/lib” does not contain the needed “Log4jConfigListener” class under “grails-web-1.4.0.M1.jar\org\codehaus\groovy\grails\web\util\”

But clearly this class is inside this other JAR file named “grails-plugin-logging-1.4.0.M1.jar” under “\org\codehaus\groovy\grails\web\util\”.

And this identical war file works under the 64-bit Tomcat but not under the 32-bit Tomcat.

So how did I resolve the issue? I upgraded my 32-bit box to Tomcat 7.0 and this made it work. But clearly, there is an underlying issue with the class-loader under the 32-bit Tomcat 6.0.32.

Maybe someone reading this will have the answer to this issue.

Cheers!

 

From http://mythinkpond.wordpress.com/2011/07/01/not-all-tomcat-6-classloaders-must-be-equal/

Apache Tomcat 32-bit 64-bit Grail (web browser) WAR (file format) Java (programming language) JAR (file format) Virtual Machine

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Demystify the Cybersecurity Risk Management Process
  • Data Analysis Using Google Cloud Data Studio
  • How to Integrate Zoom in React Application?
  • Modern REST API Design Principles and Rules

Comments

Java Partner Resources

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo