views:

16

answers:

1

I'm trying to deploy an application to Tomcat 7 on a Windows server. I have a local copy set up and have tested with Eclipse without any trouble, but on the production server I get IncompatibleClassChangeError messages.

This had been a problem on the local server when there were problems with the classpath, but I configured the correct classpath in the server properties inside Eclipse and everything ran fine.

I'm new to Tomcat and from what I understand it should be reading jar files from my my WEB_INFO/classes directory, but when my jars are there the app doesn't want to load at all. When I move them to the $CATALINA_HOME/lib (I realize that's not where they should go) the app loads fine but reports the IncompatibleClassChangeError.

Why aren't my jars being read from WEB-INF/classes? Is there some configuration I should look at to fix this?

+1  A: 

Webapp-specific JAR files should go in Webapp/WEB-INF/lib, not in Webapp/WEB-INF/classes. The Tomcat/lib should only be used for appserver specific libraries and optionally also JAR files which should be shared among the deployed webapplications.

There might be more into the IncompatibleClassChangeError, this can have an entirely different cause. But first try getting the JAR's in the right place. If in vain, then please update your question to include the detail message. This at least smells that you're putting JAR files of a different appserver make/version in the classpath.

BalusC
That was it. Thanks. Too much staring at a simple problem can make it so much worse.
Hibiscus
You're welcome.
BalusC