Two Services trying to load a System library in same JVM

Francisco Mourao <[email protected]> Tue, 8 Jul 2008 09:43:17 -0600
Newsgroups gmane.comp.java.sun.jini
Message-ID <LISTSERV%[email protected]>
Hi there,
I have a monitor application that launches in the same JVM two instances of
the same service each one monitoring a serial port. Namely, Monitor1 and
Monitor2 are two instances of same service MonitorService with entries
name=M1 and name=M2 respectively.

The problem is that MonitorService tries to load a system library with
System.loadLibrary(...). The first instance to be initialized loads
successfully but when the second service tries to load the library an
exception is thrown saying that the library is already loaded. 

This must be a very common problem I suppose. So I think there must be some
work around for this. Or not? 

I didn't want to launch a VM for each instance of MonitorService... i can
have up to  20 instances...

Thanx in advance

--------------------------------------------------------------------------
Getting Started:     http://www.jini.org/wiki/Category:Getting_Started
Community Web Site:  http://jini.org
jini-users Archive:  http://archives.java.sun.com/archives/jini-users.html
Unsubscribing:       email "signoff JINI-USERS"  to [email protected]