On Thu, 14 Jul 2005, Adam Perry-Pelletier wrote:

You could use a TestSuite that does the dll initialization and contains
(references to) all the TestCases, which of course no longer load the
dll.

I'm not entirely sure about the details, but I bet the JUnit documentation
can be helpful there.

-- Kenney

> I'm converting an opensource project to use maven.  The is a java COM
> wrapper.  Accordingly, it relies on underlying JNI and dlls for the native
> support.  When running its JUnit tests, I get the following error.
>
>
>
> Testcase:
> testEnv(com.moesol.bindings.platform_sdk.base_services.ProcessTest):Ca
>
> used an ERROR
>
> Native Library C:\Program Files\USMC\CJB\com_moesol_bindings.dll already
> loaded
>
> in another classloader
>
> java.lang.UnsatisfiedLinkError: Native Library C:\Program Files\CJB\com_moe
>
> sol_bindings.dll already loaded in another classloader
>
>         at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1551)
>
>         at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1482)
>
>         at java.lang.Runtime.load0(Runtime.java:737)
>
>         at java.lang.System.load(System.java:811)
>
>         at
> com.moesol.bindings.NativeLibraryLoader.load(NativeLibraryLoader.java
>
>
>
> The native library is getting loaded multiple times by the class loader.  We
> have static blocks that load the libraries for every test.  This does work
> under ant, presumably because ant fully unloads each test case after it is
> tested, thus the dlls aren't loaded more than once.
>
>
>
> Can anyone provide guidance on how to work around this.
>
>
>
> Thanks,
>
> Adam
>
>

--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to