On 23.11.2007, at 17:17, Caldarale, Charles R wrote:

From: Kaspar Fischer [mailto:[EMAIL PROTECTED]
Subject: Sharing an object between two webapps

I guess this is related to classloaders, but do not know how
to proceed.

You are correct in that it's related to classloaders, but the specific
answer depends on the version of Tomcat you're using, which you didn't
tell us.  Look at the docs for the appopriate level:
http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html
http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html

Make sure that access to such shared data is properly synchronized, or
you'll continue to have problems.

Thanks for your reply. I am using Tomcat-5.5 and have looked at
the above page. But I don't get what I am doing wrong.

Here are some more details: My Tomcat installation looks as follows:

  tomcat
    shared
      lib             (empty)
      classes         (empty)
    webapps
      A               (in fact, it's Alfresco)
        WEB-INF
          lib         (may JARs)
    wtpwebapps
      B
        ...

The class SharedObjectHolder from my previous post lies inside the
JAR webapps/A/WEB-INF/lib/SharedObjectHolder.jar.

In order to make A's JARs available to webapp B, I've set

shared.loader=${catalina.base}/shared/classes,${catalina.base}/ shared/lib/*.jar,${catalina.base}/webapps/A/WEB-INF/lib/*.jar

in catalina.properties.

I think I've also tried to move SharedObjectHolder.jar to shared/lib
but this didn't work either -- I am going to verify this now.

Kaspar


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to