I explored that suggestion. The class failing to load is
org.hibernate.SessionFactory, and the class attempting to load it is
HibernateGrailsPlugin. The former class is confirmed in a jar in
WEB-INF/lib, and the latter is a .class file in WEB-INF/classes. It seems
like this should work.
The details:

org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'pluginManager' defined in ServletContext resource
[/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested
exception is
org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could
not create a new instance of class [HibernateGrailsPlugin]!
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:850)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:724)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:493)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by:
org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could
not create a new instance of class [HibernateGrailsPlugin]!
... 20 more
Caused by: java.lang.NoClassDefFoundError: org/hibernate/SessionFactory
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getDeclaredMethods(Class.java:1791)
at java.security.AccessController.doPrivileged(Native Method)
at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:33)
at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:20)
at HibernateGrailsPlugin.<init>(HibernateGrailsPlugin.groovy:43)
... 20 more
Caused by: java.lang.ClassNotFoundException: org.hibernate.SessionFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:399)
... 27 more


Tim


On Fri, Sep 11, 2009 at 4:36 AM, Mark Thomas <ma...@apache.org> wrote:

> Tim Berglund wrote:
> > I'm trying to enable the shared classloader on Tomcat 6.0.20 (Java
> 1.6.0_15
> > on Mac OSX 10.6). I've put this line in conf/catalina.properties:
> >
> shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar
> >
> > I've dumped a few dozen jars in the shared/lib directory. These are found
> > when I start Tomcat, but the jars in a deployed WAR are not found. The
> > problem manifests itself as a ClassNotFoundException on on
> > org.hibernate.SessionFactory, which is located in the web app's
> WEB-INF/lib
> > directory, and not the shared/lib directory. As a test, I added the web
> > app's lib dir to the shared loader, like this:
> >
> >
> shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar,${catalina.base}/webapps/WorkList/WEB-INF/lib/*.jar
> >
> > That's obviously bad as an actual fix, but the app loads in that
> > configuration. Any ideas? What I'd like is the shared class loader as a
> > supplement to the webapp classloader.
>
> At a guess, something in shared depends on hibernate. The shared loader
> is visible to the web app but the web app loader is not visible to shared.
>
> Mark
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

Reply via email to