Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Setting java.library.path in OC4J on Oracle 10g release 3

Thread Tools

Setting java.library.path in OC4J on Oracle 10g release 3
Posts: n/a
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

Thanks everyone,


Reply With Quote
Ganesh Iyer
Posts: n/a
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

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

Reply With Quote
Posts: n/a
>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!)



Reply With Quote is offline
Junior Member
Join Date: Sep 2006
Posts: 1
Were you able to get a fix to this problem. I have the same problem and my environmnet is OC4J 9.0.4 on Windows 2000
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
JMX on Oracle Application Server / Oc4J Cluster yogi Java 0 10-27-2007 02:51 PM
Sequence.nextval numeric type in Oracle 10g differs from Oracle 8i when using MS OleDb provider ASP .Net 0 04-27-2007 04:57 PM
Is Clover compatible with OC4J?How it work for WEB app deployed on OC4J. dhananjay General Computer Support 0 08-11-2006 09:51 AM
Access Oracle 10g using ASP.NET sloan ASP .Net 1 03-11-2006 06:48 AM
install_driver(Oracle) failed: Can't load 'C:/Perl/site/lib/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle: load_file:The specified procedure could not be found at C:/Perl/lib/ line 230. Feyruz Perl Misc 4 10-14-2005 06:47 PM