Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tomcat 4.1.27 and no class deff found errors?

0 views
Skip to first unread message

Scott Phelps

unread,
May 12, 2005, 5:26:23 PM5/12/05
to
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)

Wendy Smoak

unread,
May 12, 2005, 5:46:13 PM5/12/05
to
"Scott Phelps" <ro...@aol.com> wrote:
> 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.

--
Wendy Smoak


Ross Bamford

unread,
May 12, 2005, 5:56:40 PM5/12/05
to
On Thu, 2005-05-12 at 21:26 +0000, Scott Phelps wrote:
> 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

--
[Ross A. Bamford] [ross AT the.website.domain]
Roscopeco Open Tech ++ Open Source + Java + Apache + CMF
http://www.roscopec0.f9.co.uk/ + in...@the.website.domain


Scott Phelps

unread,
May 12, 2005, 6:05:33 PM5/12/05
to

"Wendy Smoak" <wsm...@gmail.com> wrote in message
news:d60irh$htp$1...@news.asu.edu...

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


Wendy Smoak

unread,
May 12, 2005, 7:17:52 PM5/12/05
to
"Scott Phelps" <ro...@aol.com> wrote:
>
> 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.

--
Wendy Smoak


0 new messages