You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Michael Ludwig <mi...@gmx.de> on 2009/02/02 02:51:34 UTC

Re: UnsatisfiedLinkError in Windows Service (tomcat6w/5w.exe)

Caldarale, Charles R schrieb am 29.01.2009 um 22:45:40 (-0600):
> > From: Michael Ludwig [mailto:milu71@gmx.de]
> > Subject: Re: UnsatisfiedLinkError in Windows Service (tomcat6w/5w.exe)
> >
> > -Djava.library.path=C:\Server;C:\src\BerkeleyDbXml\dbxml-2.4.1
> > 6\bin\debug;...
> 
> Is *src* really the right place to find the DLLs?

Hi Charles. Yes, it is. I created C:\src to put source code there.
I compiled that souce code, and the DLLs go to the bin\debug
subdirectory.

> I realize it's long, but can you post the full string?

Trying to reproduce this error, I noticed to my surprise that it
wouldn't occur.

It turns out that the error only occurs for some of the DLLs.

  libdb_java46d.dll         # can be in java.library.path or PATH
  libdbxml_java24d.dll      # ditto

  libdb46d.dll              # must reside in a PATH directory
  libdbxml24d.dll           # ditto

  xerces-c_2_8D.dll         # ditto
  xqilla21d.dll             # ditto

The Java bridge DLLs (or whatever they're called) can be moved to a
directory only contained in java.library.path, but not in PATH. The
other libraries must be in a PATH directory in order to be loaded.

> > So I guess there is something wrong with Tomcat here.

So I now guess I was wrong here, and of course you were right. Sorry for
blaming Tomcat. The problem seems to be with how the libdb(xml)_java
libraries load other libraries. So this is probably related to BDB and
the Windows API, or the build - but not to Tomcat.

> I can't see how, unless there's something really odd going on with the
> classloader hierarchy.  Can you post the full stack trace of the
> UnsatisfiedLinkError?  I wonder if there's a custom classloader that's
> getting in the way, since I don't have any problems with Tomcat's set
> of classloaders accessing native libraries specified by the
> java.library.path setting.

Here's a stack trace, in case you still think it is relevant. The error
message mentions the *_java library, but I think this is only because
that library has a dependency on the libdb46, and that one isn't found,
which the error message does not reveal.

Michael Ludwig

22.01.2009 23:14:12 org.apache.catalina.core.StandardContext listenerStart
SCHWERWIEGEND: Exception sending context initialized event to listener instance of class milu.dbxml.DbXmlInitExit
java.lang.UnsatisfiedLinkError: no libdb_java46 in java.library.path
  at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1709)
  at java.lang.Runtime.loadLibrary0(Runtime.java:823)
  at java.lang.System.loadLibrary(System.java:1030)
  at com.sleepycat.db.internal.db_javaJNI.<clinit>(db_javaJNI.java:38)
  at com.sleepycat.db.internal.DbEnv.<init>(DbEnv.java:264)
  at com.sleepycat.db.EnvironmentConfig.createEnvironment(EnvironmentConfig.java:1023)
  at com.sleepycat.db.EnvironmentConfig.openEnvironment(EnvironmentConfig.java:976)
  at com.sleepycat.db.Environment.<init>(Environment.java:29)
  at milu.dbxml.DbXmlInitExit.contextInitialized(DbXmlInitExit.java:34)
  at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
  at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
  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:525)
  at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)
  at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889)
  at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
  at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
  at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
  at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
  at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
  at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
  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:578)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
  at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: UnsatisfiedLinkError in Windows Service (tomcat6w/5w.exe)

Posted by Michael Ludwig <mi...@gmx.de>.
Martin Gainty schrieb am 02.02.2009 um 17:45:42 (-0500):
> 
> i downloaded libxml  and dont see any Visual Studio project files
> (assuming they are *.ds?) ..although I see makefiles in \win32 folder

That's a misunderstanding - I was talking about Berkeley DB XML, which
is an XML extension to the Berkeley Database.

> can you provide the link where you acquired the source?

Here's the product homepage with a download link:

Oracle Berkeley DB XML
http://www.oracle.com/database/berkeley-db/xml/index.html

Michael Ludwig

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: UnsatisfiedLinkError in Windows Service (tomcat6w/5w.exe)

