• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Rob Spoor
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:

conflicting jar files and .dll

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm having a problem running two j2ee applications on Websphere 5.1.2 application server. Both of the applications use the Coroutine4java.jar and the corojdk.dll. The problem is that which ever one loads second gets these errors :

Either

Caused by: java.lang.UnsatisfiedLinkError: Native Library C:\WINDOWS\system32\corojdk11.dll already loaded in another classloader
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2111)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:2025)
at java.lang.Runtime.loadLibrary0(Runtime.java:824)
at java.lang.System.loadLibrary(System.java:908)
at com.neva.Coroutine.<clinit>(Coroutine.java:213)
at com.neva.COMClassObject.CoInitialize(COMClassObject.java:153)
at com.xyenterprise.PCMUtils.PCMAPIMgr.<init>(PCMAPIMgr.java:129)

Or this :

[9/8/06 17:27:31:054 EDT] 18962a5f DispatchActio E org.apache.struts.actions.DispatchAction TRAS0014I: The following exception was logged java.lang.reflect.InvocationTargetException

java.lang.NoClassDefFoundError: com/neva/Coroutine
at com.neva.COMClassObject.CoInitialize(COMClassObject.java:153)
at com.xyenterprise.PCMUtils.PCMAPIMgr.<init>(PCMAPIMgr.java:129)


Which ever application loads first runs fine. There seems to be some kind of conflict in how the class loaded is using the dll file and or the jar file.

I have the jars all defined in a shared library and the .dll file is located in the Windows\system32 directory.

Does anybody have a suggestion on how to fix this?

Thanks
Chris
 
author and cow tipper
Posts: 5006
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't you love classloader errors?

Are you using the vanilla WebSphere Application Server, or is it running WebSphere Portal 5.1.2 as well?

You said you've got all the jar files together? Where are they? WebSphere\lib? Packaged in an ear? In the root of the war file.

Your JAR files...does the code in there make any class back into the J2EE app? For example, a database driver doesn't make any calls back into a J2EE app, so it can go on WebSphere lib. Not so with other JARs.

The "Lets Get Loaded" link on my website discusses WebSphere 5 and WebSphere 6.1 classloaders. If you think it's a classloader issue, or you need to understand classloader issues a little bit better, this might help.

http://www.technicalfacilitation.com/get.php?link=classloading

Happy WebSphere!

-Cameron
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem here is which ever the application first starts, loads the dll file and second application sees this. The easiest fix (if possible) is to run the the two applications in different JVMs. In websphere you can do this by creating a different Application Servers though Websphere Admin Console (browser based). Each Application Server runs in a different JVM and won't cause this issue.

But if you need to run both apps in the same server you may need to investigate whether you can share a dll loaded by another class loader. Try catching the UnsatisfiedLinkError and NOT throwing it in both apps so that the second application will try to work without loading the dll. (note that UnsatisfiedLinkError is an Error not an Exception, So catch UnsatisfiedLinkError or Throwable instead of catching Exception).
 
Chris Skinner
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the quick responses. I decided to try deploying both applications in an EAR file rather than as two separate WAR files and that seems to have solved the problem.
Chris
 
Grow your own food... or this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic