mny
asked on
Jdbc to Informix
Im trying to get any kind of connection to a Informix
database from a java applet. Im using version 7.24.
I have set CLASSPATH to the infromix.jar file and
LD_LIBRARY_PATH to sparc directory.
And when i try to run a javaprogram to access the database
I get:
ld.so.1: /pkg/java/jdk-1.1.5/bin/sp arc/green_ threads/ja va: fatal: libifdmi.so: can't open file: errno=2 (libIfmxLibmiNatives.so)
Exception occurred during event dispatching:
java.lang.UnsatisfiedLinkE rror: no IfmxLibmiNatives in shared library path
at java.lang.Runtime.loadLibr ary(Runtim e.java)
at java.lang.System.loadLibra ry(System. java)
at
at
at informix.api.direct.Direct Credential s.connecti on(DirectC redentials .java:166)
at csql.createConnection(csql .java:96)
at ExampleApplet.actionPerfor med(Exampl eApplet.ja va:250)
at java.awt.Button.processAct ionEvent(B utton.java :254)
at java.awt.Button.processEve nt(Button. java:227)
at java.awt.Component.dispatc hEventImpl (Component .java:1764 )
at java.awt.Component.dispatc hEvent(Com ponent.jav a:1704)
at java.awt.EventDispatchThre ad.run(Eve ntDispatch Thread.jav a:63)
Can anyone help me with this problem???
/Mats
database from a java applet. Im using version 7.24.
I have set CLASSPATH to the infromix.jar file and
LD_LIBRARY_PATH to sparc directory.
And when i try to run a javaprogram to access the database
I get:
ld.so.1: /pkg/java/jdk-1.1.5/bin/sp
Exception occurred during event dispatching:
java.lang.UnsatisfiedLinkE
at java.lang.Runtime.loadLibr
at java.lang.System.loadLibra
at
at
at informix.api.direct.Direct
at csql.createConnection(csql
at ExampleApplet.actionPerfor
at java.awt.Button.processAct
at java.awt.Button.processEve
at java.awt.Component.dispatc
at java.awt.Component.dispatc
at java.awt.EventDispatchThre
Can anyone help me with this problem???
/Mats
ASKER
Edited text of question
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I shure have!
And by the way I missed out that i'm using Sun Solaris
/Mats
And by the way I missed out that i'm using Sun Solaris
/Mats
Java tries to load a dynamic library called "IfmxLibmiNatives.so". But this fails because you don't have a library path set up correctly. The library path is a list of directories that the Java runtime system searches when loading libraries. To set up this under UNIX, the command is:
% setenv LD_LIBRARY_PATH directorypath
where directorypath is the name of the directory that contains the IfmxLibmiNatives.so library.
From what you wrote, I guess that this library is missing from your "sparc" directory. If not, be sure that the environment variable is available to the virtual machine that runs the applet. I don't remember if setenv only defines the environment for the shell the command is issued in. Be carefull about that. For example, try with an AppletViewer launched from the same shell that the one you used to define LD_LIBRARY_PATH.
You should note that you are going to face another problem with applets: you can't load dynamic libraries if the applet is not signed. But that's another problem.
Tell me if your problem is solved.
% setenv LD_LIBRARY_PATH directorypath
where directorypath is the name of the directory that contains the IfmxLibmiNatives.so library.
From what you wrote, I guess that this library is missing from your "sparc" directory. If not, be sure that the environment variable is available to the virtual machine that runs the applet. I don't remember if setenv only defines the environment for the shell the command is issued in. Be carefull about that. For example, try with an AppletViewer launched from the same shell that the one you used to define LD_LIBRARY_PATH.
You should note that you are going to face another problem with applets: you can't load dynamic libraries if the applet is not signed. But that's another problem.
Tell me if your problem is solved.
ASKER
Well fontaine.
I the file IfmxLibmiNatives.so is in the sparc directory
and the sparc directory is in my LD_LIBRARY_PATH
and i set the LD_LIBRARY_PATH in the same shell as
im trying to both compile and run the applet.
So what am I missing???
/mny
I the file IfmxLibmiNatives.so is in the sparc directory
and the sparc directory is in my LD_LIBRARY_PATH
and i set the LD_LIBRARY_PATH in the same shell as
im trying to both compile and run the applet.
So what am I missing???
/mny
Did you look for the file libifdmi.so?
ASKER
Well cph im not shure what U mean.
I know where libifdmi.so is located and I have it in my path
(if that was what u meant)
/mny
I know where libifdmi.so is located and I have it in my path
(if that was what u meant)
/mny
Your installation seems OK. The problem is for sure with the LD_LIBRARY_PATH environment variable. Do you ever tried to use a dynamic library from a program on your system? Your problem is maybe not Java specific. Are you using a JIT ? If yes, turn it off. I have read that some JIT have problems with JNI.
ASKER