[zeromq-dev] Two apps on the same JVM

Siam Rafiee siamraf at gmail.com
Fri May 24 18:21:01 CEST 2013

What container are you using to bring up the applications? The JVM won't
let you load the same native library from different classloaders. You'll
need to ensure the library is loaded in a parent classloader, available to
both application classloaders. For example, in Tomcat you would achieve
this by placing the jzmq jar in 'tomcat/lib' and the native libraries in

You might find it easier to swap out JZMQ for JeroMQ (
https://github.com/zeromq/jeromq), which is a pure Java implementation with
no need for native libraries.


On 24 May 2013 12:51, Erwin Karbasi <erwin at optinity.com> wrote:

> Hello Guys,
> Following our use cases:
> 1. We have two applications that packaged the SO file (C lib files) and
> JZMQ.jar as part of the applications jar.
> We have tried to deploy these apps on the same JVM and encountered
> following error:
> java.lang.UnsatisfiedLinkError: jzmq (Not found in java.library.path)
> 2. We have also tried to set the lib files in the LD_LIBERARY_PATH
> (instead of above approach of packaging the lib as part of the application
> jar) and use separate Context object per application on the same JVM but we
> came across following error:
> java.lang.UnsatisfiedLinkError: jzmq (Library is already loaded in another
> ClassLoader)
>                 at
> java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1053)
>                 at
> java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:1017)
>                 at java.lang.System.loadLibrary(System.java:474)
>                 at org.zeromq.ZMQ.<clinit>(ZMQ.java:36)
> Your insight regarding above two issues would highly appreciated.
> Thanks,
> Erwin Karbasi
>  AT&T, Senior Software Architect
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130524/36d22d5f/attachment.htm>

More information about the zeromq-dev mailing list