[Rxtx] Problem with "rxtx-2.0-7pre2" commapi.

Trent Jarvi tjarvi at qbang.org
Fri Dec 16 02:29:34 MST 2005


On Fri, 16 Dec 2005, Vinayak Ghate wrote:

> Hi all,
> I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am
> using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when
> I'm trying to use comm apis in my application. I'm trying to probe how many
> serial and parallel ports available on the system. But when i'm trying to
> run this application it is giving me following error.
>
> Experimental:  JNI_OnLoad called.
> Devel Library
> =========================================
> Native lib Version = RXTX-2.0-7pre2
> Java lib Version   = RXTX-2.0-7pre2
> Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive

<snip>

>
> I'm new to Java world so really can't figure out which library is missing
> when I'm trying to run this application. I have ensured that comm.jar,
> RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so
> files are in proper folders as specified in the INSTALL document.
> Can anybody help me resolve this problem and explain to me what is going
> wrong in this case?
>

Hi Vinay

Hmm.  javax.comm 3.* appears to be a horrible hack in this regard.  I'm 
just glancing at things right now, but it appears that Sun has hardcoded 
native functions into their new native library in a fairly hostile 
fashion.

java.lang.Object
   extended bycom.sun.comm.SunrayInfo

static java.lang.String 	getDTUdevRoot(java.lang.String terminalId)
           Native function to get Sun Ray DTU devroot given it's terminal 
ID
static java.lang.String 	getSessionDevRoot()
           Native function to get Sun Ray session device root.
static java.lang.String 	getSessionTerminalId()
           Native function to get Sun Ray session device root.
static boolean 	isDTUonline(java.lang.String terminalId)
           Native function to determine if a particular DTU is online
static boolean 	isSessionActive()
           Return true if running in a Sun Ray session.

Sun is further hardcoding the loading of their native library which is not 
going to work for rxtx.  Their native library is useless on Linux ARM for 
instance.  I could list dozens of corner cases this breaks.

This is a very bad hack on Sun's part and isn't acceptable for a wide 
range of rxtx users.  That native library will have to go when 
javax.comm.properties are not set to Sun or we will just have to go with 
rxtx 2.1 and stop working with Sun.

I would suggest using rxtx 2.1 and leave javax.comm alone until Sun 
resolves this poor design.

--
Trent Jarvi
tjarvi at qbang.org



More information about the Rxtx mailing list