Posted by Martin Gainty <mg...@hotmail.com>.
i downloaded libxml  and dont see any Visual Studio project files (assuming they are *.ds?) ..although I see makefiles in \win32 folder
can you provide the link where you acquired the source?

thanks/
Martin 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. 




> Date: Mon, 2 Feb 2009 23:35:26 +0100
> From: milu71@gmx.de
> To: users@tomcat.apache.org
> Subject: Re: UnsatisfiedLinkError in Windows Service (tomcat6w/5w.exe)
> 
> Martin Gainty schrieb am 01.02.2009 um 22:42:59 (-0500):
> > 
> > saw this in the 2.2.69 readme.txt did you use cscript to config the
> > environment?
> 
> Version 2.2.69 of what? Anyway, Berkeley DB XML on Windows is built
> using a Visual Studio project file.
> 
> >   cscript configure.js help
> 
> No such thing in the source tree.
> 
> Michael Ludwig
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

_________________________________________________________________
Windows Live™: E-mail. Chat. Share. Get more ways to connect. 
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t2_allup_explore_012009

Re: UnsatisfiedLinkError in Windows Service (tomcat6w/5w.exe)

Posted by Michael Ludwig <mi...@gmx.de>.
Martin Gainty schrieb am 01.02.2009 um 22:42:59 (-0500):
> 
> saw this in the 2.2.69 readme.txt did you use cscript to config the
> environment?

Version 2.2.69 of what? Anyway, Berkeley DB XML on Windows is built
using a Visual Studio project file.

>   cscript configure.js help

No such thing in the source tree.

Michael Ludwig

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: UnsatisfiedLinkError in Windows Service (tomcat6w/5w.exe)

Posted by Martin Gainty <mg...@hotmail.com>.
saw this in the 2.2.69 readme.txt did you use cscript to config the environment?

1.2 Configuring The Source
--------------------------

The configuration script accepts numerous options. Some of these
affect features which will be available in the compiled software,
others affect the way the software is built and installed. To see a
full list of options supported by the configuration script, run

  cscript configure.js help

?
Martin 

______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. 




> Date: Mon, 2 Feb 2009 02:51:34 +0100
> From: milu71@gmx.de
> To: users@tomcat.apache.org
> Subject: Re: UnsatisfiedLinkError in Windows Service (tomcat6w/5w.exe)
> 
> Caldarale, Charles R schrieb am 29.01.2009 um 22:45:40 (-0600):
> > > From: Michael Ludwig [mailto:milu71@gmx.de]
> > > Subject: Re: UnsatisfiedLinkError in Windows Service (tomcat6w/5w.exe)
> > >
> > > -Djava.library.path=C:\Server;C:\src\BerkeleyDbXml\dbxml-2.4.1
> > > 6\bin\debug;...
> > 
> > Is *src* really the right place to find the DLLs?
> 
> Hi Charles. Yes, it is. I created C:\src to put source code there.
> I compiled that souce code, and the DLLs go to the bin\debug
> subdirectory.
> 
> > I realize it's long, but can you post the full string?
> 
> Trying to reproduce this error, I noticed to my surprise that it
> wouldn't occur.
> 
> It turns out that the error only occurs for some of the DLLs.
> 
>   libdb_java46d.dll         # can be in java.library.path or PATH
>   libdbxml_java24d.dll      # ditto
> 
>   libdb46d.dll              # must reside in a PATH directory
>   libdbxml24d.dll           # ditto
> 
>   xerces-c_2_8D.dll         # ditto
>   xqilla21d.dll             # ditto
> 
> The Java bridge DLLs (or whatever they're called) can be moved to a
> directory only contained in java.library.path, but not in PATH. The
> other libraries must be in a PATH directory in order to be loaded.
> 
> > > So I guess there is something wrong with Tomcat here.
> 
> So I now guess I was wrong here, and of course you were right. Sorry for
> blaming Tomcat. The problem seems to be with how the libdb(xml)_java
> libraries load other libraries. So this is probably related to BDB and
> the Windows API, or the build - but not to Tomcat.
> 
> > I can't see how, unless there's something really odd going on with the
> > classloader hierarchy.  Can you post the full stack trace of the
> > UnsatisfiedLinkError?  I wonder if there's a custom classloader that's
> > getting in the way, since I don't have any problems with Tomcat's set
> > of classloaders accessing native libraries specified by the
> > java.library.path setting.
> 
> Here's a stack trace, in case you still think it is relevant. The error
> message mentions the *_java library, but I think this is only because
> that library has a dependency on the libdb46, and that one isn't found,
> which the error message does not reveal.
> 
> Michael Ludwig
> 
> 22.01.2009 23:14:12 org.apache.catalina.core.StandardContext listenerStart
> SCHWERWIEGEND: Exception sending context initialized event to listener instance of class milu.dbxml.DbXmlInitExit
> java.lang.UnsatisfiedLinkError: no libdb_java46 in java.library.path
>   at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1709)
>   at java.lang.Runtime.loadLibrary0(Runtime.java:823)
>   at java.lang.System.loadLibrary(System.java:1030)
>   at com.sleepycat.db.internal.db_javaJNI.<clinit>(db_javaJNI.java:38)
>   at com.sleepycat.db.internal.DbEnv.<init>(DbEnv.java:264)
>   at com.sleepycat.db.EnvironmentConfig.createEnvironment(EnvironmentConfig.java:1023)
>   at com.sleepycat.db.EnvironmentConfig.openEnvironment(EnvironmentConfig.java:976)
>   at com.sleepycat.db.Environment.<init>(Environment.java:29)
>   at milu.dbxml.DbXmlInitExit.contextInitialized(DbXmlInitExit.java:34)
>   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
>   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
>   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:525)
>   at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)
>   at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889)
>   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
>   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
>   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
>   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
>   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
>   at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
>   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:578)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>   at java.lang.reflect.Method.invoke(Method.java:597)
>   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
>   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

_________________________________________________________________
Windows Live™ Hotmail®…more than just e-mail. 
http://windowslive.com/howitworks?ocid=TXT_TAGLM_WL_t2_hm_justgotbetter_howitworks_012009

Re: UnsatisfiedLinkError in Windows Service (tomcat6w/5w.exe)

Posted by Michael Ludwig <mi...@gmx.de>.
Caldarale, Charles R schrieb am 01.02.2009 um 22:38:57 (-0600):
> > From: Michael Ludwig [mailto:milu71@gmx.de]
> > Subject: Re: UnsatisfiedLinkError in Windows Service (tomcat6w/5w.exe)
> >
> > The Java bridge DLLs (or whatever they're called) can be moved to a
> > directory only contained in java.library.path, but not in PATH. The
> > other libraries must be in a PATH directory in order to be loaded.
> 
> If I'm interpreting your posting correctly, it looks like you have
> discovered that the other DLLs are not being loaded by the JVM, but
> rather indirectly, due to references from the ones the JVM loads.

Sort of. I knew before that the Java bridge libraries would load the
other ones, but I didn't know it would matter. I thought that under the
hood, java.library.path would be equivalent to setting PATH, so I didn't
understand that one would fail where the other wouldn't.

> If you really wanted to keep them all under java.library.path, you
> could write some initialization code for your webapp that does
> loadLibrary() calls on the previously indirectly loaded ones;

I see, System.loadLibrary(). Never used that before.

> but it's probably simpler just to keep them visible in PATH.

I think so, too. Thanks for your help and advice in dealing with this.

Michael Ludwig

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: UnsatisfiedLinkError in Windows Service (tomcat6w/5w.exe)

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Michael Ludwig [mailto:milu71@gmx.de]
> Subject: Re: UnsatisfiedLinkError in Windows Service (tomcat6w/5w.exe)
>
> The Java bridge DLLs (or whatever they're called) can be moved to a
> directory only contained in java.library.path, but not in PATH. The
> other libraries must be in a PATH directory in order to be loaded.

If I'm interpreting your posting correctly, it looks like you have discovered that the other DLLs are not being loaded by the JVM, but rather indirectly, due to references from the ones the JVM loads.  If you really wanted to keep them all under java.library.path, you could write some initialization code for your webapp that does loadLibrary() calls on the previously indirectly loaded ones; but it's probably simpler just to keep them visible in PATH.

But I suspect you have already figured that out...

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org