Tomcat 4.1.27 and no class deff found errors?

S

Scott Phelps

Anyone know why I get even though I have commons-beanutils.jar in
C:\Tomcat\server\lib? This seems the case with lots of jars. If I move them
in one folder (common/lib) it can't find them in the other.

javax.servlet.ServletException: Error instantiating servlet class
org.apache.struts.action.ActionServlet
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:912)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:823)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3421)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3609)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:821)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579)
at
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:307)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:772)
at
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:559)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:401)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:718)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:358)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
at org.apache.catalina.core.StandardService.start(StandardService.java:497)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2190)
at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
----- Root Cause -----
java.lang.NoClassDefFoundError: org/apache/commons/digester/RuleSet
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:1610)
at java.lang.Class.getConstructor0(Class.java:1922)
at java.lang.Class.newInstance0(Class.java:278)
at java.lang.Class.newInstance(Class.java:261)
 
W

Wendy Smoak

Scott Phelps said:
Anyone know why I get even though I have commons-beanutils.jar in
C:\Tomcat\server\lib? This seems the case with lots of jars. If I move them
in one folder (common/lib) it can't find them in the other.

javax.servlet.ServletException: Error instantiating servlet class
org.apache.struts.action.ActionServlet

Are you trying to run a Struts app with the .jar files in a common location?
The Struts docs specifically warn against this. It's not a supported
configuration and it probably won't work.

You can get weird class loading problems by having multiple copies of the
same class available.

Anyway, disk space is cheap. Make life easier on yourself and give each
webapp its own set of jars, even if it means some duplication. Eventually
you'll want to have different webapps using different versions of various
libraries.
 
R

Ross Bamford

Anyone know why I get even though I have commons-beanutils.jar in
C:\Tomcat\server\lib? This seems the case with lots of jars. If I move them
in one folder (common/lib) it can't find them in the other.

javax.servlet.ServletException: Error instantiating servlet class
org.apache.struts.action.ActionServlet
at

----- Root Cause -----
java.lang.NoClassDefFoundError: org/apache/commons/digester/RuleSet
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:1610)
at java.lang.Class.getConstructor0(Class.java:1922)
at java.lang.Class.newInstance0(Class.java:278)
at java.lang.Class.newInstance(Class.java:261)

because it's needs Commons Digester, commons-digester(-X).jar (which has
a dependency on beanutils, as well as logging and collections, at least
until the most recent version I think).

Ross
 
S

Scott Phelps

Wendy Smoak said:
Are you trying to run a Struts app with the .jar files in a common
location?
The Struts docs specifically warn against this. It's not a supported
configuration and it probably won't work.

You can get weird class loading problems by having multiple copies of the
same class available.

Anyway, disk space is cheap. Make life easier on yourself and give each
webapp its own set of jars, even if it means some duplication. Eventually
you'll want to have different webapps using different versions of various
libraries.

Ah ok I think this is my main question. Doesn't this me more overhead and
more memory ussage by the servlet container? Thats what im trying to advoid.

Thanks
 
W

Wendy Smoak

Scott Phelps said:
Ah ok I think this is my main question. Doesn't this me more overhead and
more memory ussage by the servlet container? Thats what im trying to advoid.

If it's a Struts app, you don't have a choice. See the big blue box here:
http://struts.apache.org/userGuide/configuration.html#config_add

I'll leave comments about memory usage to someone who has studied the issue.
I consider a self-contained webapp to be more important than whatever amount
of memory you're going to save by sharing the .jar files, even if it would
work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top