I'm developing a java Web Application, which uses a com4j library to connect to, and extract data from an external database. My application work seamlessly on my localhost, which runs a maven/jetty setup.
However, I need the application to be hosted on a WebLogic server, which i am not the admin of. When deploying and starting the web-app there, I get an unsatisfied link exception, as shown below.
I have been trying numerous suggested solutions to similar problems, without any luck. The errors have been changing slightly from time to time, but mostly the same. All of the suggested solutions I have found, can be boiled down to three suggestions, found on this site: https://com4j.java.net/deployment.html
It should work automatically when you package the jar: It does not. The jar is definitely in the war-file, and the dll is inside the .jar but still the same exception occurs.
Place com4j.dll in the same directory as com4j.jar: Does absolutely nothing to the error message.
Set the system property java.library.path to include the directory where com4j.dll resides: The error changed to .dll is already loaded in another ClassLoader.
i've tried one at the time, all at once, and different combinations of the above.
I do not expect a wizard to swoop down and tell me exactly what to do here, but I would love some help finding another angle of attack to this problem.
<11-06-2014 15:23:34 CEST> <Error> <Deployer> <BEA-149265>
<Failure occurred in the execution of deployment request with ID
'1402493014299' for task '158'. Error is:
'weblogic.application.ModuleException: Unable to load com4j.dll'
weblogic.application.ModuleException: Unable to load com4j.dll
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1401)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:460)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
Truncated. see log file for complete stacktrace
Caused By: java.lang.UnsatisfiedLinkError: no com4j-x86 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
at com4j.COM4J.loadNativeLibrary(COM4J.java:530)
at com4j.COM4J.<clinit>(COM4J.java:522)
Truncated. see log file for complete stacktrace
>