Setting java.library.path in OC4J on Oracle 10g release 3

C

cxevpu6zqx

This is a really simple question, but I'll be damned if I can figure
out how to do it in OC4j on Oracle 10g release 3.

I have an application on their J2EE application server deployed from a
WAR and it needs to use native libraries. I found out how to add JARs
to the classpath, but not how to add native libraries (or the folders
containing them) to the library path and I can't seem to find anything
in the docs and at the moment I am getting "unsatisfied link error".

Does anyone know how? Even just pointing me to the right place in the
docs would be great. Does Oracle not support the allow Java to call
native libraries or something crazy? And this is on Windows 2003
Server.

Thanks everyone,

J.
 
G

Ganesh Iyer

Did you check out the OTN forums?

I found this information in OTN...

<<<<<<<<<
There's two aspects which need to be considered:

1: the Java wrapper classes you have which call out to the native
libary.

2: the native libs themselves (which I'll call a .dll from hereon in
for simplicity).

What you would need to do is make sure the Java wrapper classes are all
available to the web application. This can be done by either packaging
them in a jar file and putting it into the web-inf/lib directory of
your web application, or leaving them in an unpackaged form and putting
it into the web-inf/classes directory.

I do vaguely remember helping someone debug a JSP tag lib issue once
before which used native code and we ran into some problems with
concurrent use of the same DLL (a Java restriction) because a DLL can
only be registered once per JVM instance and the threading model meant
it was being loaded more than once -- but it may have also had
something to do with the JSP taglib cache.

If you do get some form of Java runtime exception showing concurrent
access error for the native lib, what you can do is move the lib with
the Java wrapper classes into the global classpath (j2ee/home/applib)
meaning it's only ever loaded once..

Then what you need to do is make sure the DLL itself is accessible to
the Java process -- on Windows this is done by making sure directory
holding the DDL is set in the PATH environment variable before --
before starting OC4J. On other platforms, it can be done using the
LD_LIBRARY_PATH environment variable.

That should be all you need to do to make it work.

Hope this helps,
Thanks and regards,
Ganesh Iyer
 
C

cxevpu6zqx

Did you check out the OTN forums?
Yes. Did get any help there I'm afraid.
Then what you need to do is make sure the DLL itself is accessible to
the Java process -- on Windows this is done by making sure directory
holding the DLL is set in the PATH environment variable before --
before starting OC4J.
I have done this but as far as I can see, OC4J ignores the PATH
environment variable.

This is so frustrating. It is such a basic thing to want to do, I
can't believe Oracle have made it so hard (and failed to document it!)

Thanks!

J.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top