[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tomcat-user
Subject:    Re: Sharing an object between two webapps
From:       Kaspar Fischer <fischerk () inf ! ethz ! ch>
Date:       2007-11-23 16:38:21
Message-ID: C6FA46DD-D653-4DA7-A0D2-DEF9A96FAAA5 () inf ! ethz ! ch
[Download RAW message or body]


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

>> From: Kaspar Fischer [mailto:fischerk@inf.ethz.ch]
>> 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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic