[sip-comm-dev] sipcommunicator osgi (osgi java.lang.UnsatisfiedLinkError: already loaded in another classloader)


#1

I found I want to add my new bundle that call another mylib.jar
in mylib.jar It has call javax.media.protocol.DataSource(jmf.jar) as same as
in bundle-media of sipcommunicator

when mylib.jar run to the line that call javax.media.protocol.DataSource it
found this error:

09:56:10.734 SEVERE: util.UtilActivator.uncaughtException().81 An uncaught
exception occurred in thread=Thread[Thread-37,6,main] and message was:
loader constraint violation: loader (instance of
sun/misc/Launcher$AppClassLoader) previously initiated loading for a
different type with name "javax/media/protocol/DataSource"
java.lang.LinkageError: loader constraint violation: loader (instance of
sun/misc/Launcher$AppClassLoader) previously initiated loading for a
different type with name "javax/media/protocol/DataSource"

after that I think mylib.jar maybe call jmf.jar in different place of
sipcommunicator
so I added the export package to the media.manifest.mf of bundle-media like
this:

Export-Package: net.java.sip.communicator.service.media,
net.java.sip.communicator.service.media.event,
net.java.sip.communicator.impl.media,
net.java.sip.communicator.impl.media.device,
javax.media,
javax.media.protocol,
javax.media.format,
com.sun.media.util,
javax.sdp

then I run Sipcommunicator program and found so many error
of UnsatisfiedLinkError from bundle-media of sipcommunicator such as:

java.lang.UnsatisfiedLinkError: JMFSecurityManager:
java.lang.UnsatisfiedLinkError: Native Library E:\UCC\SipCommunicator with
IDL(JAR)\trunk\lib\native\windows\jmdaudc.dll already loaded in another
classloader
10:34:02.187 SEVERE: impl.media.MediaControl.createDataSource().605 Could
not create data source for dsound://
javax.media.NoDataSourceException: Error instantiating class:
com.sun.media.protocol.dsound.DataSource : java.lang.UnsatisfiedLinkError:
JMFSecurityManager: java.lang.UnsatisfiedLinkError: Native Library
E:\UCC\SipCommunicator with IDL(JAR)\trunk\lib\native\windows\jmdaudc.dll
already loaded in another classloader
        at javax.media.Manager.createDataSource(Manager.java:1017)

java.lang.UnsatisfiedLinkError: Native Library E:\UCC\SipCommunicator with
IDL(JAR)\trunk\lib\native\windows\civil.dll already loaded in another
classloader

I don't know what the main problem or how to manage the library to work
properly
thank you,
kai