Patrick,
Your email does not indicate which version of Tomcat you are using, hence I am
assuming that you are
using Tomcat 3.2.x. Now, as far as I know the issue below is a result of a "faulty"
classloader
implementation in Tomcat 3.2.x and earlier.
I've seen emails indicating that with Tomcat 3.3.x this will be resolved. You might
want to have a
look at the latest Tomcat 3.3.x (beta?) release and its documentation. Allegedly, from
Tomcat 3.3
onwards, Tomcat will ignore the (system) CLASSPATH completely, but will offer a more
sophisticated
classloader mechanism.
Hope this helps
Werner
Patrick van Kann wrote:
> First, thanks for Castor. Aside from the problem below, I would have no
> hesitation in deploying Castor for any project.
>
> Ihave written a servlet application that uses Castor 0.9.3 and have come
> across a very subtle problem that I can't resolve.
>
> The problem is that unless every single jar used in the app (including
> the castor, jdbc2 extensions, database driver) has to be on the current
> shells environment classpath (or in tomcat/lib) for the application to
> work. This in itself is a problem. Supposedly, it should be fine to
> include all the jars just in the web applications WEB-INF/lib where it
> should all be added to the classpath when you start the server. But not
> only do you need to add all the castor jars, you also need to add all
> the other classes (like the JavaBeans for the web app itself!) to the
> classpath or you get the following.
>
> org.exolab.castor.mapping.MappingException: Could not find the class
> com.fc.fortunecookie.beans.Employee
> at
>
>org.exolab.castor.mapping.loader.MappingLoader.createDescriptor(MappingLoader.java:300)
>
> at
>
>org.exolab.castor.jdo.engine.JDOMappingLoader.createDescriptor(JDOMappingLoader.java:147)
>
> at
> org.exolab.castor.mapping.loader.MappingLoader.loadMapping(MappingLoader.java:211)
>
> at
> org.exolab.castor.jdo.engine.JDOMappingLoader.loadMapping(JDOMappingLoader.java:294)
>
> at
> org.exolab.castor.mapping.Mapping.getResolver(Mapping.java:278)
> at
> org.exolab.castor.jdo.engine.DatabaseRegistry.loadDatabase(DatabaseRegistry.java:289)
>
> at org.exolab.castor.jdo.JDO.getDatabase(JDO.java:538)
> at com.fc.initialiser.Initialiser.init(Initialiser.java:88)
> at
> org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
> at org.apache.tomcat.core.Handler.init(Handler.java:215)
> at
> org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296)
> at
>
>org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(LoadOnStartupInterceptor.java:130)
>
> at
> org.apache.tomcat.core.ContextManager.initContext(ContextManager.java:491)
>
> at
> org.apache.tomcat.core.ContextManager.init(ContextManager.java:453)
> at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:195)
> at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235)
>
> This class is iin a jar in the webapps WEB-INF/lib directory (and
> therefore should be in the classpath automatically). Why can't Castor
> find it? And why does Castor only work when either explicitly added to
> the environment classpath in the shell where I am starting tomcat OR in
> the Tomcat/lib directory (which amounts to the same).
>
> Or am I a total squid?
>
> Patrick
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev