Re: [bdbxml] Native Library libdb_java-4.3.so already loaded in another classloader
Jim Endicott <[email protected]> Mon, 22 Aug 2005 15:21:19 +0000 (UTC)
| Newsgroups | gmane.comp.db.dbxml.general |
|---|---|
| Message-ID | <[email protected]> |
William Billingsley <whb21@...> writes:
>
>
> I have a Java webapp which is using BDBXML to log some data. If I
> reload the webapp using tomcat's manager application, I get the
> following exception as soon as any of the servlets try to open an
> XmlManager in their init() methods:
>
What you need to do is too implement ServletContextListener
and add to your web.xml
<listener>
<listener-class>com.a.foo.ApplicationLifecycleListener</listener-class>
</listener>
In this class there are methods: contextInitialized and contextDestroyed
In those methods access a singleton that has a startup method that does
something like:
myEnv = new Environment(envHome, envConf);
theMgr = new XmlManager(myEnv, new XmlManagerConfig());
and a stop method that closes the manager and anything else that is open.
The singleton is then used by all threads to get access to the manager
(it is thread safe and they tell me this is a good way to share
access to the DB).
Also make sure that db.jar and dbxml.jar are in ...tomcat/shared/lib
Jim
------------------------------------------
To remove yourself from this list, send an
email to [email protected]