From phil at webwaste.de Tue Jul 1 13:48:28 2003
From: phil at webwaste.de (Philipp Hofmann)
Date: Tue Jul 1 11:48:32 2003
Subject: [Rxtx] linux, rxtx and serial ports
Message-ID: <20030701104828.GH25468@d508a.hadiko.de>
Hi,
this ist my test program. Shouldn't it print a list of valid ports? I
am especialy interested in serial ports.
$ cat Test.java
import gnu.io.*;
import java.util.Enumeration;
public class Test {
public static void main(String[] arg) {
System.out.println("start");
Enumeration e = CommPortIdentifier.getPortIdentifiers();
while(e.hasMoreElements()) {
System.out.println(((CommPortIdentifier)e.nextElement()).getName());
}
System.out.println("stop");
}
}
I am using rxtx 1.5 from the binary package. Run as user it prints the
following error message:
$ java Test
start
0 1075106032
RXTX WARNING: This library requires the user running applications to be in
group uucp. Please consult the INSTALL documentation. More information is
avaiable under the topic 'How can I use Lock Files with rxtx?'
check_lock_status: No permission to create lock file.
please see: How can I use Lock Files with rxtx? in INSTALL
Therefore I added my user to group uucp.
$ groups
users tty uucp dialout
But that didn't seem to change anything. That's why I additionally
changed the permissions of the devices I would like it to find to 666.
$ ls -la /dev/ttyS*
crw-rw-rw- 1 root dialout 4, 64 Apr 15 2001 /dev/ttyS0
crw-rw-rw- 1 root dialout 4, 65 Apr 15 2001 /dev/ttyS1
crw-rw-rw- 1 root dialout 4, 66 Apr 15 2001 /dev/ttyS2
crw-rw-rw- 1 root dialout 4, 67 Apr 15 2001 /dev/ttyS3
But that didn't change anything, either. Anyway, run as root it
somehow worked. But unfortunately, not exactly how I expected it to:
# java Test
start
stop
So I read in INSTALL of rxtx the following:
rxtx tries to detect ports on by scanning /dev for files matching any
of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on.
Any ones that exist, are supposed to be good for the current operating
system, and that can be read and written are offered back from
CommPortIdentifier.getPortIdentifiers(), and only these can be used as
ports.
And for I also tried to set the ports to use manually like this ...
# java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyS1 Test
start
stop
I began to doubt that my serial ports a well supported by my current
configuration. The following is the result of my investigations
concerning this problem. I hope that someone might be able to read the
key point out of it.
*Standard/generic (8250/16550 and compatible UARTs) serial support* is
built into the kernel (not as a module).
$ uname -a
Linux zoe 2.4.19 #2 Tue Oct 15 00:35:25 CEST 2002 i686 unknown
$ grep -v "#" /etc/serial.conf
/dev/ttyS0 uart 16550A port 0x03f8 irq 4 baud_base 115200 spd_normal skip_test
/dev/ttyS1 uart 16550A port 0x02f8 irq 3 baud_base 115200 spd_normal skip_test
$ grep serial /proc/ioports
02f8-02ff : serial(set)
03f8-03ff : serial(set)
$ cat /proc/tty/driver/serial
serinfo:1.0 driver:5.05c revision:2001-07-08
0: uart:16550A port:3F8 irq:4 tx:0 rx:0 CTS|DSR|CD|RI
1: uart:16550A port:2F8 irq:3 tx:0 rx:0 CTS|DSR|CD|RI
$ setserial -g /dev/ttyS*
/dev/ttyS0: No such device
/dev/ttyS1: No such device
/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
$ sudo setserial -g /dev/ttyS*
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3
/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
$ statserial
statserial: can't open device `/dev/ttyS1': No such device
$ sudo statserial
statserial: TIOCMGET failed: Input/output error
It is espacialy the last command I worry about. Because i found
similar error messages running an strace on the root java process of
Test.class.
Any help greatly appreciated
Philipp Hofmann
From taj at linuxgrrls.org Tue Jul 1 13:14:13 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Tue Jul 1 12:14:15 2003
Subject: [Rxtx] linux, rxtx and serial ports
In-Reply-To: <20030701104828.GH25468@d508a.hadiko.de>
References: <20030701104828.GH25468@d508a.hadiko.de>
Message-ID:
On Tue, 1 Jul 2003, Philipp Hofmann wrote:
> Hi,
>
> this ist my test program. Shouldn't it print a list of valid ports? I
> am especialy interested in serial ports.
>
>
> $ cat Test.java
> import gnu.io.*;
> import java.util.Enumeration;
>
> public class Test {
> public static void main(String[] arg) {
> System.out.println("start");
> Enumeration e = CommPortIdentifier.getPortIdentifiers();
> while(e.hasMoreElements()) {
> System.out.println(((CommPortIdentifier)e.nextElement()).getName());
> }
> System.out.println("stop");
> }
> }
>
>
> I am using rxtx 1.5 from the binary package. Run as user it prints the
> following error message:
>
>
> $ java Test
> start
> 0 1075106032
>
>
>
> RXTX WARNING: This library requires the user running applications to be in
> group uucp. Please consult the INSTALL documentation. More information is
> avaiable under the topic 'How can I use Lock Files with rxtx?'
> check_lock_status: No permission to create lock file.
>
> please see: How can I use Lock Files with rxtx? in INSTALL
>
>
> Therefore I added my user to group uucp.
>
>
> $ groups
> users tty uucp dialout
>
>
> But that didn't seem to change anything. That's why I additionally
> changed the permissions of the devices I would like it to find to 666.
>
>
> $ ls -la /dev/ttyS*
> crw-rw-rw- 1 root dialout 4, 64 Apr 15 2001 /dev/ttyS0
> crw-rw-rw- 1 root dialout 4, 65 Apr 15 2001 /dev/ttyS1
> crw-rw-rw- 1 root dialout 4, 66 Apr 15 2001 /dev/ttyS2
> crw-rw-rw- 1 root dialout 4, 67 Apr 15 2001 /dev/ttyS3
>
>
> But that didn't change anything, either. Anyway, run as root it
> somehow worked. But unfortunately, not exactly how I expected it to:
>
> # java Test
> start
> stop
>
> So I read in INSTALL of rxtx the following:
>
>
> rxtx tries to detect ports on by scanning /dev for files matching any
> of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on.
> Any ones that exist, are supposed to be good for the current operating
> system, and that can be read and written are offered back from
> CommPortIdentifier.getPortIdentifiers(), and only these can be used as
> ports.
>
>
> And for I also tried to set the ports to use manually like this ...
>
> # java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyS1 Test
> start
> stop
>
> I began to doubt that my serial ports a well supported by my current
> configuration. The following is the result of my investigations
> concerning this problem. I hope that someone might be able to read the
> key point out of it.
>
> *Standard/generic (8250/16550 and compatible UARTs) serial support* is
> built into the kernel (not as a module).
>
>
> $ uname -a
> Linux zoe 2.4.19 #2 Tue Oct 15 00:35:25 CEST 2002 i686 unknown
>
> $ grep -v "#" /etc/serial.conf
> /dev/ttyS0 uart 16550A port 0x03f8 irq 4 baud_base 115200 spd_normal skip_test
> /dev/ttyS1 uart 16550A port 0x02f8 irq 3 baud_base 115200 spd_normal skip_test
>
> $ grep serial /proc/ioports
> 02f8-02ff : serial(set)
> 03f8-03ff : serial(set)
>
> $ cat /proc/tty/driver/serial
> serinfo:1.0 driver:5.05c revision:2001-07-08
> 0: uart:16550A port:3F8 irq:4 tx:0 rx:0 CTS|DSR|CD|RI
> 1: uart:16550A port:2F8 irq:3 tx:0 rx:0 CTS|DSR|CD|RI
>
> $ setserial -g /dev/ttyS*
> /dev/ttyS0: No such device
> /dev/ttyS1: No such device
> /dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
> /dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
>
> $ sudo setserial -g /dev/ttyS*
> /dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
> /dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3
> /dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
> /dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
>
> $ statserial
> statserial: can't open device `/dev/ttyS1': No such device
>
> $ sudo statserial
> statserial: TIOCMGET failed: Input/output error
>
>
> It is espacialy the last command I worry about. Because i found
> similar error messages running an strace on the root java process of
> Test.class.
>
Hi Philipp
The setup looks like one I'm not familiar with. Here is the Test.java
output on my machine using rxtx 2.1-7pre16 (It's like rxtx 1.5 and can be
found on rxtx.org).
java Test
start
Devel Library
=========================================
Native lib Version = RXTX-2.1-7pre16
Java lib Version = RXTX-2.1-7pre16
/dev/ttyS0
/dev/ttyS1
/dev/lp0
stop
That TIOCMGET error is disturbing. Just to help simplify... If you run
as root, the lockfiles should work. The lock files should be going into
/var/lock. Sometimes the group ownership of that directory is not uucp.
For instance, some redhats use group lock. I see you have a group dialup
in there too.
You may want to step back and see if you can get minicom/kermit/tip/
something simple for serial comm working.
Could this be user mode linux perhaps? I see the TIOCMGET became
unsupported in UML around 2.4.18
http://user-mode-linux.sourceforge.net/changelog-linux-2.4.18-15.bz2.html
I'm not sure what to think. Have you checked your BIOS and made sure
there are no IRQ conflicts? Let us know if you can open the port with any
software as mentioned.
It sounds like something is wrong underneath rxtx BIOS, IRQ, kernel.
From phil at webwaste.de Tue Jul 1 15:13:33 2003
From: phil at webwaste.de (Philipp Hofmann)
Date: Tue Jul 1 13:13:36 2003
Subject: [Rxtx] linux, rxtx and serial ports
In-Reply-To:
References: <20030701104828.GH25468@d508a.hadiko.de>
Message-ID: <20030701121333.GI25468@d508a.hadiko.de>
On Tue, Jul 01, 2003 at 12:14:13PM +0100, Trent Jarvi wrote:
>
> Hi Philipp
>
> The setup looks like one I'm not familiar with. Here is the Test.java
> output on my machine using rxtx 2.1-7pre16 (It's like rxtx 1.5 and can be
> found on rxtx.org).
>
> java Test
> start
> Devel Library
> =========================================
> Native lib Version = RXTX-2.1-7pre16
> Java lib Version = RXTX-2.1-7pre16
> /dev/ttyS0
> /dev/ttyS1
> /dev/lp0
> stop
*sigh*
> That TIOCMGET error is disturbing. Just to help simplify... If you run
> as root, the lockfiles should work. The lock files should be going into
> /var/lock. Sometimes the group ownership of that directory is not uucp.
> For instance, some redhats use group lock. I see you have a group dialup
> in there too.
No, on my machine its like this:
[phil@zoe] ~ > ls -ld /var/lock
drwxrwxrwt 4 root root 4096 Jul 1 12:35 /var/lock
For the t among the permissions means something like everybody is
allowed to create a files, this should work right?
> You may want to step back and see if you can get minicom/kermit/tip/
> something simple for serial comm working.
Yes, i tried to run minicom, but didn't succeed to change settings to
any other device then /dev/ttyS3 (even as root). I'll spend some more
time on it.
> Could this be user mode linux perhaps? I see the TIOCMGET became
> unsupported in UML around 2.4.18
>
> http://user-mode-linux.sourceforge.net/changelog-linux-2.4.18-15.bz2.html
No it's just a debian linux (woody).
> I'm not sure what to think. Have you checked your BIOS and made sure
> there are no IRQ conflicts? Let us know if you can open the port with any
> software as mentioned.
I'll do.
thanks phil
From taj at linuxgrrls.org Tue Jul 1 14:37:15 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Tue Jul 1 13:37:16 2003
Subject: [Rxtx] linux, rxtx and serial ports
In-Reply-To: <20030701121333.GI25468@d508a.hadiko.de>
References: <20030701104828.GH25468@d508a.hadiko.de>
<20030701121333.GI25468@d508a.hadiko.de>
Message-ID:
>
> [phil@zoe] ~ > ls -ld /var/lock
> drwxrwxrwt 4 root root 4096 Jul 1 12:35 /var/lock
>
> For the t among the permissions means something like everybody is
> allowed to create a files, this should work right?
>
This may cause a problem if root creates a lockfile, the program crashes
or exits abnormally, and a user tries to use the port afterwards:
STICKY DIRECTORIES
When the sticky bit is set on a directory, files in that directory may
be unlinked or renamed only by root or their owner. Without the sticky
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bit, anyone able to write to the directory can delete or rename files.
The sticky bit is commonly found on directories, such as /tmp, that are
world-writable.
Otherwise it should work properly. (t is sticky) RXTX should give a
clear message about not being able to create a lock file if that happens.
From phil at webwaste.de Sun Jul 6 17:55:49 2003
From: phil at webwaste.de (Philipp Hofmann)
Date: Sun Jul 6 15:55:58 2003
Subject: [Rxtx] first problem solved, more to go
Message-ID: <20030706145549.GN24717@d508a.hadiko.de>
hello again,
ok, on one side it's distressing, but one the other side i'm pretty
happy that it was this easy to solve this problem.
i finally checked the bios settings, and - you quessed it already -
the com ports were simply disabeld. shame on me. but thanks for the
hint.
but now that i finished writing the application i get a strange error
message after moving the whole stuff to another machine.
*snip*
java.lang.ClassCastException thrown while loading gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.UnsatisfiedLinkError: Native
Library /home/phil/java/libSerial-1.5.8.so already loaded in another
classloader
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1437)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1397)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:832)
at gnu.io.CommPortIdentifier.(CommPortIdentifier.java)
at TelefonServer.doSerialPhoneStuff(TelefonServer.java:204)
at TelefonServer.(TelefonServer.java:96)
at TelefonServer.main(TelefonServer.java:30)
*snip*
i am sure, there is no other process of this software running, for ps
looks like this (right after rebooting the machine).
*snip*
medea:/home/phil/java# ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.1 0.5 1272 72 ? S 16:02 0:06 init [2]
root 2 0.0 0.0 0 0 ? SW 16:02 0:01 [kflushd]
root 3 0.0 0.0 0 0 ? SW 16:02 0:00 [kupdate]
root 4 0.0 0.0 0 0 ? SW 16:02 0:03 [kswapd]
root 5 0.0 0.0 0 0 ? SW 16:02 0:00 [keventd]
root 163 0.0 0.6 1344 88 ? S 16:03 0:00 /sbin/syslogd
root 166 0.0 0.0 1744 0 ? SW 16:03 0:00 [klogd]
root 174 0.0 0.0 1292 0 ? SW 16:03 0:00 [inetd]
root 181 0.0 0.0 2792 0 ? SW 16:03 0:00 [sshd]
daemon 184 0.0 0.0 1388 0 ? SW 16:03 0:00 [atd]
root 187 0.0 1.1 1652 160 ? S 16:03 0:00 /usr/sbin/cron
root 190 0.0 0.0 1256 0 tty1 SW 16:03 0:00 [getty]
root 191 0.0 0.0 1256 0 tty2 SW 16:03 0:00 [getty]
root 192 0.0 0.0 1256 0 tty3 SW 16:03 0:00 [getty]
root 193 0.0 0.0 1256 0 tty4 SW 16:03 0:00 [getty]
root 194 0.0 0.0 1256 0 tty5 SW 16:03 0:00 [getty]
root 195 0.0 0.0 1256 0 tty6 SW 16:03 0:00 [getty]
root 206 0.0 0.0 5624 0 ? SW 16:06 0:00 [sshd]
phil 208 0.0 1.9 5636 264 ? D 16:06 0:02 /usr/sbin/sshd
phil 209 0.0 0.0 2220 0 pts/0 SW 16:06 0:00 [bash]
root 488 0.1 3.2 2212 448 pts/0 S 17:21 0:00 -su
root 570 37.0 9.0 3164 1240 pts/0 R 17:27 0:00 ps aux
*snip*
it has mostly the same configuration (same dist (debian woody), same
j2sdk, same rxtx version).
no clue.
grettings phil
From taj at linuxgrrls.org Sun Jul 6 17:11:48 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Sun Jul 6 16:11:49 2003
Subject: [Rxtx] first problem solved, more to go
In-Reply-To: <20030706145549.GN24717@d508a.hadiko.de>
References: <20030706145549.GN24717@d508a.hadiko.de>
Message-ID:
On Sun, 6 Jul 2003, Philipp Hofmann wrote:
> hello again,
>
> ok, on one side it's distressing, but one the other side i'm pretty
> happy that it was this easy to solve this problem.
>
> i finally checked the bios settings, and - you quessed it already -
> the com ports were simply disabeld. shame on me. but thanks for the
> hint.
>
> but now that i finished writing the application i get a strange error
> message after moving the whole stuff to another machine.
>
> *snip*
>
> java.lang.ClassCastException thrown while loading gnu.io.RXTXCommDriver
> Exception in thread "main" java.lang.UnsatisfiedLinkError: Native
> Library /home/phil/java/libSerial-1.5.8.so already loaded in another
> classloader
> at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1437)
> at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1397)
> at java.lang.Runtime.loadLibrary0(Runtime.java:788)
> at java.lang.System.loadLibrary(System.java:832)
> at gnu.io.CommPortIdentifier.(CommPortIdentifier.java)
> at TelefonServer.doSerialPhoneStuff(TelefonServer.java:204)
> at TelefonServer.(TelefonServer.java:96)
> at TelefonServer.main(TelefonServer.java:30)
>
> *snip*
>
> i am sure, there is no other process of this software running, for ps
> looks like this (right after rebooting the machine).
>
> *snip*
>
> medea:/home/phil/java# ps aux
> USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
> root 1 0.1 0.5 1272 72 ? S 16:02 0:06 init [2]
> root 2 0.0 0.0 0 0 ? SW 16:02 0:01 [kflushd]
> root 3 0.0 0.0 0 0 ? SW 16:02 0:00 [kupdate]
> root 4 0.0 0.0 0 0 ? SW 16:02 0:03 [kswapd]
> root 5 0.0 0.0 0 0 ? SW 16:02 0:00 [keventd]
> root 163 0.0 0.6 1344 88 ? S 16:03 0:00 /sbin/syslogd
> root 166 0.0 0.0 1744 0 ? SW 16:03 0:00 [klogd]
> root 174 0.0 0.0 1292 0 ? SW 16:03 0:00 [inetd]
> root 181 0.0 0.0 2792 0 ? SW 16:03 0:00 [sshd]
> daemon 184 0.0 0.0 1388 0 ? SW 16:03 0:00 [atd]
> root 187 0.0 1.1 1652 160 ? S 16:03 0:00 /usr/sbin/cron
> root 190 0.0 0.0 1256 0 tty1 SW 16:03 0:00 [getty]
> root 191 0.0 0.0 1256 0 tty2 SW 16:03 0:00 [getty]
> root 192 0.0 0.0 1256 0 tty3 SW 16:03 0:00 [getty]
> root 193 0.0 0.0 1256 0 tty4 SW 16:03 0:00 [getty]
> root 194 0.0 0.0 1256 0 tty5 SW 16:03 0:00 [getty]
> root 195 0.0 0.0 1256 0 tty6 SW 16:03 0:00 [getty]
> root 206 0.0 0.0 5624 0 ? SW 16:06 0:00 [sshd]
> phil 208 0.0 1.9 5636 264 ? D 16:06 0:02 /usr/sbin/sshd
> phil 209 0.0 0.0 2220 0 pts/0 SW 16:06 0:00 [bash]
> root 488 0.1 3.2 2212 448 pts/0 S 17:21 0:00 -su
> root 570 37.0 9.0 3164 1240 pts/0 R 17:27 0:00 ps aux
>
> *snip*
>
> it has mostly the same configuration (same dist (debian woody), same
> j2sdk, same rxtx version).
>
> no clue.
>
Hi Phil
You really want to use rxtx 2.1-7pre16 which is the functional equiv of
rxtx 1.5 with bug fixes but this bug has not shown up before. I suspect
you accidently duplicated some code. Possibly in RXTXCommDriver.java
I would look for two instances of the following in one of your java files.
System.loadLibrary( "Serial" );
That said, This bug has not shown up before so you may want to just start
with a clean tarball of rxtx and reinstall.
From phil at hadiko.de Sun Jul 6 20:21:09 2003
From: phil at hadiko.de (Philipp Hofmann)
Date: Sun Jul 6 18:26:51 2003
Subject: [Rxtx] first problem solved, more to go
In-Reply-To:
References: <20030706145549.GN24717@d508a.hadiko.de>
Message-ID: <20030706172109.GO24717@d508a.hadiko.de>
hey,
you convinced me. i got lib-rxtx-java_2.1.6-1_i386.deb and installed it.
but ...
even my previously used test-app reports the same error:
*snip*
Native Library /usr/lib/librxtxSerial-2.1-6.so already loaded in
another classloader
*snip*
after some straceing it seems to me that firstly it looks for a
libSerial.so if it doesn't find one it aborts although it loads the
librxtxSerial afterwards. and if it finds one because of a symlink i
provide it aborts because it tries to load the same lib twice.
i didn't do any changes to the rxtx-code and i'm not using
System.loadLibrary("...");
$ grep loadLib RXTXCommDriver.java
System.loadLibrary( "rxtxSerial" );
which means it should only be looking for *librxtxSerial.so*. where
does the *libSerial.so* request come from? it is defenatly not part of
my test-app. :)
so far
g phil
On Sun, Jul 06, 2003 at 04:11:48PM +0100, Trent Jarvi wrote:
> Hi Phil
>
>
> You really want to use rxtx 2.1-7pre16 which is the functional equiv of
> rxtx 1.5 with bug fixes but this bug has not shown up before. I suspect
> you accidently duplicated some code. Possibly in RXTXCommDriver.java
>
> I would look for two instances of the following in one of your java files.
>
> System.loadLibrary( "Serial" );
>
> That said, This bug has not shown up before so you may want to just start
> with a clean tarball of rxtx and reinstall.
>
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
From taj at linuxgrrls.org Sun Jul 6 19:33:06 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Sun Jul 6 18:33:08 2003
Subject: [Rxtx] first problem solved, more to go
In-Reply-To: <20030706172109.GO24717@d508a.hadiko.de>
References: <20030706145549.GN24717@d508a.hadiko.de>
<20030706172109.GO24717@d508a.hadiko.de>
Message-ID:
On Sun, 6 Jul 2003, Philipp Hofmann wrote:
> hey,
>
> you convinced me. i got lib-rxtx-java_2.1.6-1_i386.deb and installed it.
>
> but ...
>
> even my previously used test-app reports the same error:
>
> *snip*
> Native Library /usr/lib/librxtxSerial-2.1-6.so already loaded in
> another classloader
> *snip*
>
> after some straceing it seems to me that firstly it looks for a
> libSerial.so if it doesn't find one it aborts although it loads the
> librxtxSerial afterwards. and if it finds one because of a symlink i
> provide it aborts because it tries to load the same lib twice.
>
> i didn't do any changes to the rxtx-code and i'm not using
> System.loadLibrary("...");
>
> $ grep loadLib RXTXCommDriver.java
> System.loadLibrary( "rxtxSerial" );
>
> which means it should only be looking for *librxtxSerial.so*. where
> does the *libSerial.so* request come from? it is defenatly not part of
> my test-app. :)
>
> so far
>
> g phil
>
>
Hi Phil
I don't think libSerial.so should be loaded at all in rxtx 2.1. Perhaps
there is something in the Java distribution you are using?
If you have a sample to try I can try reproducing the problem. There is
something unusual in your setup or code. I looked at the .deb a couple
months ago and its not making code changes. It should be fine.
From phil at webwaste.de Sun Jul 6 20:59:19 2003
From: phil at webwaste.de (Philipp Hofmann)
Date: Sun Jul 6 18:59:24 2003
Subject: [Rxtx] first problem solved, more to go
In-Reply-To:
References: <20030706145549.GN24717@d508a.hadiko.de>
<20030706172109.GO24717@d508a.hadiko.de>
Message-ID: <20030706175919.GQ24717@d508a.hadiko.de>
you were right again.
thanks a lot. it works now.
i still had a comm.jar in ext of my jdk.
information about this project will soon be put on
http://versfabrik.de
g phil
On Sun, Jul 06, 2003 at 06:33:06PM +0100, Trent Jarvi wrote:
>
>
> On Sun, 6 Jul 2003, Philipp Hofmann wrote:
>
> > hey,
> >
> > you convinced me. i got lib-rxtx-java_2.1.6-1_i386.deb and installed it.
> >
> > but ...
> >
> > even my previously used test-app reports the same error:
> >
> > *snip*
> > Native Library /usr/lib/librxtxSerial-2.1-6.so already loaded in
> > another classloader
> > *snip*
> >
> > after some straceing it seems to me that firstly it looks for a
> > libSerial.so if it doesn't find one it aborts although it loads the
> > librxtxSerial afterwards. and if it finds one because of a symlink i
> > provide it aborts because it tries to load the same lib twice.
> >
> > i didn't do any changes to the rxtx-code and i'm not using
> > System.loadLibrary("...");
> >
> > $ grep loadLib RXTXCommDriver.java
> > System.loadLibrary( "rxtxSerial" );
> >
> > which means it should only be looking for *librxtxSerial.so*. where
> > does the *libSerial.so* request come from? it is defenatly not part of
> > my test-app. :)
> >
> > so far
> >
> > g phil
> >
> >
>
> Hi Phil
>
> I don't think libSerial.so should be loaded at all in rxtx 2.1. Perhaps
> there is something in the Java distribution you are using?
>
> If you have a sample to try I can try reproducing the problem. There is
> something unusual in your setup or code. I looked at the .deb a couple
> months ago and its not making code changes. It should be fine.
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
From ricardo.trindade at emation.pt Mon Jul 7 01:59:06 2003
From: ricardo.trindade at emation.pt (Ricardo Trindade)
Date: Mon Jul 7 01:03:57 2003
Subject: [Rxtx] loading .dll or .so from jar
Message-ID:
Hi,
Hi was wondering if you haver considered including the .dll and .so in the
jar, and loading the adequate one depending on the platform.
Is this even possible ?
It would also make life easier for rxtx begginners. The only drawback I see
is the increase in jar size, but people concerned about that could always
delete it. Also with tens of megs of JRE it's hardly a problem for any java
user...
ricardo
From taj at linuxgrrls.org Mon Jul 7 02:45:23 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Mon Jul 7 01:45:24 2003
Subject: [Rxtx] loading .dll or .so from jar
In-Reply-To:
References:
Message-ID:
On Mon, 7 Jul 2003, Ricardo Trindade wrote:
> Hi,
>
> Hi was wondering if you haver considered including the .dll and .so in the
> jar, and loading the adequate one depending on the platform.
>
> Is this even possible ?
>
> It would also make life easier for rxtx begginners. The only drawback I see
> is the increase in jar size, but people concerned about that could always
> delete it. Also with tens of megs of JRE it's hardly a problem for any java
> user...
>
Hi Ricardo
Thats a great idea.
Have you done something like this before? I can picture everything
required except for the native library paths. Thats probably doable also.
That certainly would simplify installs.
From moritz.gmelin at gmx.de Mon Jul 7 08:31:51 2003
From: moritz.gmelin at gmx.de (Moritz Gmelin)
Date: Mon Jul 7 09:18:32 2003
Subject: [Rxtx] loading .dll or .so from jar
In-Reply-To:
Message-ID: <4FE80175-B03C-11D7-8199-000393719396@gmx.de>
Hi,
you can do that for a WebStart-Application. Just put the .so (.dll)
file in a jar. I believe you have to sign it. But I'm not sure about
the signing part. The rest works great.
M.
Am Montag, 07.07.03, um 02:45 Uhr (Europe/Berlin) schrieb Trent Jarvi:
>
>
> On Mon, 7 Jul 2003, Ricardo Trindade wrote:
>
>> Hi,
>>
>> Hi was wondering if you haver considered including the .dll and .so
>> in the
>> jar, and loading the adequate one depending on the platform.
>>
>> Is this even possible ?
>>
>> It would also make life easier for rxtx begginners. The only
>> drawback I see
>> is the increase in jar size, but people concerned about that could
>> always
>> delete it. Also with tens of megs of JRE it's hardly a problem for
>> any java
>> user...
>>
>
> Hi Ricardo
>
> Thats a great idea.
>
> Have you done something like this before? I can picture everything
> required except for the native library paths. Thats probably doable
> also.
>
> That certainly would simplify installs.
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
From glenn at satlantic.com Wed Jul 9 18:17:24 2003
From: glenn at satlantic.com (Glenn Davidson)
Date: Wed Jul 9 21:12:28 2003
Subject: [Rxtx] ClassCastException using RXTX 2.1-6
Message-ID: <3F0C7854.9000003@satlantic.com>
I am using Java 1.4.1 on RedHat Linux (version 9) I currently have installed rxtx 2.1.6 and when my application runs I get the error:
"Caught java.lang.ClassCastException while loading driver
gnu.io.RXTXCommDriver"
Does any onyone recognize this problem?
--
Glenn Davidson |*| Phone: (902)492-4780
Satlantic Inc., Richmond Terminal, Pier 9 |*| Fax: (902)492-4781
3295 Barrington St., Halifax, NS, Canada |*| E-mail: glenn@satlantic.com
From taj at linuxgrrls.org Wed Jul 9 22:25:38 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Wed Jul 9 21:25:40 2003
Subject: [Rxtx] ClassCastException using RXTX 2.1-6
In-Reply-To: <3F0C7854.9000003@satlantic.com>
References: <3F0C7854.9000003@satlantic.com>
Message-ID:
This error is reported to the list now and then. I just looked through my
email and the only thing I saw was that this does happen when the native
library is unable to load. hmm. what do you have in
.../java/jre/lib/i386/
If you did an install from source, there should be
librxtxSerial-2.1-7pre16.so
librxtxSerial.so (symbolic link to the above)
Make sure you do not mix rxtx 2.1 with Sun's comm.jar and rxtx 2.0 jcl.jar
On Wed, 9 Jul 2003, Glenn Davidson wrote:
> I am using Java 1.4.1 on RedHat Linux (version 9) I currently have installed rxtx 2.1.6 and when my application runs I get the error:
>
> "Caught java.lang.ClassCastException while loading driver
> gnu.io.RXTXCommDriver"
>
> Does any onyone recognize this problem?
>
> --
> Glenn Davidson |*| Phone: (902)492-4780
> Satlantic Inc., Richmond Terminal, Pier 9 |*| Fax: (902)492-4781
> 3295 Barrington St., Halifax, NS, Canada |*| E-mail: glenn@satlantic.com
>
>
>
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
From ricardo.trindade at emation.pt Thu Jul 10 19:35:04 2003
From: ricardo.trindade at emation.pt (Ricardo Trindade)
Date: Thu Jul 10 18:39:59 2003
Subject: [Rxtx] loading .dll or .so from jar
In-Reply-To:
Message-ID:
I've looked this article up on the net, which explains the concept.
I implemented it, but found an issue regarding the native lib. I load the
library with System.load, but an exception
is thrown on you System.loadlibrary("rxtxSerial"), saying I don't have the
library on java.library.path. So I imagine that for this to be possible you
would have to handle the loading with System.load, as stated in the article,
or accept an argument to not load the library.
What do you think of this ?
Ricardo
-----Mensagem original-----
De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
nome de Trent Jarvi
Enviada: segunda-feira, 7 de Julho de 2003 1:45
Para: Java RXTX discussion
Assunto: Re: [Rxtx] loading .dll or .so from jar
On Mon, 7 Jul 2003, Ricardo Trindade wrote:
> Hi,
>
> Hi was wondering if you haver considered including the .dll and .so in
the
> jar, and loading the adequate one depending on the platform.
>
> Is this even possible ?
>
> It would also make life easier for rxtx begginners. The only drawback I
see
> is the increase in jar size, but people concerned about that could always
> delete it. Also with tens of megs of JRE it's hardly a problem for any
java
> user...
>
Hi Ricardo
Thats a great idea.
Have you done something like this before? I can picture everything
required except for the native library paths. Thats probably doable also.
That certainly would simplify installs.
_______________________________________________
Rxtx mailing list
Rxtx@linuxgrrls.org
http://hex.linuxgrrls.org/mailman/listinfo/rxtx
From ricardo.trindade at emation.pt Thu Jul 10 20:02:25 2003
From: ricardo.trindade at emation.pt (Ricardo Trindade)
Date: Thu Jul 10 19:07:51 2003
Subject: [Rxtx] loading .dll or .so from jar
In-Reply-To:
Message-ID:
I'm replying to myself to add two attachments interesting to this issue :
The .java is from the JUGS project.
-----Mensagem original-----
De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
nome de Ricardo Trindade
Enviada: quinta-feira, 10 de Julho de 2003 18:35
Para: Java RXTX discussion
Assunto: RE: [Rxtx] loading .dll or .so from jar
I've looked this article up on the net, which explains the concept.
I implemented it, but found an issue regarding the native lib. I load the
library with System.load, but an exception
is thrown on you System.loadlibrary("rxtxSerial"), saying I don't have the
library on java.library.path. So I imagine that for this to be possible you
would have to handle the loading with System.load, as stated in the article,
or accept an argument to not load the library.
What do you think of this ?
Ricardo
-----Mensagem original-----
De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
nome de Trent Jarvi
Enviada: segunda-feira, 7 de Julho de 2003 1:45
Para: Java RXTX discussion
Assunto: Re: [Rxtx] loading .dll or .so from jar
On Mon, 7 Jul 2003, Ricardo Trindade wrote:
> Hi,
>
> Hi was wondering if you haver considered including the .dll and .so in
the
> jar, and loading the adequate one depending on the platform.
>
> Is this even possible ?
>
> It would also make life easier for rxtx begginners. The only drawback I
see
> is the increase in jar size, but people concerned about that could always
> delete it. Also with tens of megs of JRE it's hardly a problem for any
java
> user...
>
Hi Ricardo
Thats a great idea.
Have you done something like this before? I can picture everything
required except for the native library paths. Thats probably doable also.
That certainly would simplify installs.
_______________________________________________
Rxtx mailing list
Rxtx@linuxgrrls.org
http://hex.linuxgrrls.org/mailman/listinfo/rxtx
_______________________________________________
Rxtx mailing list
Rxtx@linuxgrrls.org
http://hex.linuxgrrls.org/mailman/listinfo/rxtx
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nativelibs.pdf
Type: application/pdf
Size: 72425 bytes
Desc: not available
Url : http://hex.linuxgrrls.org/pipermail/rxtx/attachments/20030710/46bcf03a/nativelibs-0001.pdf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NativeLibs.java
Type: text/x-java
Size: 7537 bytes
Desc: not available
Url : http://hex.linuxgrrls.org/pipermail/rxtx/attachments/20030710/46bcf03a/NativeLibs-0001.bin
From awaisa at hotmail.com Thu Jul 10 20:25:20 2003
From: awaisa at hotmail.com (Awais Ahmed)
Date: Thu Jul 10 20:37:10 2003
Subject: [Rxtx] loading .dll or .so from jar
Message-ID:
Hello All,
I guess the first question is: if it is possible.
The answer is *NO*. I am not aware of any support
like this from Suns JVM implementation.
All JNI based shared libraries are loaded in the
following flow of functional execution.
1. Java Application somewhere requests to load a
native library. Using calls like
System.loadLibrary(""). Normally this
is done in some static initializers
2. Later, defining class loader of the class
containing loadLibrary Call invokes a one of its
JNI *native* function to load a library.
3. That particular native system library requests
JVM to load the requested library, which is then
loaded through the dynamic loader.
Now to make it happen, one will have to consider
security issues and see how to add support to
extract a native library from a jar and place it
in some location/path which could later be made
accessible to the dynamic loader to load. And this
again has an issue. Currently, I am not aware of
any scenario where a JVM creates any executible
code file anywhere in your secondary location.
Anything that is generated is mapped on memory
and is all dynamic. Introducing a system library
would be a new thing.
Note: It's it important to have a library be
loaded through some VM as then VM will be
responsible for unloading that library if it's
no more referenced.
Now I can think of folowing ways:
1. You create your own objects that makes use of
packages like java.util.jar or java.util.zip
or some other custom components and extract the
native libraries at some location and then
modify java.library.path and then let
System.loadLibrary play it trick. It is a
little ugly as one also will have to keep in
mind some files cleanup mechanism.
2. An ideal way (may not be in your control to
do it) could be:
Have the VM do it totally and issues would be:
Since dynamic loader also has a major role
in loading a library, which has to have some
physical existance accessible through some path.
And there are issues and concerns if VM will
create a new file with executible code in a
disk-space. As any runtime code should only be
laid out in memory. (Note it's not accesptable
to have VM create/introduce any new native code
based files) One option that makes it do-able
is if dynamic loader gives an interface to load
a library from memory. In this scenario VM could
extract the system library bits and map it in
some memory and let the dynamic loader accept
executible code from memory.
One can try it on some research VMs along with
some adding some support in dynamic loader.
Awais Sheikh
PS: I am not sure if this email will go through as
I am not sending it through my registered email
address.
----- Original Message -----
From: "Ricardo Trindade"
To: "Java RXTX discussion"
Sent: Thursday, July 10, 2003 10:35 AM
Subject: RE: [Rxtx] loading .dll or .so from jar
>I've looked this article up on the net, which explains the concept.
>
>I implemented it, but found an issue regarding the native lib. I load the
>library with System.load, but an exception
>is thrown on you System.loadlibrary("rxtxSerial"), saying I don't have the
>library on java.library.path. So I imagine that for this to be possible you
>would have to handle the loading with System.load, as stated in the
>article,
>or accept an argument to not load the library.
>
>What do you think of this ?
>
>Ricardo
>
>-----Mensagem original-----
>De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
>nome de Trent Jarvi
>Enviada: segunda-feira, 7 de Julho de 2003 1:45
>Para: Java RXTX discussion
>Assunto: Re: [Rxtx] loading .dll or .so from jar
>
>
>
>
>On Mon, 7 Jul 2003, Ricardo Trindade wrote:
>
> > Hi,
> >
> > Hi was wondering if you haver considered including the .dll and .so in
>the
> > jar, and loading the adequate one depending on the platform.
> >
> > Is this even possible ?
> >
> > It would also make life easier for rxtx begginners. The only drawback I
>see
> > is the increase in jar size, but people concerned about that could
>always
> > delete it. Also with tens of megs of JRE it's hardly a problem for any
>java
> > user...
> >
>
>Hi Ricardo
>
>Thats a great idea.
>
>Have you done something like this before? I can picture everything
>required except for the native library paths. Thats probably doable also.
>
>That certainly would simplify installs.
_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
From taj at linuxgrrls.org Thu Jul 10 22:39:28 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Thu Jul 10 21:39:30 2003
Subject: [Rxtx] loading .dll or .so from jar
In-Reply-To:
References:
Message-ID:
Yikes.
It may be more productive to look at an installer rather than gowing down
one of these directions.
It would not be too hard to extract the proper binary from a jar file and
place it in the correct location. Same for the comm.jar.
If we start creating directories, dumping files, looking at VM hacks, and
so forth, we will get in trouble one way or another.
On Thu, 10 Jul 2003, Awais Ahmed wrote:
> Hello All,
> I guess the first question is: if it is possible.
> The answer is *NO*. I am not aware of any support
> like this from Suns JVM implementation.
> All JNI based shared libraries are loaded in the
> following flow of functional execution.
> 1. Java Application somewhere requests to load a
> native library. Using calls like
> System.loadLibrary(""). Normally this
> is done in some static initializers
> 2. Later, defining class loader of the class
> containing loadLibrary Call invokes a one of its
> JNI *native* function to load a library.
> 3. That particular native system library requests
> JVM to load the requested library, which is then
> loaded through the dynamic loader.
>
> Now to make it happen, one will have to consider
> security issues and see how to add support to
> extract a native library from a jar and place it
> in some location/path which could later be made
> accessible to the dynamic loader to load. And this
> again has an issue. Currently, I am not aware of
> any scenario where a JVM creates any executible
> code file anywhere in your secondary location.
> Anything that is generated is mapped on memory
> and is all dynamic. Introducing a system library
> would be a new thing.
>
> Note: It's it important to have a library be
> loaded through some VM as then VM will be
> responsible for unloading that library if it's
> no more referenced.
>
> Now I can think of folowing ways:
> 1. You create your own objects that makes use of
> packages like java.util.jar or java.util.zip
> or some other custom components and extract the
> native libraries at some location and then
> modify java.library.path and then let
> System.loadLibrary play it trick. It is a
> little ugly as one also will have to keep in
> mind some files cleanup mechanism.
>
> 2. An ideal way (may not be in your control to
> do it) could be:
> Have the VM do it totally and issues would be:
> Since dynamic loader also has a major role
> in loading a library, which has to have some
> physical existance accessible through some path.
> And there are issues and concerns if VM will
> create a new file with executible code in a
> disk-space. As any runtime code should only be
> laid out in memory. (Note it's not accesptable
> to have VM create/introduce any new native code
> based files) One option that makes it do-able
> is if dynamic loader gives an interface to load
> a library from memory. In this scenario VM could
> extract the system library bits and map it in
> some memory and let the dynamic loader accept
> executible code from memory.
> One can try it on some research VMs along with
> some adding some support in dynamic loader.
>
> Awais Sheikh
>
> PS: I am not sure if this email will go through as
> I am not sending it through my registered email
> address.
>
> ----- Original Message -----
> From: "Ricardo Trindade"
> To: "Java RXTX discussion"
> Sent: Thursday, July 10, 2003 10:35 AM
> Subject: RE: [Rxtx] loading .dll or .so from jar
>
>
> >I've looked this article up on the net, which explains the concept.
> >
> >I implemented it, but found an issue regarding the native lib. I load the
> >library with System.load, but an exception
> >is thrown on you System.loadlibrary("rxtxSerial"), saying I don't have the
> >library on java.library.path. So I imagine that for this to be possible you
> >would have to handle the loading with System.load, as stated in the
> >article,
> >or accept an argument to not load the library.
> >
> >What do you think of this ?
> >
> >Ricardo
> >
> >-----Mensagem original-----
> >De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
> >nome de Trent Jarvi
> >Enviada: segunda-feira, 7 de Julho de 2003 1:45
> >Para: Java RXTX discussion
> >Assunto: Re: [Rxtx] loading .dll or .so from jar
> >
> >
> >
> >
> >On Mon, 7 Jul 2003, Ricardo Trindade wrote:
> >
> > > Hi,
> > >
> > > Hi was wondering if you haver considered including the .dll and .so in
> >the
> > > jar, and loading the adequate one depending on the platform.
> > >
> > > Is this even possible ?
> > >
> > > It would also make life easier for rxtx begginners. The only drawback I
> >see
> > > is the increase in jar size, but people concerned about that could
> >always
> > > delete it. Also with tens of megs of JRE it's hardly a problem for any
> >java
> > > user...
> > >
> >
> >Hi Ricardo
> >
> >Thats a great idea.
> >
> >Have you done something like this before? I can picture everything
> >required except for the native library paths. Thats probably doable also.
> >
> >That certainly would simplify installs.
>
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
From ricardo.trindade at emation.pt Fri Jul 11 11:46:11 2003
From: ricardo.trindade at emation.pt (Ricardo Trindade)
Date: Fri Jul 11 10:51:03 2003
Subject: [Rxtx] loading .dll or .so from jar
In-Reply-To:
Message-ID:
Hi,
Why all this complication ? It's so easy. Have you read the pdf and .java I
posted ? That's the way several projects are doing it.
1) Extract the correct .dll or .so to your current director, depending on
platform
2) Read said library with System.load( currentDir + libName );
3) done
The System.load call doesn't rely on java library path, just on absolute
filesystem location. if the library is extracted to the current directory,
no directory or path issues will appear.
If you find this inadequate to include in rxtx itself, please consider
adding a boolean flag to define wether or not RXTX will call
System.loadLibrary, so that people wanting to use the scheme above can do it
outside RXTX.
thanks
Ricardo
-----Mensagem original-----
De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
nome de Awais Ahmed
Enviada: quinta-feira, 10 de Julho de 2003 20:25
Para: rxtx@linuxgrrls.org
Cc: awaisa@hotmail.com
Assunto: Re: [Rxtx] loading .dll or .so from jar
Hello All,
I guess the first question is: if it is possible.
The answer is *NO*. I am not aware of any support
like this from Suns JVM implementation.
All JNI based shared libraries are loaded in the
following flow of functional execution.
1. Java Application somewhere requests to load a
native library. Using calls like
System.loadLibrary(""). Normally this
is done in some static initializers
2. Later, defining class loader of the class
containing loadLibrary Call invokes a one of its
JNI *native* function to load a library.
3. That particular native system library requests
JVM to load the requested library, which is then
loaded through the dynamic loader.
Now to make it happen, one will have to consider
security issues and see how to add support to
extract a native library from a jar and place it
in some location/path which could later be made
accessible to the dynamic loader to load. And this
again has an issue. Currently, I am not aware of
any scenario where a JVM creates any executible
code file anywhere in your secondary location.
Anything that is generated is mapped on memory
and is all dynamic. Introducing a system library
would be a new thing.
Note: It's it important to have a library be
loaded through some VM as then VM will be
responsible for unloading that library if it's
no more referenced.
Now I can think of folowing ways:
1. You create your own objects that makes use of
packages like java.util.jar or java.util.zip
or some other custom components and extract the
native libraries at some location and then
modify java.library.path and then let
System.loadLibrary play it trick. It is a
little ugly as one also will have to keep in
mind some files cleanup mechanism.
2. An ideal way (may not be in your control to
do it) could be:
Have the VM do it totally and issues would be:
Since dynamic loader also has a major role
in loading a library, which has to have some
physical existance accessible through some path.
And there are issues and concerns if VM will
create a new file with executible code in a
disk-space. As any runtime code should only be
laid out in memory. (Note it's not accesptable
to have VM create/introduce any new native code
based files) One option that makes it do-able
is if dynamic loader gives an interface to load
a library from memory. In this scenario VM could
extract the system library bits and map it in
some memory and let the dynamic loader accept
executible code from memory.
One can try it on some research VMs along with
some adding some support in dynamic loader.
Awais Sheikh
PS: I am not sure if this email will go through as
I am not sending it through my registered email
address.
----- Original Message -----
From: "Ricardo Trindade"
To: "Java RXTX discussion"
Sent: Thursday, July 10, 2003 10:35 AM
Subject: RE: [Rxtx] loading .dll or .so from jar
>I've looked this article up on the net, which explains the concept.
>
>I implemented it, but found an issue regarding the native lib. I load the
>library with System.load, but an exception
>is thrown on you System.loadlibrary("rxtxSerial"), saying I don't have the
>library on java.library.path. So I imagine that for this to be possible you
>would have to handle the loading with System.load, as stated in the
>article,
>or accept an argument to not load the library.
>
>What do you think of this ?
>
>Ricardo
>
>-----Mensagem original-----
>De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
>nome de Trent Jarvi
>Enviada: segunda-feira, 7 de Julho de 2003 1:45
>Para: Java RXTX discussion
>Assunto: Re: [Rxtx] loading .dll or .so from jar
>
>
>
>
>On Mon, 7 Jul 2003, Ricardo Trindade wrote:
>
> > Hi,
> >
> > Hi was wondering if you haver considered including the .dll and .so in
>the
> > jar, and loading the adequate one depending on the platform.
> >
> > Is this even possible ?
> >
> > It would also make life easier for rxtx begginners. The only drawback I
>see
> > is the increase in jar size, but people concerned about that could
>always
> > delete it. Also with tens of megs of JRE it's hardly a problem for any
>java
> > user...
> >
>
>Hi Ricardo
>
>Thats a great idea.
>
>Have you done something like this before? I can picture everything
>required except for the native library paths. Thats probably doable also.
>
>That certainly would simplify installs.
_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
_______________________________________________
Rxtx mailing list
Rxtx@linuxgrrls.org
http://hex.linuxgrrls.org/mailman/listinfo/rxtx
From taj at linuxgrrls.org Fri Jul 11 12:46:30 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jul 11 11:46:31 2003
Subject: [Rxtx] loading .dll or .so from jar
In-Reply-To:
References:
Message-ID:
The pdf solution is fairly easy to implement but does involve installing
native libraries. The security...
OK. Lets start with Unix which I'm more familiar with than w32. There
are two places these files would be allowed to be extracted:
~/ (the users home directory such as /home/jarvi
/tmp /usr/tmp /usr/local/tmp - one of the tmp directories
When applications do this they usually use a dot directory. If its in a
tmp directory then cleanup is expected to be done afterwards. Lets just
look at the home directory.
/home/jarvi/.rxtx The home direcotry could be shared across
multiple OS's and archs via NFS, SMB, ... so there would have
to be subdirecotries for OS and arch. solaris/i386 for instance.
Writing to the system/jre/jdk directories would be bad form and users
will typically not have permission anyhow.
In order for this to automatically happen, The lockfile feature would have
to be disabled. This means a person using this library could open say a
modem being used by another user and interfere with communications.
I'm not sure at all what would be acceptable in a modern NT environment.
Does anyone know what would be done as a user on say w2003? There are
probably simular issues and solutions.
On Fri, 11 Jul 2003, Ricardo Trindade wrote:
> Hi,
>
> Why all this complication ? It's so easy. Have you read the pdf and .java I
> posted ? That's the way several projects are doing it.
>
> 1) Extract the correct .dll or .so to your current director, depending on
> platform
> 2) Read said library with System.load( currentDir + libName );
> 3) done
>
> The System.load call doesn't rely on java library path, just on absolute
> filesystem location. if the library is extracted to the current directory,
> no directory or path issues will appear.
>
> If you find this inadequate to include in rxtx itself, please consider
> adding a boolean flag to define wether or not RXTX will call
> System.loadLibrary, so that people wanting to use the scheme above can do it
> outside RXTX.
>
> thanks
> Ricardo
>
> -----Mensagem original-----
> De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
> nome de Awais Ahmed
> Enviada: quinta-feira, 10 de Julho de 2003 20:25
> Para: rxtx@linuxgrrls.org
> Cc: awaisa@hotmail.com
> Assunto: Re: [Rxtx] loading .dll or .so from jar
>
>
> Hello All,
> I guess the first question is: if it is possible.
> The answer is *NO*. I am not aware of any support
> like this from Suns JVM implementation.
> All JNI based shared libraries are loaded in the
> following flow of functional execution.
> 1. Java Application somewhere requests to load a
> native library. Using calls like
> System.loadLibrary(""). Normally this
> is done in some static initializers
> 2. Later, defining class loader of the class
> containing loadLibrary Call invokes a one of its
> JNI *native* function to load a library.
> 3. That particular native system library requests
> JVM to load the requested library, which is then
> loaded through the dynamic loader.
>
> Now to make it happen, one will have to consider
> security issues and see how to add support to
> extract a native library from a jar and place it
> in some location/path which could later be made
> accessible to the dynamic loader to load. And this
> again has an issue. Currently, I am not aware of
> any scenario where a JVM creates any executible
> code file anywhere in your secondary location.
> Anything that is generated is mapped on memory
> and is all dynamic. Introducing a system library
> would be a new thing.
>
> Note: It's it important to have a library be
> loaded through some VM as then VM will be
> responsible for unloading that library if it's
> no more referenced.
>
> Now I can think of folowing ways:
> 1. You create your own objects that makes use of
> packages like java.util.jar or java.util.zip
> or some other custom components and extract the
> native libraries at some location and then
> modify java.library.path and then let
> System.loadLibrary play it trick. It is a
> little ugly as one also will have to keep in
> mind some files cleanup mechanism.
>
> 2. An ideal way (may not be in your control to
> do it) could be:
> Have the VM do it totally and issues would be:
> Since dynamic loader also has a major role
> in loading a library, which has to have some
> physical existance accessible through some path.
> And there are issues and concerns if VM will
> create a new file with executible code in a
> disk-space. As any runtime code should only be
> laid out in memory. (Note it's not accesptable
> to have VM create/introduce any new native code
> based files) One option that makes it do-able
> is if dynamic loader gives an interface to load
> a library from memory. In this scenario VM could
> extract the system library bits and map it in
> some memory and let the dynamic loader accept
> executible code from memory.
> One can try it on some research VMs along with
> some adding some support in dynamic loader.
>
> Awais Sheikh
>
> PS: I am not sure if this email will go through as
> I am not sending it through my registered email
> address.
>
> ----- Original Message -----
> From: "Ricardo Trindade"
> To: "Java RXTX discussion"
> Sent: Thursday, July 10, 2003 10:35 AM
> Subject: RE: [Rxtx] loading .dll or .so from jar
>
>
> >I've looked this article up on the net, which explains the concept.
> >
> >I implemented it, but found an issue regarding the native lib. I load the
> >library with System.load, but an exception
> >is thrown on you System.loadlibrary("rxtxSerial"), saying I don't have the
> >library on java.library.path. So I imagine that for this to be possible you
> >would have to handle the loading with System.load, as stated in the
> >article,
> >or accept an argument to not load the library.
> >
> >What do you think of this ?
> >
> >Ricardo
> >
> >-----Mensagem original-----
> >De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
> >nome de Trent Jarvi
> >Enviada: segunda-feira, 7 de Julho de 2003 1:45
> >Para: Java RXTX discussion
> >Assunto: Re: [Rxtx] loading .dll or .so from jar
> >
> >
> >
> >
> >On Mon, 7 Jul 2003, Ricardo Trindade wrote:
> >
> > > Hi,
> > >
> > > Hi was wondering if you haver considered including the .dll and .so in
> >the
> > > jar, and loading the adequate one depending on the platform.
> > >
> > > Is this even possible ?
> > >
> > > It would also make life easier for rxtx begginners. The only drawback I
> >see
> > > is the increase in jar size, but people concerned about that could
> >always
> > > delete it. Also with tens of megs of JRE it's hardly a problem for any
> >java
> > > user...
> > >
> >
> >Hi Ricardo
> >
> >Thats a great idea.
> >
> >Have you done something like this before? I can picture everything
> >required except for the native library paths. Thats probably doable also.
> >
> >That certainly would simplify installs.
>
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
From robilad at kaffe.org Mon Jul 14 14:41:38 2003
From: robilad at kaffe.org (Dalibor Topic)
Date: Mon Jul 14 16:16:49 2003
Subject: [Rxtx] Implementing javax.comm for free software java
implementations (Was:
Re: [kaffe] Notes on kaffe (GNU Classpath integration) todo items)
In-Reply-To: <200307140820.h6E8KM518684@guri.is.kpn.be>
References: <1058125728.1750.28.camel@localhost>
<200307140820.h6E8KM518684@guri.is.kpn.be>
Message-ID: <3F1296F2.9060801@kaffe.org>
Hi Chris,
I've CC:ed Trent Jarvi, the maintainer of rxtx, see http://www.rxtx.org
for more information about it.
Chris Gray wrote:
> On Monday 14 July 2003 00:11, Mark Wielaard wrote:
>
>
>>- javax.comm stuff
>> - Kaffe has incomplete stubs
>> - There is the rxtx (sp?) project which has been usable.
>> (Check kaffe mailinglist archives)
>> They have ported to lots of platforms
>> - Wonka also has a implementation... (Status?)
>
>
> Wonka implementation status:
> [+] works, tested in a number of real-life situations. Uses async i/o on
> Linux.
> [-] ugly as hell: hard-coded data structures for 4 serial ports, giant
> switch statements, etc. Uses Wonka Native Interface (WNI), would need porting
> to JNI (but this is not hard).
>
> For a project I'm working on currently it could be interesting to either
> convert the current Wonka implementation to JNI or switch to rxtx. Has anyone
> out there anyhing good or bad to say about rxtx?
For kaffe it would be nice to use rxtx, since
* we had it nicely running under kaffe
http://www.kaffe.org/pipermail/kaffe/2003-April/029251.html
* it is supposed to be quite portable
The following OS's should have full Serial Commapi Serial Support:
mingw32 (windows 9* NT*) (no printer support)
WinCE (no printer support)
Solaris 2.x (*-*-solaris2*) x86 and sparc
Linux ELF (*-*-linux*, except aout, coff, and oldld)
FreeBSD 3.x 4.x (*-*-freebsd2*, *-*-freebsd3*)
Mac OS X
HP-UX 10.x (*-*-hpux10*)
SCO OpenServer 5.x (*-*-sco3.2v5*) (there may be recent breakage)
UnixWare
Digital/UNIX
* it appears to be in widespread use in different projects.
* it can be 'plugged in' into Sun's javax.comm implementation.
On the negative side:
* it needs someone to write the java part of javax.comm (which wonka
already has working, kaffe has a GPLd implementation of unknown quality).
* We don't have anyone from rxtx on Classpath's or Kaffe's mailing
lists, so there is a communication gap.
cheers,
dalibor topic
From taj at linuxgrrls.org Mon Jul 14 17:28:29 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Mon Jul 14 16:28:30 2003
Subject: [Rxtx] Implementing javax.comm for free software java
implementations
(Was: Re: [kaffe] Notes on kaffe (GNU Classpath integration) todo
items)
In-Reply-To: <3F1296F2.9060801@kaffe.org>
References: <1058125728.1750.28.camel@localhost>
<200307140820.h6E8KM518684@guri.is.kpn.be>
<3F1296F2.9060801@kaffe.org>
Message-ID:
On Mon, 14 Jul 2003, Dalibor Topic wrote:
> Hi Chris,
>
> I've CC:ed Trent Jarvi, the maintainer of rxtx, see http://www.rxtx.org
> for more information about it.
>
> Chris Gray wrote:
> > On Monday 14 July 2003 00:11, Mark Wielaard wrote:
> >
> >
> >>- javax.comm stuff
> >> - Kaffe has incomplete stubs
> >> - There is the rxtx (sp?) project which has been usable.
> >> (Check kaffe mailinglist archives)
> >> They have ported to lots of platforms
> >> - Wonka also has a implementation... (Status?)
> >
> >
> > Wonka implementation status:
> > [+] works, tested in a number of real-life situations. Uses async i/o on
> > Linux.
> > [-] ugly as hell: hard-coded data structures for 4 serial ports, giant
> > switch statements, etc. Uses Wonka Native Interface (WNI), would need porting
> > to JNI (but this is not hard).
> >
> > For a project I'm working on currently it could be interesting to either
> > convert the current Wonka implementation to JNI or switch to rxtx. Has anyone
> > out there anyhing good or bad to say about rxtx?
>
> For kaffe it would be nice to use rxtx, since
>
> * we had it nicely running under kaffe
> http://www.kaffe.org/pipermail/kaffe/2003-April/029251.html
>
> * it is supposed to be quite portable
>
> The following OS's should have full Serial Commapi Serial Support:
>
> mingw32 (windows 9* NT*) (no printer support)
> WinCE (no printer support)
> Solaris 2.x (*-*-solaris2*) x86 and sparc
> Linux ELF (*-*-linux*, except aout, coff, and oldld)
> FreeBSD 3.x 4.x (*-*-freebsd2*, *-*-freebsd3*)
> Mac OS X
> HP-UX 10.x (*-*-hpux10*)
> SCO OpenServer 5.x (*-*-sco3.2v5*) (there may be recent breakage)
> UnixWare
> Digital/UNIX
>
> * it appears to be in widespread use in different projects.
>
> * it can be 'plugged in' into Sun's javax.comm implementation.
>
> On the negative side:
> * it needs someone to write the java part of javax.comm (which wonka
> already has working, kaffe has a GPLd implementation of unknown quality).
>
> * We don't have anyone from rxtx on Classpath's or Kaffe's mailing
> lists, so there is a communication gap.
>
There should also be minimal support for printer ports on w32 also.
We'd be more than willing to work with Classpath and or Kaffe to get this
working. RXTX 2.1 implements CommAPI from the top down but is in package
gnu.io to avoid confusion with Sun's impementation.
RXTX 2.0 implements the lower portion of CommAPI and could be made to work
with the upper portion offered in Kaffe. The Kaffe shell classes did look
acceptable when I read through them.
--
Trent Jarvi
From robilad at kaffe.org Mon Jul 14 19:03:17 2003
From: robilad at kaffe.org (Dalibor Topic)
Date: Mon Jul 14 17:03:21 2003
Subject: [Rxtx] Implementing javax.comm for free software java
implementations
(Was: Re: [kaffe] Notes on kaffe (GNU Classpath integration) todo
items)
In-Reply-To:
References: <1058125728.1750.28.camel@localhost> <200307140820.h6E8KM518684@guri.is.kpn.be> <3F1296F2.9060801@kaffe.org>
Message-ID: <3F12D445.5070808@kaffe.org>
Hi Trent,
Trent Jarvi wrote:
> We'd be more than willing to work with Classpath and or Kaffe to get this
> working. RXTX 2.1 implements CommAPI from the top down but is in package
> gnu.io to avoid confusion with Sun's impementation.
>
> RXTX 2.0 implements the lower portion of CommAPI and could be made to work
> with the upper portion offered in Kaffe. The Kaffe shell classes did look
> acceptable when I read through them.
Could we implement the javax.comm shell classes on top of RXTX 2.1
gnu.io API? I.e. would it be enough to just delegate method calls to
gnu.io. for a basic javax.comm implementation?
cheers,
dalibor topic
From taj at linuxgrrls.org Mon Jul 14 18:11:57 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Mon Jul 14 17:11:58 2003
Subject: [Rxtx] Implementing javax.comm for free software java
implementations
(Was: Re: [kaffe] Notes on kaffe (GNU Classpath integration) todo
items)
In-Reply-To: <3F12D445.5070808@kaffe.org>
References: <1058125728.1750.28.camel@localhost>
<200307140820.h6E8KM518684@guri.is.kpn.be>
<3F1296F2.9060801@kaffe.org>
<3F12D445.5070808@kaffe.org>
Message-ID:
On Mon, 14 Jul 2003, Dalibor Topic wrote:
> Hi Trent,
>
> Trent Jarvi wrote:
>
> > We'd be more than willing to work with Classpath and or Kaffe to get this
> > working. RXTX 2.1 implements CommAPI from the top down but is in package
> > gnu.io to avoid confusion with Sun's impementation.
> >
> > RXTX 2.0 implements the lower portion of CommAPI and could be made to work
> > with the upper portion offered in Kaffe. The Kaffe shell classes did look
> > acceptable when I read through them.
>
> Could we implement the javax.comm shell classes on top of RXTX 2.1
> gnu.io API? I.e. would it be enough to just delegate method calls to
> gnu.io. for a basic javax.comm implementation?
Hi Dalibor
That would be one possiblity. Another option would be to keep a diff
which simply converts RXTX 2.1 into javax.comm. There are even scripts
floating around which do that.
--
Trent Jarvi
From sylvie.locastello at thales-is.com Tue Jul 15 12:40:05 2003
From: sylvie.locastello at thales-is.com (Sylvie Locastello)
Date: Tue Jul 15 10:38:14 2003
Subject: [Rxtx] Java comm + kermit on rxtx
Message-ID: <3F13CBF5.6CEA1DFE@thales-is.com>
Hello,
1) Java SerialIO communication on Linux
We have to write a Java API, with serialIO communication
(RS232-RS422-RS485) protocol running on Linux target
machine.
we have found the "rxtx.org" website, the rxtx-2.1 seems to be a good
solution, so we're going to try it
2) Java Kermit on Linux
Further, we'll have probably to make file-transfert beetween machines
running on Linux, via serialIO communication
(RS232-RS422-RS485).
We actually think a good solution would be to have a Java Kermit API
running on Linux.
A good solution would be to add other LGPL code which already does
kermit into rxtx free of charge.
Has anybody already done this job : Java Kermit API on rxtx ?
Thanks in advance
Sylvie
From chris at kiffer.eunet.be Tue Jul 15 10:11:49 2003
From: chris at kiffer.eunet.be (Chris Gray)
Date: Tue Jul 15 17:19:03 2003
Subject: [Rxtx] Implementing javax.comm for free software java
implementations (Was: Re: [kaffe] Notes on kaffe (GNU Classpath
integration) todo items)
In-Reply-To:
References: <1058125728.1750.28.camel@localhost> <3F1296F2.9060801@kaffe.org>
Message-ID: <200307150711.h6F7Boj23624@xizor.is.kpn.be>
On Monday 14 July 2003 17:28, Trent Jarvi wrote:
> We'd be more than willing to work with Classpath and or Kaffe to get this
> working. RXTX 2.1 implements CommAPI from the top down but is in package
> gnu.io to avoid confusion with Sun's impementation.
>
> RXTX 2.0 implements the lower portion of CommAPI and could be made to work
> with the upper portion offered in Kaffe. The Kaffe shell classes did look
> acceptable when I read through them.
My current main project involves Wonka on uClinux, where everything is
statically linked: I'm a bit worried about the effects of LPGL contagion in
that environment. So I'll probably stick with the Wonka implementation for
that one, but check out rxtx for future projects.
--
Chris Gray /k/ Embedded Java Solutions
Embedded & Mobile Java, OSGi http://www.kiffer.be/k/
chris.gray@kiffer.be +32 477 599 703
From taj at linuxgrrls.org Tue Jul 15 21:00:53 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Tue Jul 15 20:00:53 2003
Subject: [Rxtx] Java comm + kermit on rxtx
In-Reply-To: <3F13CBF5.6CEA1DFE@thales-is.com>
References: <3F13CBF5.6CEA1DFE@thales-is.com>
Message-ID:
On Tue, 15 Jul 2003, Sylvie Locastello wrote:
> Hello,
>
>
> 1) Java SerialIO communication on Linux
> We have to write a Java API, with serialIO communication
> (RS232-RS422-RS485) protocol running on Linux target
> machine.
> we have found the "rxtx.org" website, the rxtx-2.1 seems to be a good
> solution, so we're going to try it
>
> 2) Java Kermit on Linux
>
> Further, we'll have probably to make file-transfert beetween machines
> running on Linux, via serialIO communication
> (RS232-RS422-RS485).
> We actually think a good solution would be to have a Java Kermit API
> running on Linux.
> A good solution would be to add other LGPL code which already does
> kermit into rxtx free of charge.
>
> Has anybody already done this job : Java Kermit API on rxtx ?
>
> Thanks in advance
> Sylvie
>
>
Hi Sylvie
I have looked at the Kermit project briefly. There is a G-kermit package
which is offered under the GPL. This would be a possible solution. One
could put together a JNI library which rxtx could call. It's my
understanding that commercial applications could then make calls to rxtx
but you should verify that.
It would not be very hard to make a java library with G-Kermit source.
Doing something in pure Java would probably be a larger project.
http://www.columbia.edu/kermit/gkermit.html
From taj at parcelfarce.linux.theplanet.co.uk Wed Jul 16 04:21:23 2003
From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk)
Date: Wed Jul 16 03:21:34 2003
Subject: [Rxtx] serial_select() modification for Win32 (fwd)
Message-ID:
--
Trent Jarvi
taj@www.linux.org.uk
---------- Forwarded message ----------
Hi Trent,
I was having troubles with rxtx-2.1-6 under Win32 so I
modified serial_select() in termios.c. I think I have
serial_select() acting a bit more like it's Linux
counter part. I have done very little testing with
this, namely used it with BlackBox and my application
both under Windows2000. I have attached the file so
you can review the changes.
Thanks for all your effort in developing this library,
it's much appreciated.
Mike Risi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: termios.c.tar.gz
Type: application/x-gzip-compressed
Size: 19392 bytes
Desc: termios.c.tar.gz
Url : http://hex.linuxgrrls.org/pipermail/rxtx/attachments/20030716/c9c9c113/termios.c.tar-0001.bin
From taj at parcelfarce.linux.theplanet.co.uk Thu Jul 17 19:03:01 2003
From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk)
Date: Thu Jul 17 18:03:07 2003
Subject: [Rxtx] WG: RXTX Issue (fwd)
Message-ID:
Summary:
rxtx requires an EventListener to use notifyOn*
The fix would involve moving code around in rxtx so it persists outside
the EventListener.
--
Trent Jarvi
taj@www.linux.org.uk
---------- Forwarded message ----------
HI!
I have found the problem/mistake with the parity error!
After removing the event listener it isn't possible to call any
notifyOn... Funktion.
In the file ErrorTest.java you can see the problem.
The problem occurs in all tested linux versions.
In windows we don't have this problems but there we use the sun classes!
Don't know why it happend but now i got rid of my problems.
Thankx for your help!
cu
----- Original Message -----
>
> As the case should be fairly simple, could you provide a test case
> that reproduces the problem so I can take a look?
>
> On Mon, 14 Jul 2003, Thomas Selner wrote:
>
> > I took a closer look at the function notifyOnParityError, and now i
> > know
why
> > i get the exception!
> > the function-call "nativeSetEventFlag" doesn't produce the
> > exception, but the function call "monThread.PE = true" does, because
> > "monThread"
always
> > has a "null"
> > value, but i couldn't find out why!
> >
> > could you help me with that?
> > i don't do nothing special with my serial port in my java program. i
> > just ...
> > * initialize a Serial-Port - object
> > * setSerialPortParams(1200,7,1,2)
> > * enableReceiveTimeout(1)
> > * call the functions "getInput/OutputStream"
> > * notifyOnParityError(true)
> > * notifyOnDataAvailable(true)
> > * sPort.addEventListener(...)
> >
> > that's all!
> >
> > ----- Original Message -----
> > >
> > > Hi Thomas
> > >
> > > I'm looking at RXTXPort.java
> > >
> > > public void notifyOnParityError( boolean enable )
> > > {
> > > if (debug)
> > > z.reportln( "RXTXPort:notifyOnParityError(
" +
> > > enable+" )");
> > > waitForTheNativeCodeSilly();
> > > MonitorThreadLock = true;
> > > nativeSetEventFlag( fd, SerialPortEvent.PE, enable
);
> > > monThread.PE = enable;
> > > MonitorThreadLock = false;
> > > }
> > >
> > > Lets assume there are no changes to SerialImp.c for a second. I'm
looking
> > > at rxtx-2.1-7pre16. If you are not using rxtx-2.1-7pre16, you can
test it
> > > by simply changing
> > >
> > > import javax.comm.*; to
> > > import gnu.io.*;
> > >
> > > in your source.
> > >
> > > If you comment out nativeSetEventFlag( fd, SerialPortEvent.PE,
enable );
> > > above, You can not generate the error you saw when you enable
> > > Parity
Error
> > > events.
> > >
> > > monThread.PE = true
> > >
> > > This is on the Java side. Perhaps you see an error as Parity
> > > Error
events
> > > are attempted to be sent but they must be different. Commenting
> > > out
that
> > > line just disabled Parity Error events.
> > >
> > > What is the error you see if you comment out the
> > > nativeSetEventFlag
shown
> > > above and leave the monThread.PE = true line?
> > >
> > > One way that PE events may not work on linux is if the serial port
driver
> > > used on your PC is not able to support TIOCGICOUNT. This would
> > > only happen on rare cards with very poor linux support.
> > >
> > > On Fri, 11 Jul 2003, Thomas Selner wrote:
> > >
> > > > Hello again, Mr. Jarvi!
> > > >
> > > > First, I really want to thank you for your help!!!
> > > >
> > > > I tried both suggestions for solving the problem, but ...
> > > >
> > > > @ Changes to SerialImp.c
> > >
> >
> ----------------------------------------------------------------------
> ----
> > --
> > > > --------------------------------------------
> > > > When I added the #ifndef Statement as you told me, i could
> > > > compile
and
> > run
> > > > my application, but
> > > > i wasn't able to receive any SerialEvent anymore!
> > >
> >
> ----------------------------------------------------------------------
> ----
> > --
> > > > --------------------------------------------
> > > >
> > > > @ Changes to RXTXPort.java
> > >
> >
> ----------------------------------------------------------------------
> ----
> > --
> > > > --------------------------------------------
> > > > I out-commented the line "nativeSetEventFlag( fd,
SerialPortEvent.PE,
> > > > enable );", but it didn't change something at all.
> > > > So i tried to out-comment the next line "monThread.PE = true".
> > > > That
> > worked
> > > > for me, but i am afraid that from now i
> > > > will never be able to get ParityEvents anymore. the problem is,
> > > > i
don't
> > how
> > > > to really test parity errors ... :-)
> > >
> >
> ----------------------------------------------------------------------
> ----
> > --
> > > > --------------------------------------------
> > > >
> > > > I really need to get ALL SerialEvents, PE and DATA_AVAILABLE and
> > > > ... (etc.)!!!
> > > >
> > > > I have to say that I used the RXTX Version 2.0.5, because I
> > > > didn't
want
> > to
> > > > change the "import" statements from
> > > > "javax.comm" to "gnu.io". I know that there is a script which
> > > > solves
> > this
> > > > problem ("changePackage.sh"), but i didn't really understand,
> > > > how and when (before or after compiling rxtx?) i should use it!
> > > >
> > > > Should i use a newer version of rxtx (e.g. 2.1.6)? will it work
there?
> > > >
> > > >
> > > > Thomas
> > > >
> > > >
> > > >
> > > >
> > > > ----- Original Message -----
> > > >
> > > > > On Thu, 10 Jul 2003, Thomas Selner wrote:
> > > > >
> > > > > > Hi Mr. Jarvi!
> > > > > >
> > > > > > I would like to use RXTX in relation with a serial device,
> > > > > > but i
> > need to
> > > > use the
> > > > > > CommAPI Function "SerialPort.notifyOnParityError(boolean)".
> > > > > >
> > > > > > When i compile my classes under windows xp with the comm-api
> > provided by
> > > > sun,
> > > > > > it works. under redhat linux 9 i get following exception
> > > > > > when
> > calling
> > > > the above function:
> > > > > >
> > > > > > nativeSetEventFlag !index java.lang.NullPointerException
> > > > > > at
> > gnu.io.RXTXPort$MonitorThread.access$702(RXTXPort.java:1500)
> > > > > > at
gnu.io.RXTXPort.notifyOnParityError(RXTXPort.java:990)
> > > > > > at
> > > > at.bdc.intersport.bk.eps48.Eps48Base.perform(Eps48Base.java:50)
> > > > > > at
> > > >
at.bdc.intersport.tester.serial.SerialTester.main(SerialTester.java:103)
> > > > > >
> > > > > >
> > > > > > could you plz tell me if this function is implemented in
> > > > > > rxtx or
> > when it
> > > > will be implemented?
> > > > > >
> > > > > >
> > > > > >
> > > > > > greetz ... thomas
> > > > >
> > > > > Hi Thomas
> > > > >
> > > > > I think this is implemented but there is some cruft that needs
> > > > > to
be
> > > > > fixed.
> > > > >
> > > > > in SerialImp.c there needs to be an ifdef TIOCSERGETLSR
> > > > > (remove
the "+
> > > > "'s):
> > > > > JNIEXPORT void JNICALL RXTXPort(nativeSetEventFlag)( JNIEnv
*env,
> > > > >
> > > > > jobject
jobj,
> > > > > jint
fd,
> > > > > jint
event,
> > > > >
> > > > > jboolean
> > flag )
> > > > > {
> > > > >
> > > > > + #ifndef TIOCSERGETLSR
> > > > > ... entire function
> > > > > + #endif /* TIOCSERGETLSR */
> > > > > }
> > > > >
> > > > > You could also comment out
> > > > >
> > > > > nativeSetEventFlag( fd, SerialPortEvent.PE, enable );
> > > > >
> > > > > in RXTXPort.java:notifyOnParityError( boolean enable )
> > > > >
> > > > > On linux the result would be the same either way.
> > > > >
> > > > > This function is a workaround for Solaris and is really
> > > > > unrelated
to
> > > > > getting linux PE working. I see that rxtx is checking for PE
> > > > > but
I'm
> > > > > guessing it is not well tested since this is the first time
> > > > > the
> > problem
> > > > > has shown up.
> > > > >
> > > > > Could you let me know if that works?
> > > > >
> > > > > --
> > > > > Trent Jarvi
> > > > > taj@www.linux.org.uk
> > > >
> > > >
> > >
> > > --
> > > Trent Jarvi
> > > taj@www.linux.org.uk
> >
> >
>
> --
> Trent Jarvi
> taj@www.linux.org.uk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ErrorTest.class
Type: application/octet-stream
Size: 1621 bytes
Desc:
Url : http://hex.linuxgrrls.org/pipermail/rxtx/attachments/20030717/6e365fc7/ErrorTest.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ErrorTest.java
Type: application/octet-stream
Size: 1281 bytes
Desc:
Url : http://hex.linuxgrrls.org/pipermail/rxtx/attachments/20030717/6e365fc7/ErrorTest-0001.obj
From emiliano at carlesi.vg Sat Jul 19 22:47:35 2003
From: emiliano at carlesi.vg (emiliano carlesi)
Date: Fri Jul 18 20:47:44 2003
Subject: [Rxtx] rxtx on osx
Message-ID:
hi to all !
this is my first mail in this ml ... so excuse if the question is
stupid !
i use osx and i need to use my cell phone via bluetooth, with java.
i have create the serial bluetooth link with the phone and from the
zterm console all work well.
now i need to do the same think from my program.
i write to the apple dev ml and all reply me to use the rxtx.
then i download rxtx and i try to compile it, following the
instructions. i have the version rxtx-2.1-7pre16.
i read on the instruction for osx users (using project builder). i
open the project the i need to compile
the target libSerial.jnilib, but i have not this target in this
project, i have only the librxtxSerial.jnilib target.
then i try to compile this. the compiler end with error because it
don't find the Zystem package.
i search on the rxtx site but i don't find nothing about this package.
i try then to download the previous version, the 1.5 (i see there are
some pointer to this version in the docs).
after the download (version 1.5-8) i try to compile and in this project
i find the LibSerial.jnilib target !
very happy i try to compile this and the compilation ... fail :-(
this is the error :
#!/bin/tcsh
cp build/RXTXcomm.jar
../ForPackageMaker/Install/System/Library/Frameworks/JavaVM.framework/
Versions/1.3.1/Home/lib/ext/
--- Output ---
cp:
../ForPackageMaker/Install/System/Library/Frameworks/JavaVM.framework/
Versions/1.3.1/Home/lib/ext: No such file or directory
=== Exit code: 1 ===
...failed PhaseScriptExecution
/Users/emilianocarlesi/Desktop/rxtx-1.5-8/MACOSX_IDE/PB/
build/LibSerial.build/RXTXcomm.build/BPTag004-script.sh ...
in the build directory i find : the RXTXcomm.jar package, a link to it
and a directory LibSerial.build.
instead for the documentation i need to find here the libSerial.jnilib
file.
thanks in advance
emiliano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 2014 bytes
Desc: not available
Url : http://hex.linuxgrrls.org/pipermail/rxtx/attachments/20030719/f1c69502/attachment.bin
From taj at linuxgrrls.org Fri Jul 18 21:56:00 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jul 18 20:56:02 2003
Subject: [Rxtx] rxtx on osx
In-Reply-To:
References:
Message-ID:
On Sat, 19 Jul 2003, emiliano carlesi wrote:
> hi to all !
> this is my first mail in this ml ... so excuse if the question is
> stupid !
>
> i use osx and i need to use my cell phone via bluetooth, with java.
>
> i have create the serial bluetooth link with the phone and from the
> zterm console all work well.
>
> now i need to do the same think from my program.
>
> i write to the apple dev ml and all reply me to use the rxtx.
>
> then i download rxtx and i try to compile it, following the
> instructions. i have the version rxtx-2.1-7pre16.
> i read on the instruction for osx users (using project builder). i
> open the project the i need to compile
> the target libSerial.jnilib, but i have not this target in this
> project, i have only the librxtxSerial.jnilib target.
> then i try to compile this. the compiler end with error because it
> don't find the Zystem package.
> i search on the rxtx site but i don't find nothing about this package.
>
> i try then to download the previous version, the 1.5 (i see there are
> some pointer to this version in the docs).
> after the download (version 1.5-8) i try to compile and in this project
> i find the LibSerial.jnilib target !
> very happy i try to compile this and the compilation ... fail :-(
>
> this is the error :
>
> #!/bin/tcsh
> cp build/RXTXcomm.jar
> ../ForPackageMaker/Install/System/Library/Frameworks/JavaVM.framework/
> Versions/1.3.1/Home/lib/ext/
> --- Output ---
> cp:
> ../ForPackageMaker/Install/System/Library/Frameworks/JavaVM.framework/
> Versions/1.3.1/Home/lib/ext: No such file or directory
> === Exit code: 1 ===
> ...failed PhaseScriptExecution
> /Users/emilianocarlesi/Desktop/rxtx-1.5-8/MACOSX_IDE/PB/
> build/LibSerial.build/RXTXcomm.build/BPTag004-script.sh ...
>
>
> in the build directory i find : the RXTXcomm.jar package, a link to it
> and a directory LibSerial.build.
> instead for the documentation i need to find here the libSerial.jnilib
> file.
>
>
>
Hi Emiliano
This is probably my mistake. Could you email me the link to where you got
rxtx-2.1-7pre16.tar.gz and I'll make sure it is corrected.
Zystem was/is a debug library for w32 I threw together to figure out some
timing issues. It prints out debug messages with timestamps. Obviously
you dont need it.
I thought I had caught that in time. The correction is to change the
files to not use Zystem.
From emiliano at carlesi.vg Sat Jul 19 23:13:01 2003
From: emiliano at carlesi.vg (emiliano carlesi)
Date: Fri Jul 18 21:13:04 2003
Subject: [Rxtx] rxtx on osx
In-Reply-To:
Message-ID: <65C588FD-BA25-11D7-B422-000A95891300@carlesi.vg>
hi trent,
i found the package on the ftp ftp://jarvi.dsl.frii.com/pub and i have
download the latest in time order.
which version you think i can download ?
thank you very much for the speed in the response !!!!!
ciao
emiliano
On Friday, Jul 18, 2003, at 21:56 Europe/Rome, Trent Jarvi wrote:
>
>
> On Sat, 19 Jul 2003, emiliano carlesi wrote:
>
>> hi to all !
>> this is my first mail in this ml ... so excuse if the question is
>> stupid !
>>
>> i use osx and i need to use my cell phone via bluetooth, with java.
>>
>> i have create the serial bluetooth link with the phone and from the
>> zterm console all work well.
>>
>> now i need to do the same think from my program.
>>
>> i write to the apple dev ml and all reply me to use the rxtx.
>>
>> then i download rxtx and i try to compile it, following the
>> instructions. i have the version rxtx-2.1-7pre16.
>> i read on the instruction for osx users (using project builder). i
>> open the project the i need to compile
>> the target libSerial.jnilib, but i have not this target in this
>> project, i have only the librxtxSerial.jnilib target.
>> then i try to compile this. the compiler end with error because it
>> don't find the Zystem package.
>> i search on the rxtx site but i don't find nothing about this package.
>>
>> i try then to download the previous version, the 1.5 (i see there are
>> some pointer to this version in the docs).
>> after the download (version 1.5-8) i try to compile and in this
>> project
>> i find the LibSerial.jnilib target !
>> very happy i try to compile this and the compilation ... fail :-(
>>
>> this is the error :
>>
>> #!/bin/tcsh
>> cp build/RXTXcomm.jar
>> ../ForPackageMaker/Install/System/Library/Frameworks/JavaVM.framework/
>> Versions/1.3.1/Home/lib/ext/
>> --- Output ---
>> cp:
>> ../ForPackageMaker/Install/System/Library/Frameworks/JavaVM.framework/
>> Versions/1.3.1/Home/lib/ext: No such file or directory
>> === Exit code: 1 ===
>> ...failed PhaseScriptExecution
>> /Users/emilianocarlesi/Desktop/rxtx-1.5-8/MACOSX_IDE/PB/
>> build/LibSerial.build/RXTXcomm.build/BPTag004-script.sh ...
>>
>>
>> in the build directory i find : the RXTXcomm.jar package, a link to it
>> and a directory LibSerial.build.
>> instead for the documentation i need to find here the libSerial.jnilib
>> file.
>>
>>
>>
> Hi Emiliano
>
> This is probably my mistake. Could you email me the link to where you
> got
> rxtx-2.1-7pre16.tar.gz and I'll make sure it is corrected.
>
> Zystem was/is a debug library for w32 I threw together to figure out
> some
> timing issues. It prints out debug messages with timestamps.
> Obviously
> you dont need it.
>
> I thought I had caught that in time. The correction is to change the
> files to not use Zystem.
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
From taj at linuxgrrls.org Fri Jul 18 22:31:09 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jul 18 21:31:11 2003
Subject: [Rxtx] rxtx on osx
In-Reply-To: <65C588FD-BA25-11D7-B422-000A95891300@carlesi.vg>
References: <65C588FD-BA25-11D7-B422-000A95891300@carlesi.vg>
Message-ID:
Hmm OK.
The Zystem.java file looks fine:
static
{
/*
The rxtxZystem library uses Python code and is not
included with RXTX. A seperate library will be released
to avoid potential license conflicts.
Trent Jarvi taj@www.linux.org.uk
*/
//System.loadLibrary( "rxtxZystem" );
mode = SILENT_MODE;
}
I suspect the following is causing the compiler error
RXTXPort.java: private static Zystem z;
RXTXPort.java: z = new Zystem( Zystem.SILENT_MODE );
I'm not familiar with the Mac OS X build but I suspect it needs to have
Zystem.java and UnSupportedLoggerException.java added. These files are in
the src/ directory. Nothing else should be required.
These two files are new in the 2.1-7pre series. Dmitry may have these
fixed in CVS. You could try checking out the CVS files if you have cvs
installed:
export CVSROOT=:pserver:anonymous@cvs.milestonesolutions.com:/usr/local/cvsroot
cvs login (password is mousy)
cvs checkout -r commapi-0-0-1 rxtx-devel
It may be that rxtx 2-1.6 was the last release that compiled on Mac OS X
and we need to get some fixes in. Dmitry can be of more help here.
He should be on the mail list but can also be reached at dmarkman@mac.com.
Please let us know how things go so we can fix it for others.
On Sat, 19 Jul 2003, emiliano carlesi wrote:
> hi trent,
> i found the package on the ftp ftp://jarvi.dsl.frii.com/pub and i have
> download the latest in time order.
> which version you think i can download ?
> thank you very much for the speed in the response !!!!!
>
> ciao
> emiliano
>
> On Friday, Jul 18, 2003, at 21:56 Europe/Rome, Trent Jarvi wrote:
>
> >
> >
> > On Sat, 19 Jul 2003, emiliano carlesi wrote:
> >
> >> hi to all !
> >> this is my first mail in this ml ... so excuse if the question is
> >> stupid !
> >>
> >> i use osx and i need to use my cell phone via bluetooth, with java.
> >>
> >> i have create the serial bluetooth link with the phone and from the
> >> zterm console all work well.
> >>
> >> now i need to do the same think from my program.
> >>
> >> i write to the apple dev ml and all reply me to use the rxtx.
> >>
> >> then i download rxtx and i try to compile it, following the
> >> instructions. i have the version rxtx-2.1-7pre16.
> >> i read on the instruction for osx users (using project builder). i
> >> open the project the i need to compile
> >> the target libSerial.jnilib, but i have not this target in this
> >> project, i have only the librxtxSerial.jnilib target.
> >> then i try to compile this. the compiler end with error because it
> >> don't find the Zystem package.
> >> i search on the rxtx site but i don't find nothing about this package.
> >>
> >> i try then to download the previous version, the 1.5 (i see there are
> >> some pointer to this version in the docs).
> >> after the download (version 1.5-8) i try to compile and in this
> >> project
> >> i find the LibSerial.jnilib target !
> >> very happy i try to compile this and the compilation ... fail :-(
> >>
> >> this is the error :
> >>
> >> #!/bin/tcsh
> >> cp build/RXTXcomm.jar
> >> ../ForPackageMaker/Install/System/Library/Frameworks/JavaVM.framework/
> >> Versions/1.3.1/Home/lib/ext/
> >> --- Output ---
> >> cp:
> >> ../ForPackageMaker/Install/System/Library/Frameworks/JavaVM.framework/
> >> Versions/1.3.1/Home/lib/ext: No such file or directory
> >> === Exit code: 1 ===
> >> ...failed PhaseScriptExecution
> >> /Users/emilianocarlesi/Desktop/rxtx-1.5-8/MACOSX_IDE/PB/
> >> build/LibSerial.build/RXTXcomm.build/BPTag004-script.sh ...
> >>
> >>
> >> in the build directory i find : the RXTXcomm.jar package, a link to it
> >> and a directory LibSerial.build.
> >> instead for the documentation i need to find here the libSerial.jnilib
> >> file.
> >>
> >>
> >>
> > Hi Emiliano
> >
> > This is probably my mistake. Could you email me the link to where you
> > got
> > rxtx-2.1-7pre16.tar.gz and I'll make sure it is corrected.
> >
> > Zystem was/is a debug library for w32 I threw together to figure out
> > some
> > timing issues. It prints out debug messages with timestamps.
> > Obviously
> > you dont need it.
> >
> > I thought I had caught that in time. The correction is to change the
> > files to not use Zystem.
> > _______________________________________________
> > Rxtx mailing list
> > Rxtx@linuxgrrls.org
> > http://hex.linuxgrrls.org/mailman/listinfo/rxtx
> >
>
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
From emiliano at carlesi.vg Sun Jul 20 01:08:18 2003
From: emiliano at carlesi.vg (emiliano carlesi)
Date: Fri Jul 18 23:08:20 2003
Subject: [Rxtx] rxtx on osx
In-Reply-To:
Message-ID: <80DFE280-BA35-11D7-997E-000A95891300@carlesi.vg>
hi,
i try to download these files from the cvs but i can't access it. the
error is the following :
cvs login: authorization failed: server cvs.milestonesolutions.com
rejected access to /usr/local/cvsroot for user anonymous
thank you very much !!!!!!!!!!
emiliano
On Friday, Jul 18, 2003, at 22:31 Europe/Rome, Trent Jarvi wrote:
>
> Hmm OK.
>
> The Zystem.java file looks fine:
>
> static
> {
> /*
> The rxtxZystem library uses Python code and is not
> included with RXTX. A seperate library will be
> released
> to avoid potential license conflicts.
>
> Trent Jarvi taj@www.linux.org.uk
> */
>
> //System.loadLibrary( "rxtxZystem" );
> mode = SILENT_MODE;
> }
>
> I suspect the following is causing the compiler error
>
> RXTXPort.java: private static Zystem z;
> RXTXPort.java: z = new Zystem( Zystem.SILENT_MODE );
>
> I'm not familiar with the Mac OS X build but I suspect it needs to have
> Zystem.java and UnSupportedLoggerException.java added. These files
> are in
> the src/ directory. Nothing else should be required.
>
> These two files are new in the 2.1-7pre series. Dmitry may have these
> fixed in CVS. You could try checking out the CVS files if you have cvs
> installed:
>
> export
> CVSROOT=:pserver:anonymous@cvs.milestonesolutions.com:/usr/local/
> cvsroot
> cvs login (password is mousy)
> cvs checkout -r commapi-0-0-1 rxtx-devel
>
> It may be that rxtx 2-1.6 was the last release that compiled on Mac OS
> X
> and we need to get some fixes in. Dmitry can be of more help here.
> He should be on the mail list but can also be reached at
> dmarkman@mac.com.
>
> Please let us know how things go so we can fix it for others.
>
> On Sat, 19 Jul 2003, emiliano carlesi wrote:
>
>> hi trent,
>> i found the package on the ftp ftp://jarvi.dsl.frii.com/pub and i
>> have
>> download the latest in time order.
>> which version you think i can download ?
>> thank you very much for the speed in the response !!!!!
>>
>> ciao
>> emiliano
>>
>> On Friday, Jul 18, 2003, at 21:56 Europe/Rome, Trent Jarvi wrote:
>>
>>>
>>>
>>> On Sat, 19 Jul 2003, emiliano carlesi wrote:
>>>
>>>> hi to all !
>>>> this is my first mail in this ml ... so excuse if the question is
>>>> stupid !
>>>>
>>>> i use osx and i need to use my cell phone via bluetooth, with java.
>>>>
>>>> i have create the serial bluetooth link with the phone and from the
>>>> zterm console all work well.
>>>>
>>>> now i need to do the same think from my program.
>>>>
>>>> i write to the apple dev ml and all reply me to use the rxtx.
>>>>
>>>> then i download rxtx and i try to compile it, following the
>>>> instructions. i have the version rxtx-2.1-7pre16.
>>>> i read on the instruction for osx users (using project builder). i
>>>> open the project the i need to compile
>>>> the target libSerial.jnilib, but i have not this target in this
>>>> project, i have only the librxtxSerial.jnilib target.
>>>> then i try to compile this. the compiler end with error because it
>>>> don't find the Zystem package.
>>>> i search on the rxtx site but i don't find nothing about this
>>>> package.
>>>>
>>>> i try then to download the previous version, the 1.5 (i see there
>>>> are
>>>> some pointer to this version in the docs).
>>>> after the download (version 1.5-8) i try to compile and in this
>>>> project
>>>> i find the LibSerial.jnilib target !
>>>> very happy i try to compile this and the compilation ... fail :-(
>>>>
>>>> this is the error :
>>>>
>>>> #!/bin/tcsh
>>>> cp build/RXTXcomm.jar
>>>> ../ForPackageMaker/Install/System/Library/Frameworks/
>>>> JavaVM.framework/
>>>> Versions/1.3.1/Home/lib/ext/
>>>> --- Output ---
>>>> cp:
>>>> ../ForPackageMaker/Install/System/Library/Frameworks/
>>>> JavaVM.framework/
>>>> Versions/1.3.1/Home/lib/ext: No such file or directory
>>>> === Exit code: 1 ===
>>>> ...failed PhaseScriptExecution
>>>> /Users/emilianocarlesi/Desktop/rxtx-1.5-8/MACOSX_IDE/PB/
>>>> build/LibSerial.build/RXTXcomm.build/BPTag004-script.sh ...
>>>>
>>>>
>>>> in the build directory i find : the RXTXcomm.jar package, a link to
>>>> it
>>>> and a directory LibSerial.build.
>>>> instead for the documentation i need to find here the
>>>> libSerial.jnilib
>>>> file.
>>>>
>>>>
>>>>
>>> Hi Emiliano
>>>
>>> This is probably my mistake. Could you email me the link to where
>>> you
>>> got
>>> rxtx-2.1-7pre16.tar.gz and I'll make sure it is corrected.
>>>
>>> Zystem was/is a debug library for w32 I threw together to figure out
>>> some
>>> timing issues. It prints out debug messages with timestamps.
>>> Obviously
>>> you dont need it.
>>>
>>> I thought I had caught that in time. The correction is to change the
>>> files to not use Zystem.
>>> _______________________________________________
>>> Rxtx mailing list
>>> Rxtx@linuxgrrls.org
>>> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>>>
>>
>> _______________________________________________
>> Rxtx mailing list
>> Rxtx@linuxgrrls.org
>> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>>
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
From taj at linuxgrrls.org Sat Jul 19 00:20:40 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jul 18 23:20:42 2003
Subject: [Rxtx] rxtx on osx
In-Reply-To: <80DFE280-BA35-11D7-997E-000A95891300@carlesi.vg>
References: <80DFE280-BA35-11D7-997E-000A95891300@carlesi.vg>
Message-ID:
hmm. Could you try again? I saw an error the first time I tried. Maybe
Ken saw something in the logs and fixed it.
$ export CVSROOT=:pserver:anonymous@cvs.milestonesolutions
$ cvs login
Logging in to :pserver:anonymous@cvs.milestonesolutions.com:2401/usr/local/cvsroot
CVS password: (I typed "mousy" here)
$ cvs checkout -r commapi-0-0-1 rxtx-devel
cvs server: Updating rxtx-devel
U rxtx-devel/.cvsignore
U rxtx-devel/AUTHORS
U rxtx-devel/BeOS
...
On Sun, 20 Jul 2003, emiliano carlesi wrote:
> hi,
> i try to download these files from the cvs but i can't access it. the
> error is the following :
> cvs login: authorization failed: server cvs.milestonesolutions.com
> rejected access to /usr/local/cvsroot for user anonymous
>
> thank you very much !!!!!!!!!!
>
> emiliano
>
>
> On Friday, Jul 18, 2003, at 22:31 Europe/Rome, Trent Jarvi wrote:
>
> >
> > Hmm OK.
> >
> > The Zystem.java file looks fine:
> >
> > static
> > {
> > /*
> > The rxtxZystem library uses Python code and is not
> > included with RXTX. A seperate library will be
> > released
> > to avoid potential license conflicts.
> >
> > Trent Jarvi taj@www.linux.org.uk
> > */
> >
> > //System.loadLibrary( "rxtxZystem" );
> > mode = SILENT_MODE;
> > }
> >
> > I suspect the following is causing the compiler error
> >
> > RXTXPort.java: private static Zystem z;
> > RXTXPort.java: z = new Zystem( Zystem.SILENT_MODE );
> >
> > I'm not familiar with the Mac OS X build but I suspect it needs to have
> > Zystem.java and UnSupportedLoggerException.java added. These files
> > are in
> > the src/ directory. Nothing else should be required.
> >
> > These two files are new in the 2.1-7pre series. Dmitry may have these
> > fixed in CVS. You could try checking out the CVS files if you have cvs
> > installed:
> >
> > export
> > CVSROOT=:pserver:anonymous@cvs.milestonesolutions.com:/usr/local/
> > cvsroot
> > cvs login (password is mousy)
> > cvs checkout -r commapi-0-0-1 rxtx-devel
> >
> > It may be that rxtx 2-1.6 was the last release that compiled on Mac OS
> > X
> > and we need to get some fixes in. Dmitry can be of more help here.
> > He should be on the mail list but can also be reached at
> > dmarkman@mac.com.
> >
> > Please let us know how things go so we can fix it for others.
> >
> > On Sat, 19 Jul 2003, emiliano carlesi wrote:
> >
> >> hi trent,
> >> i found the package on the ftp ftp://jarvi.dsl.frii.com/pub and i
> >> have
> >> download the latest in time order.
> >> which version you think i can download ?
> >> thank you very much for the speed in the response !!!!!
> >>
> >> ciao
> >> emiliano
> >>
> >> On Friday, Jul 18, 2003, at 21:56 Europe/Rome, Trent Jarvi wrote:
> >>
> >>>
> >>>
> >>> On Sat, 19 Jul 2003, emiliano carlesi wrote:
> >>>
> >>>> hi to all !
> >>>> this is my first mail in this ml ... so excuse if the question is
> >>>> stupid !
> >>>>
> >>>> i use osx and i need to use my cell phone via bluetooth, with java.
> >>>>
> >>>> i have create the serial bluetooth link with the phone and from the
> >>>> zterm console all work well.
> >>>>
> >>>> now i need to do the same think from my program.
> >>>>
> >>>> i write to the apple dev ml and all reply me to use the rxtx.
> >>>>
> >>>> then i download rxtx and i try to compile it, following the
> >>>> instructions. i have the version rxtx-2.1-7pre16.
> >>>> i read on the instruction for osx users (using project builder). i
> >>>> open the project the i need to compile
> >>>> the target libSerial.jnilib, but i have not this target in this
> >>>> project, i have only the librxtxSerial.jnilib target.
> >>>> then i try to compile this. the compiler end with error because it
> >>>> don't find the Zystem package.
> >>>> i search on the rxtx site but i don't find nothing about this
> >>>> package.
> >>>>
> >>>> i try then to download the previous version, the 1.5 (i see there
> >>>> are
> >>>> some pointer to this version in the docs).
> >>>> after the download (version 1.5-8) i try to compile and in this
> >>>> project
> >>>> i find the LibSerial.jnilib target !
> >>>> very happy i try to compile this and the compilation ... fail :-(
> >>>>
> >>>> this is the error :
> >>>>
> >>>> #!/bin/tcsh
> >>>> cp build/RXTXcomm.jar
> >>>> ../ForPackageMaker/Install/System/Library/Frameworks/
> >>>> JavaVM.framework/
> >>>> Versions/1.3.1/Home/lib/ext/
> >>>> --- Output ---
> >>>> cp:
> >>>> ../ForPackageMaker/Install/System/Library/Frameworks/
> >>>> JavaVM.framework/
> >>>> Versions/1.3.1/Home/lib/ext: No such file or directory
> >>>> === Exit code: 1 ===
> >>>> ...failed PhaseScriptExecution
> >>>> /Users/emilianocarlesi/Desktop/rxtx-1.5-8/MACOSX_IDE/PB/
> >>>> build/LibSerial.build/RXTXcomm.build/BPTag004-script.sh ...
> >>>>
> >>>>
> >>>> in the build directory i find : the RXTXcomm.jar package, a link to
> >>>> it
> >>>> and a directory LibSerial.build.
> >>>> instead for the documentation i need to find here the
> >>>> libSerial.jnilib
> >>>> file.
> >>>>
> >>>>
> >>>>
> >>> Hi Emiliano
> >>>
> >>> This is probably my mistake. Could you email me the link to where
> >>> you
> >>> got
> >>> rxtx-2.1-7pre16.tar.gz and I'll make sure it is corrected.
> >>>
> >>> Zystem was/is a debug library for w32 I threw together to figure out
> >>> some
> >>> timing issues. It prints out debug messages with timestamps.
> >>> Obviously
> >>> you dont need it.
> >>>
> >>> I thought I had caught that in time. The correction is to change the
> >>> files to not use Zystem.
> >>> _______________________________________________
> >>> Rxtx mailing list
> >>> Rxtx@linuxgrrls.org
> >>> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
> >>>
> >>
> >> _______________________________________________
> >> Rxtx mailing list
> >> Rxtx@linuxgrrls.org
> >> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
> >>
> > _______________________________________________
> > Rxtx mailing list
> > Rxtx@linuxgrrls.org
> > http://hex.linuxgrrls.org/mailman/listinfo/rxtx
> >
>
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
From emiliano at carlesi.vg Sun Jul 20 02:21:11 2003
From: emiliano at carlesi.vg (emiliano carlesi)
Date: Sat Jul 19 00:21:14 2003
Subject: [Rxtx] rxtx on osx
In-Reply-To:
Message-ID:
ok !!!
i have downloaded the rxtx-devel, compiled, and installed. i try a
sample and work !!!!
i have only changed the property of the files Zystem.java and
UnSupportedLoggerException.java
in the project because the reference are fixed with the path of another
machine (absolute path)
thank you very very much !!!!!!!!!!!!!!!
ciao
emiliano
On Saturday, Jul 19, 2003, at 00:20 Europe/Rome, Trent Jarvi wrote:
>
> hmm. Could you try again? I saw an error the first time I tried.
> Maybe
> Ken saw something in the logs and fixed it.
>
> $ export CVSROOT=:pserver:anonymous@cvs.milestonesolutions
> $ cvs login
> Logging in to
> :pserver:anonymous@cvs.milestonesolutions.com:2401/usr/local/cvsroot
> CVS password: (I typed "mousy" here)
> $ cvs checkout -r commapi-0-0-1 rxtx-devel
> cvs server: Updating rxtx-devel
> U rxtx-devel/.cvsignore
> U rxtx-devel/AUTHORS
> U rxtx-devel/BeOS
> ...
>
> On Sun, 20 Jul 2003, emiliano carlesi wrote:
>
>> hi,
>> i try to download these files from the cvs but i can't access it.
>> the
>> error is the following :
>> cvs login: authorization failed: server cvs.milestonesolutions.com
>> rejected access to /usr/local/cvsroot for user anonymous
>>
>> thank you very much !!!!!!!!!!
>>
>> emiliano
>>
>>
>> On Friday, Jul 18, 2003, at 22:31 Europe/Rome, Trent Jarvi wrote:
>>
>>>
>>> Hmm OK.
>>>
>>> The Zystem.java file looks fine:
>>>
>>> static
>>> {
>>> /*
>>> The rxtxZystem library uses Python code and is not
>>> included with RXTX. A seperate library will be
>>> released
>>> to avoid potential license conflicts.
>>>
>>> Trent Jarvi taj@www.linux.org.uk
>>> */
>>>
>>> //System.loadLibrary( "rxtxZystem" );
>>> mode = SILENT_MODE;
>>> }
>>>
>>> I suspect the following is causing the compiler error
>>>
>>> RXTXPort.java: private static Zystem z;
>>> RXTXPort.java: z = new Zystem( Zystem.SILENT_MODE );
>>>
>>> I'm not familiar with the Mac OS X build but I suspect it needs to
>>> have
>>> Zystem.java and UnSupportedLoggerException.java added. These files
>>> are in
>>> the src/ directory. Nothing else should be required.
>>>
>>> These two files are new in the 2.1-7pre series. Dmitry may have
>>> these
>>> fixed in CVS. You could try checking out the CVS files if you have
>>> cvs
>>> installed:
>>>
>>> export
>>> CVSROOT=:pserver:anonymous@cvs.milestonesolutions.com:/usr/local/
>>> cvsroot
>>> cvs login (password is mousy)
>>> cvs checkout -r commapi-0-0-1 rxtx-devel
>>>
>>> It may be that rxtx 2-1.6 was the last release that compiled on Mac
>>> OS
>>> X
>>> and we need to get some fixes in. Dmitry can be of more help here.
>>> He should be on the mail list but can also be reached at
>>> dmarkman@mac.com.
>>>
>>> Please let us know how things go so we can fix it for others.
>>>
>>> On Sat, 19 Jul 2003, emiliano carlesi wrote:
>>>
>>>> hi trent,
>>>> i found the package on the ftp ftp://jarvi.dsl.frii.com/pub and i
>>>> have
>>>> download the latest in time order.
>>>> which version you think i can download ?
>>>> thank you very much for the speed in the response !!!!!
>>>>
>>>> ciao
>>>> emiliano
>>>>
>>>> On Friday, Jul 18, 2003, at 21:56 Europe/Rome, Trent Jarvi wrote:
>>>>
>>>>>
>>>>>
>>>>> On Sat, 19 Jul 2003, emiliano carlesi wrote:
>>>>>
>>>>>> hi to all !
>>>>>> this is my first mail in this ml ... so excuse if the question
>>>>>> is
>>>>>> stupid !
>>>>>>
>>>>>> i use osx and i need to use my cell phone via bluetooth, with
>>>>>> java.
>>>>>>
>>>>>> i have create the serial bluetooth link with the phone and from
>>>>>> the
>>>>>> zterm console all work well.
>>>>>>
>>>>>> now i need to do the same think from my program.
>>>>>>
>>>>>> i write to the apple dev ml and all reply me to use the rxtx.
>>>>>>
>>>>>> then i download rxtx and i try to compile it, following the
>>>>>> instructions. i have the version rxtx-2.1-7pre16.
>>>>>> i read on the instruction for osx users (using project builder).
>>>>>> i
>>>>>> open the project the i need to compile
>>>>>> the target libSerial.jnilib, but i have not this target in this
>>>>>> project, i have only the librxtxSerial.jnilib target.
>>>>>> then i try to compile this. the compiler end with error because it
>>>>>> don't find the Zystem package.
>>>>>> i search on the rxtx site but i don't find nothing about this
>>>>>> package.
>>>>>>
>>>>>> i try then to download the previous version, the 1.5 (i see there
>>>>>> are
>>>>>> some pointer to this version in the docs).
>>>>>> after the download (version 1.5-8) i try to compile and in this
>>>>>> project
>>>>>> i find the LibSerial.jnilib target !
>>>>>> very happy i try to compile this and the compilation ... fail :-(
>>>>>>
>>>>>> this is the error :
>>>>>>
>>>>>> #!/bin/tcsh
>>>>>> cp build/RXTXcomm.jar
>>>>>> ../ForPackageMaker/Install/System/Library/Frameworks/
>>>>>> JavaVM.framework/
>>>>>> Versions/1.3.1/Home/lib/ext/
>>>>>> --- Output ---
>>>>>> cp:
>>>>>> ../ForPackageMaker/Install/System/Library/Frameworks/
>>>>>> JavaVM.framework/
>>>>>> Versions/1.3.1/Home/lib/ext: No such file or directory
>>>>>> === Exit code: 1 ===
>>>>>> ...failed PhaseScriptExecution
>>>>>> /Users/emilianocarlesi/Desktop/rxtx-1.5-8/MACOSX_IDE/
>>>>>> PB/
>>>>>> build/LibSerial.build/RXTXcomm.build/BPTag004-script.sh ...
>>>>>>
>>>>>>
>>>>>> in the build directory i find : the RXTXcomm.jar package, a link
>>>>>> to
>>>>>> it
>>>>>> and a directory LibSerial.build.
>>>>>> instead for the documentation i need to find here the
>>>>>> libSerial.jnilib
>>>>>> file.
>>>>>>
>>>>>>
>>>>>>
>>>>> Hi Emiliano
>>>>>
>>>>> This is probably my mistake. Could you email me the link to where
>>>>> you
>>>>> got
>>>>> rxtx-2.1-7pre16.tar.gz and I'll make sure it is corrected.
>>>>>
>>>>> Zystem was/is a debug library for w32 I threw together to figure
>>>>> out
>>>>> some
>>>>> timing issues. It prints out debug messages with timestamps.
>>>>> Obviously
>>>>> you dont need it.
>>>>>
>>>>> I thought I had caught that in time. The correction is to change
>>>>> the
>>>>> files to not use Zystem.
>>>>> _______________________________________________
>>>>> Rxtx mailing list
>>>>> Rxtx@linuxgrrls.org
>>>>> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>>>>>
>>>>
>>>> _______________________________________________
>>>> Rxtx mailing list
>>>> Rxtx@linuxgrrls.org
>>>> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>>>>
>>> _______________________________________________
>>> Rxtx mailing list
>>> Rxtx@linuxgrrls.org
>>> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>>>
>>
>> _______________________________________________
>> Rxtx mailing list
>> Rxtx@linuxgrrls.org
>> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>>
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
From ricardo.trindade at emation.pt Sun Jul 20 18:27:37 2003
From: ricardo.trindade at emation.pt (Ricardo Trindade)
Date: Sun Jul 20 17:32:36 2003
Subject: [Rxtx] loading .dll or .so from jar
In-Reply-To:
Message-ID:
answers inline
OK. Lets start with Unix which I'm more familiar with than w32. There
are two places these files would be allowed to be extracted:
~/ (the users home directory such as /home/jarvi
/tmp /usr/tmp /usr/local/tmp - one of the tmp directories
RT : why not the current dir ? Or better yet, providing one of the above as
default, but allowing the user to specify the directory ?
When applications do this they usually use a dot directory. If its in a
tmp directory then cleanup is expected to be done afterwards. Lets just
look at the home directory.
/home/jarvi/.rxtx The home direcotry could be shared across
multiple OS's and archs via NFS, SMB, ... so there would have
to be subdirecotries for OS and arch. solaris/i386 for instance.
R: why ? the filename is different, they could all live alongside
Writing to the system/jre/jdk directories would be bad form and users
will typically not have permission anyhow.
r: agreed. bad.
In order for this to automatically happen, The lockfile feature would have
to be disabled. This means a person using this library could open say a
modem being used by another user and interfere with communications.
R: why ?
I'm not sure at all what would be acceptable in a modern NT environment.
Does anyone know what would be done as a user on say w2003? There are
probably simular issues and solutions.
R: I think there are several user classes here. I can imagine a end user
using a desktop app, in that case it should go to the home directory, either
in windows or linux, as he won't have system permission.
We, on the other hand, develop industrial and other unatended systems and
would like to extract the lib to the directory of our choice, perhaps
current, or /tmp.
I really think it should be configurable, but with a sane default (like ~)
for end users.
From nsayer at quack.kfu.com Tue Jul 22 01:30:47 2003
From: nsayer at quack.kfu.com (Nick Sayer)
Date: Wed Jul 23 20:53:09 2003
Subject: [Rxtx] RXTX javax.comm user
Message-ID: <69BB7F1A-BC16-11D7-BD11-000A9575D7CC@kfu.com>
MacXM (sf.net/projects/macxm) got ported to javax.comm this weekend.
The onyl problem is that it appears impossible for System.loadLibrary()
to actually find and load the JNI unless it's installed (as opposed to
simply hitchhiking in with the rest of the classes.
From cdaller at iicm.tu-graz.ac.at Thu Jul 24 12:39:37 2003
From: cdaller at iicm.tu-graz.ac.at (Christof Dallermassl)
Date: Thu Jul 24 10:39:47 2003
Subject: [Rxtx] high cpu load on mac os x
Message-ID: <16159.43353.831354.984153@fiicmpc57.tu-graz.ac.at>
Hi!
My gps applicaiton (http://gpsmap.sf.net) uses the comm api to
communicate with the gps devices. Everything works fine on
linux/windows. But on a mac the process of reading from the serial
device uses lots of cpu cycles.
The BlackBox application (example app from sun's comm.api) uses nearly
half of the cpu power just to read some data from the serial gps
device (well actually, it is a usb-serial converter, could this be the
problem?)
Is there anyone having similar problems?
The system is a
Darwin Kernel System 6.6
As my experience with macintosh computers is nearly non-existent, I
would be very happy if someone could tell me, how to overcome this cpu
hunger.
mit freundlichen Gruessen
Christof
--
---------------------------------------------------------------------------
Christof Dallermassl / Institute for Information Processing and Computer
cdaller@iicm.edu / Supported new Media, Graz University of Technology
---------------------------------------------------------------------------
Dino Developer Community - be a part of it - http://www.dinopolis.org
From taj at linuxgrrls.org Thu Jul 24 17:23:07 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Thu Jul 24 16:23:11 2003
Subject: [Rxtx] high cpu load on mac os x
In-Reply-To: <16159.43353.831354.984153@fiicmpc57.tu-graz.ac.at>
References: <16159.43353.831354.984153@fiicmpc57.tu-graz.ac.at>
Message-ID:
On Thu, 24 Jul 2003, Christof Dallermassl wrote:
> Hi!
>
> My gps applicaiton (http://gpsmap.sf.net) uses the comm api to
> communicate with the gps devices. Everything works fine on
> linux/windows. But on a mac the process of reading from the serial
> device uses lots of cpu cycles.
>
> The BlackBox application (example app from sun's comm.api) uses nearly
> half of the cpu power just to read some data from the serial gps
> device (well actually, it is a usb-serial converter, could this be the
> problem?)
>
> Is there anyone having similar problems?
>
> The system is a
> Darwin Kernel System 6.6
>
> As my experience with macintosh computers is nearly non-existent, I
> would be very happy if someone could tell me, how to overcome this cpu
> hunger.
>
Hi Christopher
I don't have a Mac OS X system but can guess what is going on here and
make some suggestions as to where to look.
There are about three locations where rxtx will run select() in
SerialImp.c waiting for the port to change. The code will be something
like:
ret=SELECT( fd + 1, &rfds, NULL, NULL, psleep );
the two places I can think of right off are the eventLoop() which would
be waiting for the port to change so it can send events and
read_byte_array() which any read() will end up in.
The potential problem is select() does not block while data is available.
One can change the code by adding usleep(1000) - a 1 millisecond sleep -
in suspect areas to keep the loop from spinning.
I can picture CPU use going high if you generally sit with data available
on the port rather than reading it on the DATAAVAILABLE event. You may
try slowing things down with usleep() as mentioned. Without a box to play
with I can just give the hint that the code is most likely spinning around
the select call.
From cdaller at iicm.tu-graz.ac.at Thu Jul 24 18:35:21 2003
From: cdaller at iicm.tu-graz.ac.at (Christof Dallermassl)
Date: Thu Jul 24 16:35:31 2003
Subject: [Rxtx] high cpu load on mac os x
In-Reply-To:
References: <16159.43353.831354.984153@fiicmpc57.tu-graz.ac.at>
Message-ID: <16159.64697.763407.981482@fiicmpc57.tu-graz.ac.at>
Hi Trent,
thanks for your quick response. As I do not have direct access to a
Mac box either, I will forward your description to the user that
reported the problems to me!
Thanks a lot for your answer, I will tell you the results as soon as I
hear of.
Trent> On Thu, 24 Jul 2003, Christof Dallermassl wrote:
>> Hi!
>>
>> My gps applicaiton (http://gpsmap.sf.net) uses the comm api to
>> communicate with the gps devices. Everything works fine on
>> linux/windows. But on a mac the process of reading from the serial
>> device uses lots of cpu cycles.
>>
>> The BlackBox application (example app from sun's comm.api) uses nearly
>> half of the cpu power just to read some data from the serial gps
>> device (well actually, it is a usb-serial converter, could this be the
>> problem?)
>>
>> Is there anyone having similar problems?
>>
>> The system is a
>> Darwin Kernel System 6.6
>>
>> As my experience with macintosh computers is nearly non-existent, I
>> would be very happy if someone could tell me, how to overcome this cpu
>> hunger.
>>
Trent> Hi Christopher
Trent> I don't have a Mac OS X system but can guess what is going on here and
Trent> make some suggestions as to where to look.
Trent> There are about three locations where rxtx will run select() in
Trent> SerialImp.c waiting for the port to change. The code will be something
Trent> like:
Trent> ret=SELECT( fd + 1, &rfds, NULL, NULL, psleep );
Trent> the two places I can think of right off are the eventLoop() which would
Trent> be waiting for the port to change so it can send events and
Trent> read_byte_array() which any read() will end up in.
Trent> The potential problem is select() does not block while data is available.
Trent> One can change the code by adding usleep(1000) - a 1 millisecond sleep -
Trent> in suspect areas to keep the loop from spinning.
Trent> I can picture CPU use going high if you generally sit with data available
Trent> on the port rather than reading it on the DATAAVAILABLE event. You may
Trent> try slowing things down with usleep() as mentioned. Without a box to play
Trent> with I can just give the hint that the code is most likely spinning around
Trent> the select call.
Trent> _______________________________________________
Trent> Rxtx mailing list
Trent> Rxtx@linuxgrrls.org
Trent> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
mit freundlichen Gruessen
Christof
--
---------------------------------------------------------------------------
Christof Dallermassl / Institute for Information Processing and Computer
cdaller@iicm.edu / Supported new Media, Graz University of Technology
---------------------------------------------------------------------------
Dino Developer Community - be a part of it - http://www.dinopolis.org
From taj at parcelfarce.linux.theplanet.co.uk Fri Jul 25 16:17:47 2003
From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk)
Date: Fri Jul 25 15:17:55 2003
Subject: [Rxtx] Re: [adding ports on Linux] WG: Other Problem
In-Reply-To:
Message-ID:
I'm actually sitting in a talk right now about how information will be
shared in the linux kernel to user space that will allow better
enumeration. Right now you will have to add a hack like the following.
--- RXTXCommDriver.java 2003-04-04 12:54:38.000000000 -0700
+++ RXTXCommDriver.java.new 2003-07-25 08:16:05.000000000 -0600
@@ -491,6 +491,7 @@
{
String[] Temp = {
"ttyS", // linux Serial Ports
+ "ttyn", // Daniel's Ports
"ttySA" // for the IPAQs
};
CandidatePortPrefixes=Temp;
On Fri, 25 Jul 2003, Daniel Schmoll / BDC EDV-Consulting wrote:
> HI!
>
> It's me again!
> I have one more problem/question!
>
> Wie have a driver(+Hardware) which emulate com ports (/dev/ttySxx). But
> the new driver (for RedHat 9 and Suse 8.2) didn't suppurt manual
> renaming of the virtual com ports. For example wie have /dev/ttyn10
> instead of /dev/ttyS10. This is a problem with your RXTX classes,
> because your classes can only find the com ports if they have a name
> like ttySxx. Is there any possibility that your classes can find ports
> with other names?
>
> Thanks for your help!
>
> Daniel Schmoll
>
>
--
Trent Jarvi
taj@www.linux.org.uk
From rsumit_2001 at yahoo.co.in Sat Jul 26 09:10:41 2003
From: rsumit_2001 at yahoo.co.in (=?iso-8859-1?q?Sumit?=)
Date: Sat Jul 26 08:10:45 2003
Subject: [Rxtx] Java and Multiport serial port
Message-ID: <20030726071041.8023.qmail@web8005.mail.in.yahoo.com>
Hi
I am trying to establish serial communication via
one of the port of RocketPort multiport serial Port
using Java 1.4 on RH 9.0. I had installed rxtx as a
comm
package(http://wass.homelinux.net/howtos/Comm_How-To.shtml)
For the code
-------------------------------------------------
String commPort ="/dev/ttyR6";
CommPortIdentifier portId =
CommPortIdentifier.getPortIdentifier ( commPort );
--------------------------------------------------
Things work fine if I use commPort ="/dev/ttyS0" but
with "/dev/ttyR6"(which is one of the rocketport port)
it causes exception.
The card is properly configured and I had tested
/dev/ttyR6 is working using od -tx1 /dev/ttyR6. I am
executing all this as root.
Moreover using
Enumeration ports =
CommPortIdentifier.getPortIdentifiers();
and listing the ports list only /dev/ttyS0 and
/dev/lp0 as the available ports.
I am quite new to Java, so I am not sure, but do I
need to use CommPortIdentifier.addPortName to add the
/dev/ttyR0-6 port.
Thanks,
Sumit
=====
The essence of knowledge is, having it, to apply it; not having it, to confess your ignorance.
Confucius BC 551-479, Chinese Ethical Teacher, Philosopher
________________________________________________________________________
Send free SMS using the Yahoo! Messenger. Go to http://in.mobile.yahoo.com/new/pc/
From taj at linuxgrrls.org Sat Jul 26 21:58:34 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Sat Jul 26 20:58:36 2003
Subject: [Rxtx] Java and Multiport serial port
In-Reply-To: <20030726071041.8023.qmail@web8005.mail.in.yahoo.com>
References: <20030726071041.8023.qmail@web8005.mail.in.yahoo.com>
Message-ID:
Here is the deal. We used to enumerate all ports on all multiport cards.
It then became painfully obviously that this was taking too long. At that
point we commented the code that enumerates all known serial ports.
The short term fix is to either add your port of interest or revert to the
slower code that enumerates all ports. 99% of the users dont need more
than /dev/ttyS so we went with that and the arm ports.
A typical patch which was just posted to the list looks like this:
--- RXTXCommDriver.java 2003-04-04 12:54:38.000000000 -0700
+++ RXTXCommDriver.java.new 2003-07-25 08:16:05.000000000 -0600
@@ -491,6 +491,7 @@
{
String[] Temp = {
"ttyS", // linux SerialPorts
+ "ttyX", // My Ports
"ttySA" // for the IPAQs
};
CandidatePortPrefixes=Temp;
A quick and dirty solution is to rename /dev/ttyR* /dev/ttyS*. The device
minor and major numbers are all that is required. THe filename is for
convenience.
There are much better solutions comming in perhaps 2.6 kernels. The
kernel already enumerates the ports and the kernel developers are going to
expose this information to user space so rxtx will be able to quickly
enumerate whatever the kernel knows about.
On Sat, 26 Jul 2003, [iso-8859-1] Sumit wrote:
> Hi
> I am trying to establish serial communication via
> one of the port of RocketPort multiport serial Port
> using Java 1.4 on RH 9.0. I had installed rxtx as a
> comm
> package(http://wass.homelinux.net/howtos/Comm_How-To.shtml)
>
> For the code
> -------------------------------------------------
> String commPort ="/dev/ttyR6";
> CommPortIdentifier portId =
> CommPortIdentifier.getPortIdentifier ( commPort );
> --------------------------------------------------
> Things work fine if I use commPort ="/dev/ttyS0" but
> with "/dev/ttyR6"(which is one of the rocketport port)
> it causes exception.
>
> The card is properly configured and I had tested
> /dev/ttyR6 is working using od -tx1 /dev/ttyR6. I am
> executing all this as root.
>
>
> Moreover using
> Enumeration ports =
> CommPortIdentifier.getPortIdentifiers();
>
> and listing the ports list only /dev/ttyS0 and
> /dev/lp0 as the available ports.
>
> I am quite new to Java, so I am not sure, but do I
> need to use CommPortIdentifier.addPortName to add the
> /dev/ttyR0-6 port.
>
>
> Thanks,
> Sumit
>
>
>
> =====
>
> The essence of knowledge is, having it, to apply it; not having it, to confess your ignorance.
> Confucius BC 551-479, Chinese Ethical Teacher, Philosopher
>
>
>
>
> ________________________________________________________________________
> Send free SMS using the Yahoo! Messenger. Go to http://in.mobile.yahoo.com/new/pc/
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
From rsumit_2001 at yahoo.co.in Sun Jul 27 02:45:57 2003
From: rsumit_2001 at yahoo.co.in (=?iso-8859-1?q?Sumit?=)
Date: Sun Jul 27 01:46:02 2003
Subject: [Rxtx] Java and Multiport serial port
In-Reply-To:
Message-ID: <20030727004557.58908.qmail@web8007.mail.in.yahoo.com>
Hi Trent,
--- Trent Jarvi wrote: >
>
>
> A typical patch which was just posted to the list
> looks like this:
Just two more question:
(a) Is it possible to get the archives of this
mailing list. The link on
http://www.linuxgrrls.org/mailman/listinfo/rxtx/ to
the archives does not work.
(b) From where can I get the source code to make the
change you suggested. I downloaded the package from
http://www.linux.org.uk/~taj/rxtx-bins.1.tar.gz
>
> A quick and dirty solution is to rename /dev/ttyR*
> /dev/ttyS*.
I tried this and it worked.
Thanks however for the help. Atleast I now have one
way of getting things done.
Sumit
=====
The essence of knowledge is, having it, to apply it; not having it, to confess your ignorance.
Confucius BC 551-479, Chinese Ethical Teacher, Philosopher
________________________________________________________________________
Send free SMS using the Yahoo! Messenger. Go to http://in.mobile.yahoo.com/new/pc/
From minyal at nortelnetworks.com Mon Jul 28 11:09:23 2003
From: minyal at nortelnetworks.com (Minya Liang)
Date: Mon Jul 28 16:09:38 2003
Subject: [Rxtx] Java and Multiport serial port
Message-ID: <870397D7C140C84DB081B88396458DAFB525AD@zrc2c000.us.nortel.com>
pass the following property to the VM
-Dgnu.io.rxtx.SerialPorts=/dev/ttyR6:/dev/ttyS0:
this is because the rocketport serial ports are named /dev/ttyR*, and by
default, only the well-known ports (/dev/ttyS* and /dev/ttym* and /dev/lp*,
etc) are scanned.
the "INSTALL" file in the rxtx directory also mentioned about this.
LMY
-----Original Message-----
From: Sumit [mailto:rsumit_2001@yahoo.co.in]
Sent: Saturday, July 26, 2003 2:11 AM
To: rxtx@linuxgrrls.org
Subject: [Rxtx] Java and Multiport serial port
Hi
I am trying to establish serial communication via
one of the port of RocketPort multiport serial Port
using Java 1.4 on RH 9.0. I had installed rxtx as a
comm
package(http://wass.homelinux.net/howtos/Comm_How-To.shtml)
For the code
-------------------------------------------------
String commPort ="/dev/ttyR6";
CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier ( commPort
);
--------------------------------------------------
Things work fine if I use commPort ="/dev/ttyS0" but
with "/dev/ttyR6"(which is one of the rocketport port)
it causes exception.
The card is properly configured and I had tested
/dev/ttyR6 is working using od -tx1 /dev/ttyR6. I am
executing all this as root.
Moreover using
Enumeration ports =
CommPortIdentifier.getPortIdentifiers();
and listing the ports list only /dev/ttyS0 and
/dev/lp0 as the available ports.
I am quite new to Java, so I am not sure, but do I
need to use CommPortIdentifier.addPortName to add the /dev/ttyR0-6 port.
Thanks,
Sumit
=====
The essence of knowledge is, having it, to apply it; not having it, to
confess your ignorance.
Confucius BC 551-479, Chinese Ethical Teacher, Philosopher
________________________________________________________________________
Send free SMS using the Yahoo! Messenger. Go to
http://in.mobile.yahoo.com/new/pc/
_______________________________________________
Rxtx mailing list
Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://hex.linuxgrrls.org/pipermail/rxtx/attachments/20030728/d0ff9e56/attachment.htm
From maryp at magiclamp.org Tue Jul 29 16:04:00 2003
From: maryp at magiclamp.org (Mary Pietrowicz)
Date: Tue Jul 29 21:04:17 2003
Subject: [Rxtx] Fwd: Re: error in latest pre-release
Message-ID: <5.1.1.6.0.20030729143533.00b7ffd0@magiclamp.org>
Hi,
I've run into the error below in running the latest rxtx on Windows (see
below):
no rxtxZystem in java.library.path
I tried to use the dll downloaded from
ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/i386-pc-mingw/
Is there a new build available?
Also, should the jar file be named comm.jar?
Thanks very much,
Mary
>Envelope-to: maryp@magiclamp.org
>Delivered-To: rxtx-outgoing@hex.linuxgrrls.org
>Delivered-To: rxtx@hex.linuxgrrls.org
>Date: Thu, 17 Apr 2003 15:59:56 +0100 (BST)
>From: Trent Jarvi
>To: Ricardo Trindade
>Cc:
>Subject: Re: error in latest pre-release
>Sender: owner-rxtx@hex.linuxgrrls.org
>X-Spam-Status: No, hits=-25.3 required=5.0
> tests=EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT,
> REPLY_WITH_QUOTES,USER_AGENT_PINE
> autolearn=ham version=2.52
>X-Spam-Level:
>X-Spam-Checker-Version: SpamAssassin 2.52 (1.174.2.8-2003-03-24-exp)
>
>
>
>Hi Ricardo
>
>That sounds like my mistake. If you could send me the link to the file
>you downloaded, I can fix it. Zystem is a debugging library used on
>w32. The file (jar) you downlowaded needs to be compiled without Zystem.
>
>Zystem is not distributed with rxtx. Its some python code hacked to
>generate timing information as a JNI lib. I'm not sure how the licensing
>would work with it so I just pull it out.
>
>On Thu, 17 Apr 2003, Ricardo Trindade wrote:
>
> > Hi,
> >
> > I get the following error when trying to run the latest rxtx :
> >
> > no rxtxZystem in java.library.path
> >
> > I have the .dll in the right place, and if I remove it, I get the
> expected
> > :
> >
> > no rxtxSerial in java.library.path thrown while loading
> > gnu.io.RXTXCommDriver
> >
> > If find it strange that the jar has changed it's name from
> RXTXcomm.jar to
> > comm.jar. Is something wrong here ?
> >
> > I'm using jdk1.3.1_06
> >
> > any ideas ?
> >
> > thanks
> > Ricardo
> >
From d.escuro at weserv.com.ph Wed Jul 30 10:37:05 2003
From: d.escuro at weserv.com.ph (Dohnald Escuro)
Date: Wed Jul 30 10:37:07 2003
Subject: [Rxtx] infinite OUTPUT_BUFFER_EMPTY serial event
Message-ID:
Hi! I'm Vicel Borlongan from the Philippines. I've been using RXTX Comm API for
our POS project.
Just want to ask for your help regarding its implementation. I've been having
problem receiving input streams
from rxtx 2.1-6 because it seems to generates infinite OUTPUT_BUFFER_EMPTY
serial event.
Is there a way I could make the input stream behavior much like that of JAVA
Comm API where the
OUTPUT_BUFFER_EMPTY serial event stops at a certain point.
Hope you can help us on this.
Thank you.
Vicel Borlongan
-------------- next part --------------
------------------------------------------------------------------------
FPI Gateway Scanner scanned email-body and no virus found
------------------------------------------------------------------------
From maryp at magiclamp.org Wed Jul 30 14:16:49 2003
From: maryp at magiclamp.org (Mary Pietrowicz)
Date: Wed Jul 30 19:17:07 2003
Subject: [Rxtx] Application working under linux and OSX, problems with same
code on Windows
Message-ID: <5.1.1.6.0.20030730093658.00b3e3c8@magiclamp.org>
Hi,
I've been using rxtx 2.1.x to talk to RFID readers in Linux and OSX
environments. I would like to use rxtx 2.1 with my application (same code)
on Windows. I have also run the my app successfully on Windows with Sun's
comm package, but I would like to keep a common code base and use
rxtx. Here is what I have tried sofar to get things running with rxtx on
windows (below). Any help would be greatly appreciated!
Attempted to build 2.1.6 with lcc (one of the build options in the
installation instructions). Could not get a successful compile.
When I noticed that all of the Windows prereleases had been built with
mingw, I switched to those build tools and installed MinGW@-3.0.0-rc3,
gcj-3.2-20021210-1, MSYS-1.0.10-rc-1.
I'm using jdk1.4.1-b21. No comm.jar in lib\ext. :-)
I'm running Windows XP.
I attempted to build rxtx 2.1.6 from within cygwin, since that is what I
already had in my Windows environment. Makefile is attached. In my first
build attempt (ran make per instructions), I got
../src/SerialImp.c:22:20:config.h: No such file or directory. Then, I did
a "make include/config.h" to produce the config.h file.
At the next attempt, the libgcj-config file could not be found. I copied
d:\mingw
lib\gcc-lib\mingw32\3.2\include\gcj\libgcj-config.h to d:\mingw\include\gcj
where it could be found. I ran "make", no errors. Then I did a "make
install". The build process asked to copy *.c and *.java files back into
.../build/gnu/io, compiled everything again, overwrote Serial.def again,
and then copied out RXTXcomm.jar and rxtxSerial.dll. No errors. I rebuilt
my java source, and ran it from the DOS shell. I got the following runtime
error:
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x6D401C0E
Function=JVM_RegisterUnsafeMethods+0x18C
Library=d:\j2sdk1.4.1\jre\bin\client\jvm.dll
Current Java thread:
at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method)
at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:56)
at java.lang.Class.forName0
at Java.lang.Class.forName(Class.java:140)
at gnu.io.CommPortIdentifier(CommPortIdentifier.java:67)
.... Stack trace calls from my code from here
Error file hs_err_pid2244.log is attached.
I thought I might have better luck building from the MSYS shell using the
same Makefile. So, I cleaned everything out, and did a "make
include/config.h", a "make", and a "make install". I got a build - no
errors - rebuilt my code again from scratch, and ran it from the DOS
shell. I got a related runtime error:
java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading
gnu.io.RXTXCommDriver
I also tried the prebuilt prerelease.
(From ~/jarvi/rxtx//download/prerelease/2.1)
I installed RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll)
I tried to run it, and when it complained about missing Zsystem libraries,
I snagged the Zsystem-0.0-1.tar.gz and dropped Zsystem.jar into
jre\lib\ext. I rebuilt all my stuff, and tried to run again.
At run time, it confirmed the version:
Native lib Version = RXTX-2.1-7pre12
Java lib Version = RXTX-2.1-7pre12
At the point where I wrote to the serial port, and listened for a response
from the device, I got:
Error reading from the serial port: No error in readArray
java.io.IOException: No error in readArray
at gnu.io.RXTXPort.readArray(Native Method)
at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1296)
at gnu.io.BufferedInputStream.fill(BufferedInputStream.java:183)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:222)
at java.io.BufferedInputStream.read(BufferedInputStream.java:277)
at java.io.FilterInputStream.read(FilterInputStream.java:90)
... Rest is stack trace of my code
Does anyone have any thoughts?
Thanks!
Mary
-------------- next part --------------
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x6D401C0E
Function=JVM_RegisterUnsafeMethods+0x18C
Library=d:\j2sdk1.4.1\jre\bin\client\jvm.dll
Current Java thread:
at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method)
at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:56)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:140)
at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67)
at edu.iu.pervasivetechnologylabs.services.rfid.RfidListener.initialize(RfidListener.java:46)
at edu.iu.pervasivetechnologylabs.services.rfid.RfidListener.(RfidListener.java:37)
at edu.iu.pervasivetechnologylabs.services.rfid.RfidListener.main(RfidListener.java:179)
Dynamic libraries:
0x00400000 - 0x00406000 d:\j2sdk1.4.1\bin\java.exe
0x77F50000 - 0x77FF9000 C:\WINDOWS\System32\ntdll.dll
0x77E60000 - 0x77F45000 C:\WINDOWS\system32\kernel32.dll
0x77DD0000 - 0x77E5B000 C:\WINDOWS\system32\ADVAPI32.dll
0x78000000 - 0x7806E000 C:\WINDOWS\system32\RPCRT4.dll
0x77C10000 - 0x77C63000 C:\WINDOWS\system32\MSVCRT.dll
0x6D330000 - 0x6D45C000 d:\j2sdk1.4.1\jre\bin\client\jvm.dll
0x77D40000 - 0x77DC6000 C:\WINDOWS\system32\USER32.dll
0x77C70000 - 0x77CB0000 C:\WINDOWS\system32\GDI32.dll
0x76B40000 - 0x76B6C000 C:\WINDOWS\System32\WINMM.dll
0x76390000 - 0x763AA000 C:\WINDOWS\System32\IMM32.DLL
0x629C0000 - 0x629C8000 C:\WINDOWS\System32\LPK.DLL
0x72FA0000 - 0x72FFA000 C:\WINDOWS\System32\USP10.dll
0x6D1D0000 - 0x6D1D7000 d:\j2sdk1.4.1\jre\bin\hpi.dll
0x6D300000 - 0x6D30D000 d:\j2sdk1.4.1\jre\bin\verify.dll
0x6D210000 - 0x6D229000 d:\j2sdk1.4.1\jre\bin\java.dll
0x6D320000 - 0x6D32D000 d:\j2sdk1.4.1\jre\bin\zip.dll
0x003F0000 - 0x00400000 D:\j2sdk1.4.1\jre\bin\rxtxSerial.dll
0x73D90000 - 0x73DB7000 C:\WINDOWS\System32\crtdll.dll
0x76C90000 - 0x76CB2000 C:\WINDOWS\system32\imagehlp.dll
0x6D510000 - 0x6D58C000 C:\WINDOWS\system32\DBGHELP.dll
0x77C00000 - 0x77C07000 C:\WINDOWS\system32\VERSION.dll
0x76BF0000 - 0x76BFB000 C:\WINDOWS\System32\PSAPI.DLL
Local Time = Wed Jul 30 10:21:35 2003
Elapsed Time = 0
#
# HotSpot Virtual Machine Error : EXCEPTION_ACCESS_VIOLATION
# Error ID : 4F530E43505002E6
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Java VM: Java HotSpot(TM) Client VM (1.4.1-b21 mixed mode)
#
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: application/octet-stream
Size: 6353 bytes
Desc: not available
Url : http://hex.linuxgrrls.org/pipermail/rxtx/attachments/20030730/a0058903/Makefile.obj
From phil at webwaste.de Tue Jul 1 11:48:28 2003
From: phil at webwaste.de (Philipp Hofmann)
Date: Fri Jun 3 17:45:36 2005
Subject: [Rxtx] linux, rxtx and serial ports
Message-ID: <20030701104828.GH25468@d508a.hadiko.de>
Hi,
this ist my test program. Shouldn't it print a list of valid ports? I
am especialy interested in serial ports.
$ cat Test.java
import gnu.io.*;
import java.util.Enumeration;
public class Test {
public static void main(String[] arg) {
System.out.println("start");
Enumeration e = CommPortIdentifier.getPortIdentifiers();
while(e.hasMoreElements()) {
System.out.println(((CommPortIdentifier)e.nextElement()).getName());
}
System.out.println("stop");
}
}
I am using rxtx 1.5 from the binary package. Run as user it prints the
following error message:
$ java Test
start
0 1075106032
RXTX WARNING: This library requires the user running applications to be in
group uucp. Please consult the INSTALL documentation. More information is
avaiable under the topic 'How can I use Lock Files with rxtx?'
check_lock_status: No permission to create lock file.
please see: How can I use Lock Files with rxtx? in INSTALL
Therefore I added my user to group uucp.
$ groups
users tty uucp dialout
But that didn't seem to change anything. That's why I additionally
changed the permissions of the devices I would like it to find to 666.
$ ls -la /dev/ttyS*
crw-rw-rw- 1 root dialout 4, 64 Apr 15 2001 /dev/ttyS0
crw-rw-rw- 1 root dialout 4, 65 Apr 15 2001 /dev/ttyS1
crw-rw-rw- 1 root dialout 4, 66 Apr 15 2001 /dev/ttyS2
crw-rw-rw- 1 root dialout 4, 67 Apr 15 2001 /dev/ttyS3
But that didn't change anything, either. Anyway, run as root it
somehow worked. But unfortunately, not exactly how I expected it to:
# java Test
start
stop
So I read in INSTALL of rxtx the following:
rxtx tries to detect ports on by scanning /dev for files matching any
of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on.
Any ones that exist, are supposed to be good for the current operating
system, and that can be read and written are offered back from
CommPortIdentifier.getPortIdentifiers(), and only these can be used as
ports.
And for I also tried to set the ports to use manually like this ...
# java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyS1 Test
start
stop
I began to doubt that my serial ports a well supported by my current
configuration. The following is the result of my investigations
concerning this problem. I hope that someone might be able to read the
key point out of it.
*Standard/generic (8250/16550 and compatible UARTs) serial support* is
built into the kernel (not as a module).
$ uname -a
Linux zoe 2.4.19 #2 Tue Oct 15 00:35:25 CEST 2002 i686 unknown
$ grep -v "#" /etc/serial.conf
/dev/ttyS0 uart 16550A port 0x03f8 irq 4 baud_base 115200 spd_normal skip_test
/dev/ttyS1 uart 16550A port 0x02f8 irq 3 baud_base 115200 spd_normal skip_test
$ grep serial /proc/ioports
02f8-02ff : serial(set)
03f8-03ff : serial(set)
$ cat /proc/tty/driver/serial
serinfo:1.0 driver:5.05c revision:2001-07-08
0: uart:16550A port:3F8 irq:4 tx:0 rx:0 CTS|DSR|CD|RI
1: uart:16550A port:2F8 irq:3 tx:0 rx:0 CTS|DSR|CD|RI
$ setserial -g /dev/ttyS*
/dev/ttyS0: No such device
/dev/ttyS1: No such device
/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
$ sudo setserial -g /dev/ttyS*
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3
/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
$ statserial
statserial: can't open device `/dev/ttyS1': No such device
$ sudo statserial
statserial: TIOCMGET failed: Input/output error
It is espacialy the last command I worry about. Because i found
similar error messages running an strace on the root java process of
Test.class.
Any help greatly appreciated
Philipp Hofmann
From taj at linuxgrrls.org Tue Jul 1 12:14:13 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 17:45:36 2005
Subject: [Rxtx] linux, rxtx and serial ports
In-Reply-To: <20030701104828.GH25468@d508a.hadiko.de>
References: <20030701104828.GH25468@d508a.hadiko.de>
Message-ID:
On Tue, 1 Jul 2003, Philipp Hofmann wrote:
> Hi,
>
> this ist my test program. Shouldn't it print a list of valid ports? I
> am especialy interested in serial ports.
>
>
> $ cat Test.java
> import gnu.io.*;
> import java.util.Enumeration;
>
> public class Test {
> public static void main(String[] arg) {
> System.out.println("start");
> Enumeration e = CommPortIdentifier.getPortIdentifiers();
> while(e.hasMoreElements()) {
> System.out.println(((CommPortIdentifier)e.nextElement()).getName());
> }
> System.out.println("stop");
> }
> }
>
>
> I am using rxtx 1.5 from the binary package. Run as user it prints the
> following error message:
>
>
> $ java Test
> start
> 0 1075106032
>
>
>
> RXTX WARNING: This library requires the user running applications to be in
> group uucp. Please consult the INSTALL documentation. More information is
> avaiable under the topic 'How can I use Lock Files with rxtx?'
> check_lock_status: No permission to create lock file.
>
> please see: How can I use Lock Files with rxtx? in INSTALL
>
>
> Therefore I added my user to group uucp.
>
>
> $ groups
> users tty uucp dialout
>
>
> But that didn't seem to change anything. That's why I additionally
> changed the permissions of the devices I would like it to find to 666.
>
>
> $ ls -la /dev/ttyS*
> crw-rw-rw- 1 root dialout 4, 64 Apr 15 2001 /dev/ttyS0
> crw-rw-rw- 1 root dialout 4, 65 Apr 15 2001 /dev/ttyS1
> crw-rw-rw- 1 root dialout 4, 66 Apr 15 2001 /dev/ttyS2
> crw-rw-rw- 1 root dialout 4, 67 Apr 15 2001 /dev/ttyS3
>
>
> But that didn't change anything, either. Anyway, run as root it
> somehow worked. But unfortunately, not exactly how I expected it to:
>
> # java Test
> start
> stop
>
> So I read in INSTALL of rxtx the following:
>
>
> rxtx tries to detect ports on by scanning /dev for files matching any
> of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on.
> Any ones that exist, are supposed to be good for the current operating
> system, and that can be read and written are offered back from
> CommPortIdentifier.getPortIdentifiers(), and only these can be used as
> ports.
>
>
> And for I also tried to set the ports to use manually like this ...
>
> # java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyS1 Test
> start
> stop
>
> I began to doubt that my serial ports a well supported by my current
> configuration. The following is the result of my investigations
> concerning this problem. I hope that someone might be able to read the
> key point out of it.
>
> *Standard/generic (8250/16550 and compatible UARTs) serial support* is
> built into the kernel (not as a module).
>
>
> $ uname -a
> Linux zoe 2.4.19 #2 Tue Oct 15 00:35:25 CEST 2002 i686 unknown
>
> $ grep -v "#" /etc/serial.conf
> /dev/ttyS0 uart 16550A port 0x03f8 irq 4 baud_base 115200 spd_normal skip_test
> /dev/ttyS1 uart 16550A port 0x02f8 irq 3 baud_base 115200 spd_normal skip_test
>
> $ grep serial /proc/ioports
> 02f8-02ff : serial(set)
> 03f8-03ff : serial(set)
>
> $ cat /proc/tty/driver/serial
> serinfo:1.0 driver:5.05c revision:2001-07-08
> 0: uart:16550A port:3F8 irq:4 tx:0 rx:0 CTS|DSR|CD|RI
> 1: uart:16550A port:2F8 irq:3 tx:0 rx:0 CTS|DSR|CD|RI
>
> $ setserial -g /dev/ttyS*
> /dev/ttyS0: No such device
> /dev/ttyS1: No such device
> /dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
> /dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
>
> $ sudo setserial -g /dev/ttyS*
> /dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
> /dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3
> /dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
> /dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
>
> $ statserial
> statserial: can't open device `/dev/ttyS1': No such device
>
> $ sudo statserial
> statserial: TIOCMGET failed: Input/output error
>
>
> It is espacialy the last command I worry about. Because i found
> similar error messages running an strace on the root java process of
> Test.class.
>
Hi Philipp
The setup looks like one I'm not familiar with. Here is the Test.java
output on my machine using rxtx 2.1-7pre16 (It's like rxtx 1.5 and can be
found on rxtx.org).
java Test
start
Devel Library
=========================================
Native lib Version = RXTX-2.1-7pre16
Java lib Version = RXTX-2.1-7pre16
/dev/ttyS0
/dev/ttyS1
/dev/lp0
stop
That TIOCMGET error is disturbing. Just to help simplify... If you run
as root, the lockfiles should work. The lock files should be going into
/var/lock. Sometimes the group ownership of that directory is not uucp.
For instance, some redhats use group lock. I see you have a group dialup
in there too.
You may want to step back and see if you can get minicom/kermit/tip/
something simple for serial comm working.
Could this be user mode linux perhaps? I see the TIOCMGET became
unsupported in UML around 2.4.18
http://user-mode-linux.sourceforge.net/changelog-linux-2.4.18-15.bz2.html
I'm not sure what to think. Have you checked your BIOS and made sure
there are no IRQ conflicts? Let us know if you can open the port with any
software as mentioned.
It sounds like something is wrong underneath rxtx BIOS, IRQ, kernel.
From phil at webwaste.de Tue Jul 1 13:13:33 2003
From: phil at webwaste.de (Philipp Hofmann)
Date: Fri Jun 3 17:45:36 2005
Subject: [Rxtx] linux, rxtx and serial ports
In-Reply-To:
References: <20030701104828.GH25468@d508a.hadiko.de>
Message-ID: <20030701121333.GI25468@d508a.hadiko.de>
On Tue, Jul 01, 2003 at 12:14:13PM +0100, Trent Jarvi wrote:
>
> Hi Philipp
>
> The setup looks like one I'm not familiar with. Here is the Test.java
> output on my machine using rxtx 2.1-7pre16 (It's like rxtx 1.5 and can be
> found on rxtx.org).
>
> java Test
> start
> Devel Library
> =========================================
> Native lib Version = RXTX-2.1-7pre16
> Java lib Version = RXTX-2.1-7pre16
> /dev/ttyS0
> /dev/ttyS1
> /dev/lp0
> stop
*sigh*
> That TIOCMGET error is disturbing. Just to help simplify... If you run
> as root, the lockfiles should work. The lock files should be going into
> /var/lock. Sometimes the group ownership of that directory is not uucp.
> For instance, some redhats use group lock. I see you have a group dialup
> in there too.
No, on my machine its like this:
[phil@zoe] ~ > ls -ld /var/lock
drwxrwxrwt 4 root root 4096 Jul 1 12:35 /var/lock
For the t among the permissions means something like everybody is
allowed to create a files, this should work right?
> You may want to step back and see if you can get minicom/kermit/tip/
> something simple for serial comm working.
Yes, i tried to run minicom, but didn't succeed to change settings to
any other device then /dev/ttyS3 (even as root). I'll spend some more
time on it.
> Could this be user mode linux perhaps? I see the TIOCMGET became
> unsupported in UML around 2.4.18
>
> http://user-mode-linux.sourceforge.net/changelog-linux-2.4.18-15.bz2.html
No it's just a debian linux (woody).
> I'm not sure what to think. Have you checked your BIOS and made sure
> there are no IRQ conflicts? Let us know if you can open the port with any
> software as mentioned.
I'll do.
thanks phil
From taj at linuxgrrls.org Tue Jul 1 13:37:15 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 17:45:36 2005
Subject: [Rxtx] linux, rxtx and serial ports
In-Reply-To: <20030701121333.GI25468@d508a.hadiko.de>
References: <20030701104828.GH25468@d508a.hadiko.de>
<20030701121333.GI25468@d508a.hadiko.de>
Message-ID:
>
> [phil@zoe] ~ > ls -ld /var/lock
> drwxrwxrwt 4 root root 4096 Jul 1 12:35 /var/lock
>
> For the t among the permissions means something like everybody is
> allowed to create a files, this should work right?
>
This may cause a problem if root creates a lockfile, the program crashes
or exits abnormally, and a user tries to use the port afterwards:
STICKY DIRECTORIES
When the sticky bit is set on a directory, files in that directory may
be unlinked or renamed only by root or their owner. Without the sticky
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bit, anyone able to write to the directory can delete or rename files.
The sticky bit is commonly found on directories, such as /tmp, that are
world-writable.
Otherwise it should work properly. (t is sticky) RXTX should give a
clear message about not being able to create a lock file if that happens.
From phil at webwaste.de Sun Jul 6 15:55:49 2003
From: phil at webwaste.de (Philipp Hofmann)
Date: Fri Jun 3 17:45:37 2005
Subject: [Rxtx] first problem solved, more to go
Message-ID: <20030706145549.GN24717@d508a.hadiko.de>
hello again,
ok, on one side it's distressing, but one the other side i'm pretty
happy that it was this easy to solve this problem.
i finally checked the bios settings, and - you quessed it already -
the com ports were simply disabeld. shame on me. but thanks for the
hint.
but now that i finished writing the application i get a strange error
message after moving the whole stuff to another machine.
*snip*
java.lang.ClassCastException thrown while loading gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.UnsatisfiedLinkError: Native
Library /home/phil/java/libSerial-1.5.8.so already loaded in another
classloader
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1437)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1397)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:832)
at gnu.io.CommPortIdentifier.(CommPortIdentifier.java)
at TelefonServer.doSerialPhoneStuff(TelefonServer.java:204)
at TelefonServer.(TelefonServer.java:96)
at TelefonServer.main(TelefonServer.java:30)
*snip*
i am sure, there is no other process of this software running, for ps
looks like this (right after rebooting the machine).
*snip*
medea:/home/phil/java# ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.1 0.5 1272 72 ? S 16:02 0:06 init [2]
root 2 0.0 0.0 0 0 ? SW 16:02 0:01 [kflushd]
root 3 0.0 0.0 0 0 ? SW 16:02 0:00 [kupdate]
root 4 0.0 0.0 0 0 ? SW 16:02 0:03 [kswapd]
root 5 0.0 0.0 0 0 ? SW 16:02 0:00 [keventd]
root 163 0.0 0.6 1344 88 ? S 16:03 0:00 /sbin/syslogd
root 166 0.0 0.0 1744 0 ? SW 16:03 0:00 [klogd]
root 174 0.0 0.0 1292 0 ? SW 16:03 0:00 [inetd]
root 181 0.0 0.0 2792 0 ? SW 16:03 0:00 [sshd]
daemon 184 0.0 0.0 1388 0 ? SW 16:03 0:00 [atd]
root 187 0.0 1.1 1652 160 ? S 16:03 0:00 /usr/sbin/cron
root 190 0.0 0.0 1256 0 tty1 SW 16:03 0:00 [getty]
root 191 0.0 0.0 1256 0 tty2 SW 16:03 0:00 [getty]
root 192 0.0 0.0 1256 0 tty3 SW 16:03 0:00 [getty]
root 193 0.0 0.0 1256 0 tty4 SW 16:03 0:00 [getty]
root 194 0.0 0.0 1256 0 tty5 SW 16:03 0:00 [getty]
root 195 0.0 0.0 1256 0 tty6 SW 16:03 0:00 [getty]
root 206 0.0 0.0 5624 0 ? SW 16:06 0:00 [sshd]
phil 208 0.0 1.9 5636 264 ? D 16:06 0:02 /usr/sbin/sshd
phil 209 0.0 0.0 2220 0 pts/0 SW 16:06 0:00 [bash]
root 488 0.1 3.2 2212 448 pts/0 S 17:21 0:00 -su
root 570 37.0 9.0 3164 1240 pts/0 R 17:27 0:00 ps aux
*snip*
it has mostly the same configuration (same dist (debian woody), same
j2sdk, same rxtx version).
no clue.
grettings phil
From taj at linuxgrrls.org Sun Jul 6 16:11:48 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 17:45:37 2005
Subject: [Rxtx] first problem solved, more to go
In-Reply-To: <20030706145549.GN24717@d508a.hadiko.de>
References: <20030706145549.GN24717@d508a.hadiko.de>
Message-ID:
On Sun, 6 Jul 2003, Philipp Hofmann wrote:
> hello again,
>
> ok, on one side it's distressing, but one the other side i'm pretty
> happy that it was this easy to solve this problem.
>
> i finally checked the bios settings, and - you quessed it already -
> the com ports were simply disabeld. shame on me. but thanks for the
> hint.
>
> but now that i finished writing the application i get a strange error
> message after moving the whole stuff to another machine.
>
> *snip*
>
> java.lang.ClassCastException thrown while loading gnu.io.RXTXCommDriver
> Exception in thread "main" java.lang.UnsatisfiedLinkError: Native
> Library /home/phil/java/libSerial-1.5.8.so already loaded in another
> classloader
> at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1437)
> at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1397)
> at java.lang.Runtime.loadLibrary0(Runtime.java:788)
> at java.lang.System.loadLibrary(System.java:832)
> at gnu.io.CommPortIdentifier.(CommPortIdentifier.java)
> at TelefonServer.doSerialPhoneStuff(TelefonServer.java:204)
> at TelefonServer.(TelefonServer.java:96)
> at TelefonServer.main(TelefonServer.java:30)
>
> *snip*
>
> i am sure, there is no other process of this software running, for ps
> looks like this (right after rebooting the machine).
>
> *snip*
>
> medea:/home/phil/java# ps aux
> USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
> root 1 0.1 0.5 1272 72 ? S 16:02 0:06 init [2]
> root 2 0.0 0.0 0 0 ? SW 16:02 0:01 [kflushd]
> root 3 0.0 0.0 0 0 ? SW 16:02 0:00 [kupdate]
> root 4 0.0 0.0 0 0 ? SW 16:02 0:03 [kswapd]
> root 5 0.0 0.0 0 0 ? SW 16:02 0:00 [keventd]
> root 163 0.0 0.6 1344 88 ? S 16:03 0:00 /sbin/syslogd
> root 166 0.0 0.0 1744 0 ? SW 16:03 0:00 [klogd]
> root 174 0.0 0.0 1292 0 ? SW 16:03 0:00 [inetd]
> root 181 0.0 0.0 2792 0 ? SW 16:03 0:00 [sshd]
> daemon 184 0.0 0.0 1388 0 ? SW 16:03 0:00 [atd]
> root 187 0.0 1.1 1652 160 ? S 16:03 0:00 /usr/sbin/cron
> root 190 0.0 0.0 1256 0 tty1 SW 16:03 0:00 [getty]
> root 191 0.0 0.0 1256 0 tty2 SW 16:03 0:00 [getty]
> root 192 0.0 0.0 1256 0 tty3 SW 16:03 0:00 [getty]
> root 193 0.0 0.0 1256 0 tty4 SW 16:03 0:00 [getty]
> root 194 0.0 0.0 1256 0 tty5 SW 16:03 0:00 [getty]
> root 195 0.0 0.0 1256 0 tty6 SW 16:03 0:00 [getty]
> root 206 0.0 0.0 5624 0 ? SW 16:06 0:00 [sshd]
> phil 208 0.0 1.9 5636 264 ? D 16:06 0:02 /usr/sbin/sshd
> phil 209 0.0 0.0 2220 0 pts/0 SW 16:06 0:00 [bash]
> root 488 0.1 3.2 2212 448 pts/0 S 17:21 0:00 -su
> root 570 37.0 9.0 3164 1240 pts/0 R 17:27 0:00 ps aux
>
> *snip*
>
> it has mostly the same configuration (same dist (debian woody), same
> j2sdk, same rxtx version).
>
> no clue.
>
Hi Phil
You really want to use rxtx 2.1-7pre16 which is the functional equiv of
rxtx 1.5 with bug fixes but this bug has not shown up before. I suspect
you accidently duplicated some code. Possibly in RXTXCommDriver.java
I would look for two instances of the following in one of your java files.
System.loadLibrary( "Serial" );
That said, This bug has not shown up before so you may want to just start
with a clean tarball of rxtx and reinstall.
From phil at hadiko.de Sun Jul 6 18:21:09 2003
From: phil at hadiko.de (Philipp Hofmann)
Date: Fri Jun 3 17:45:37 2005
Subject: [Rxtx] first problem solved, more to go
In-Reply-To:
References: <20030706145549.GN24717@d508a.hadiko.de>
Message-ID: <20030706172109.GO24717@d508a.hadiko.de>
hey,
you convinced me. i got lib-rxtx-java_2.1.6-1_i386.deb and installed it.
but ...
even my previously used test-app reports the same error:
*snip*
Native Library /usr/lib/librxtxSerial-2.1-6.so already loaded in
another classloader
*snip*
after some straceing it seems to me that firstly it looks for a
libSerial.so if it doesn't find one it aborts although it loads the
librxtxSerial afterwards. and if it finds one because of a symlink i
provide it aborts because it tries to load the same lib twice.
i didn't do any changes to the rxtx-code and i'm not using
System.loadLibrary("...");
$ grep loadLib RXTXCommDriver.java
System.loadLibrary( "rxtxSerial" );
which means it should only be looking for *librxtxSerial.so*. where
does the *libSerial.so* request come from? it is defenatly not part of
my test-app. :)
so far
g phil
On Sun, Jul 06, 2003 at 04:11:48PM +0100, Trent Jarvi wrote:
> Hi Phil
>
>
> You really want to use rxtx 2.1-7pre16 which is the functional equiv of
> rxtx 1.5 with bug fixes but this bug has not shown up before. I suspect
> you accidently duplicated some code. Possibly in RXTXCommDriver.java
>
> I would look for two instances of the following in one of your java files.
>
> System.loadLibrary( "Serial" );
>
> That said, This bug has not shown up before so you may want to just start
> with a clean tarball of rxtx and reinstall.
>
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
From taj at linuxgrrls.org Sun Jul 6 18:33:06 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 17:45:37 2005
Subject: [Rxtx] first problem solved, more to go
In-Reply-To: <20030706172109.GO24717@d508a.hadiko.de>
References: <20030706145549.GN24717@d508a.hadiko.de>
<20030706172109.GO24717@d508a.hadiko.de>
Message-ID:
On Sun, 6 Jul 2003, Philipp Hofmann wrote:
> hey,
>
> you convinced me. i got lib-rxtx-java_2.1.6-1_i386.deb and installed it.
>
> but ...
>
> even my previously used test-app reports the same error:
>
> *snip*
> Native Library /usr/lib/librxtxSerial-2.1-6.so already loaded in
> another classloader
> *snip*
>
> after some straceing it seems to me that firstly it looks for a
> libSerial.so if it doesn't find one it aborts although it loads the
> librxtxSerial afterwards. and if it finds one because of a symlink i
> provide it aborts because it tries to load the same lib twice.
>
> i didn't do any changes to the rxtx-code and i'm not using
> System.loadLibrary("...");
>
> $ grep loadLib RXTXCommDriver.java
> System.loadLibrary( "rxtxSerial" );
>
> which means it should only be looking for *librxtxSerial.so*. where
> does the *libSerial.so* request come from? it is defenatly not part of
> my test-app. :)
>
> so far
>
> g phil
>
>
Hi Phil
I don't think libSerial.so should be loaded at all in rxtx 2.1. Perhaps
there is something in the Java distribution you are using?
If you have a sample to try I can try reproducing the problem. There is
something unusual in your setup or code. I looked at the .deb a couple
months ago and its not making code changes. It should be fine.
From phil at webwaste.de Sun Jul 6 18:59:19 2003
From: phil at webwaste.de (Philipp Hofmann)
Date: Fri Jun 3 17:45:37 2005
Subject: [Rxtx] first problem solved, more to go
In-Reply-To:
References: <20030706145549.GN24717@d508a.hadiko.de>
<20030706172109.GO24717@d508a.hadiko.de>
Message-ID: <20030706175919.GQ24717@d508a.hadiko.de>
you were right again.
thanks a lot. it works now.
i still had a comm.jar in ext of my jdk.
information about this project will soon be put on
http://versfabrik.de
g phil
On Sun, Jul 06, 2003 at 06:33:06PM +0100, Trent Jarvi wrote:
>
>
> On Sun, 6 Jul 2003, Philipp Hofmann wrote:
>
> > hey,
> >
> > you convinced me. i got lib-rxtx-java_2.1.6-1_i386.deb and installed it.
> >
> > but ...
> >
> > even my previously used test-app reports the same error:
> >
> > *snip*
> > Native Library /usr/lib/librxtxSerial-2.1-6.so already loaded in
> > another classloader
> > *snip*
> >
> > after some straceing it seems to me that firstly it looks for a
> > libSerial.so if it doesn't find one it aborts although it loads the
> > librxtxSerial afterwards. and if it finds one because of a symlink i
> > provide it aborts because it tries to load the same lib twice.
> >
> > i didn't do any changes to the rxtx-code and i'm not using
> > System.loadLibrary("...");
> >
> > $ grep loadLib RXTXCommDriver.java
> > System.loadLibrary( "rxtxSerial" );
> >
> > which means it should only be looking for *librxtxSerial.so*. where
> > does the *libSerial.so* request come from? it is defenatly not part of
> > my test-app. :)
> >
> > so far
> >
> > g phil
> >
> >
>
> Hi Phil
>
> I don't think libSerial.so should be loaded at all in rxtx 2.1. Perhaps
> there is something in the Java distribution you are using?
>
> If you have a sample to try I can try reproducing the problem. There is
> something unusual in your setup or code. I looked at the .deb a couple
> months ago and its not making code changes. It should be fine.
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
From ricardo.trindade at emation.pt Mon Jul 7 00:59:06 2003
From: ricardo.trindade at emation.pt (Ricardo Trindade)
Date: Fri Jun 3 17:45:37 2005
Subject: [Rxtx] loading .dll or .so from jar
Message-ID:
Hi,
Hi was wondering if you haver considered including the .dll and .so in the
jar, and loading the adequate one depending on the platform.
Is this even possible ?
It would also make life easier for rxtx begginners. The only drawback I see
is the increase in jar size, but people concerned about that could always
delete it. Also with tens of megs of JRE it's hardly a problem for any java
user...
ricardo
From taj at linuxgrrls.org Mon Jul 7 01:45:23 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 17:45:37 2005
Subject: [Rxtx] loading .dll or .so from jar
In-Reply-To:
References:
Message-ID:
On Mon, 7 Jul 2003, Ricardo Trindade wrote:
> Hi,
>
> Hi was wondering if you haver considered including the .dll and .so in the
> jar, and loading the adequate one depending on the platform.
>
> Is this even possible ?
>
> It would also make life easier for rxtx begginners. The only drawback I see
> is the increase in jar size, but people concerned about that could always
> delete it. Also with tens of megs of JRE it's hardly a problem for any java
> user...
>
Hi Ricardo
Thats a great idea.
Have you done something like this before? I can picture everything
required except for the native library paths. Thats probably doable also.
That certainly would simplify installs.
From moritz.gmelin at gmx.de Mon Jul 7 06:31:51 2003
From: moritz.gmelin at gmx.de (Moritz Gmelin)
Date: Fri Jun 3 17:45:37 2005
Subject: [Rxtx] loading .dll or .so from jar
In-Reply-To:
Message-ID: <4FE80175-B03C-11D7-8199-000393719396@gmx.de>
Hi,
you can do that for a WebStart-Application. Just put the .so (.dll)
file in a jar. I believe you have to sign it. But I'm not sure about
the signing part. The rest works great.
M.
Am Montag, 07.07.03, um 02:45 Uhr (Europe/Berlin) schrieb Trent Jarvi:
>
>
> On Mon, 7 Jul 2003, Ricardo Trindade wrote:
>
>> Hi,
>>
>> Hi was wondering if you haver considered including the .dll and .so
>> in the
>> jar, and loading the adequate one depending on the platform.
>>
>> Is this even possible ?
>>
>> It would also make life easier for rxtx begginners. The only
>> drawback I see
>> is the increase in jar size, but people concerned about that could
>> always
>> delete it. Also with tens of megs of JRE it's hardly a problem for
>> any java
>> user...
>>
>
> Hi Ricardo
>
> Thats a great idea.
>
> Have you done something like this before? I can picture everything
> required except for the native library paths. Thats probably doable
> also.
>
> That certainly would simplify installs.
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
From glenn at satlantic.com Wed Jul 9 21:17:24 2003
From: glenn at satlantic.com (Glenn Davidson)
Date: Fri Jun 3 17:45:37 2005
Subject: [Rxtx] ClassCastException using RXTX 2.1-6
Message-ID: <3F0C7854.9000003@satlantic.com>
I am using Java 1.4.1 on RedHat Linux (version 9) I currently have installed rxtx 2.1.6 and when my application runs I get the error:
"Caught java.lang.ClassCastException while loading driver
gnu.io.RXTXCommDriver"
Does any onyone recognize this problem?
--
Glenn Davidson |*| Phone: (902)492-4780
Satlantic Inc., Richmond Terminal, Pier 9 |*| Fax: (902)492-4781
3295 Barrington St., Halifax, NS, Canada |*| E-mail: glenn@satlantic.com
From taj at linuxgrrls.org Wed Jul 9 21:25:38 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 17:45:37 2005
Subject: [Rxtx] ClassCastException using RXTX 2.1-6
In-Reply-To: <3F0C7854.9000003@satlantic.com>
References: <3F0C7854.9000003@satlantic.com>
Message-ID:
This error is reported to the list now and then. I just looked through my
email and the only thing I saw was that this does happen when the native
library is unable to load. hmm. what do you have in
.../java/jre/lib/i386/
If you did an install from source, there should be
librxtxSerial-2.1-7pre16.so
librxtxSerial.so (symbolic link to the above)
Make sure you do not mix rxtx 2.1 with Sun's comm.jar and rxtx 2.0 jcl.jar
On Wed, 9 Jul 2003, Glenn Davidson wrote:
> I am using Java 1.4.1 on RedHat Linux (version 9) I currently have installed rxtx 2.1.6 and when my application runs I get the error:
>
> "Caught java.lang.ClassCastException while loading driver
> gnu.io.RXTXCommDriver"
>
> Does any onyone recognize this problem?
>
> --
> Glenn Davidson |*| Phone: (902)492-4780
> Satlantic Inc., Richmond Terminal, Pier 9 |*| Fax: (902)492-4781
> 3295 Barrington St., Halifax, NS, Canada |*| E-mail: glenn@satlantic.com
>
>
>
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
From ricardo.trindade at emation.pt Thu Jul 10 18:35:04 2003
From: ricardo.trindade at emation.pt (Ricardo Trindade)
Date: Fri Jun 3 17:45:37 2005
Subject: [Rxtx] loading .dll or .so from jar
In-Reply-To:
Message-ID:
I've looked this article up on the net, which explains the concept.
I implemented it, but found an issue regarding the native lib. I load the
library with System.load, but an exception
is thrown on you System.loadlibrary("rxtxSerial"), saying I don't have the
library on java.library.path. So I imagine that for this to be possible you
would have to handle the loading with System.load, as stated in the article,
or accept an argument to not load the library.
What do you think of this ?
Ricardo
-----Mensagem original-----
De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
nome de Trent Jarvi
Enviada: segunda-feira, 7 de Julho de 2003 1:45
Para: Java RXTX discussion
Assunto: Re: [Rxtx] loading .dll or .so from jar
On Mon, 7 Jul 2003, Ricardo Trindade wrote:
> Hi,
>
> Hi was wondering if you haver considered including the .dll and .so in
the
> jar, and loading the adequate one depending on the platform.
>
> Is this even possible ?
>
> It would also make life easier for rxtx begginners. The only drawback I
see
> is the increase in jar size, but people concerned about that could always
> delete it. Also with tens of megs of JRE it's hardly a problem for any
java
> user...
>
Hi Ricardo
Thats a great idea.
Have you done something like this before? I can picture everything
required except for the native library paths. Thats probably doable also.
That certainly would simplify installs.
_______________________________________________
Rxtx mailing list
Rxtx@linuxgrrls.org
http://hex.linuxgrrls.org/mailman/listinfo/rxtx
From ricardo.trindade at emation.pt Thu Jul 10 19:02:25 2003
From: ricardo.trindade at emation.pt (Ricardo Trindade)
Date: Fri Jun 3 17:45:38 2005
Subject: [Rxtx] loading .dll or .so from jar
In-Reply-To:
Message-ID:
I'm replying to myself to add two attachments interesting to this issue :
The .java is from the JUGS project.
-----Mensagem original-----
De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
nome de Ricardo Trindade
Enviada: quinta-feira, 10 de Julho de 2003 18:35
Para: Java RXTX discussion
Assunto: RE: [Rxtx] loading .dll or .so from jar
I've looked this article up on the net, which explains the concept.
I implemented it, but found an issue regarding the native lib. I load the
library with System.load, but an exception
is thrown on you System.loadlibrary("rxtxSerial"), saying I don't have the
library on java.library.path. So I imagine that for this to be possible you
would have to handle the loading with System.load, as stated in the article,
or accept an argument to not load the library.
What do you think of this ?
Ricardo
-----Mensagem original-----
De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
nome de Trent Jarvi
Enviada: segunda-feira, 7 de Julho de 2003 1:45
Para: Java RXTX discussion
Assunto: Re: [Rxtx] loading .dll or .so from jar
On Mon, 7 Jul 2003, Ricardo Trindade wrote:
> Hi,
>
> Hi was wondering if you haver considered including the .dll and .so in
the
> jar, and loading the adequate one depending on the platform.
>
> Is this even possible ?
>
> It would also make life easier for rxtx begginners. The only drawback I
see
> is the increase in jar size, but people concerned about that could always
> delete it. Also with tens of megs of JRE it's hardly a problem for any
java
> user...
>
Hi Ricardo
Thats a great idea.
Have you done something like this before? I can picture everything
required except for the native library paths. Thats probably doable also.
That certainly would simplify installs.
_______________________________________________
Rxtx mailing list
Rxtx@linuxgrrls.org
http://hex.linuxgrrls.org/mailman/listinfo/rxtx
_______________________________________________
Rxtx mailing list
Rxtx@linuxgrrls.org
http://hex.linuxgrrls.org/mailman/listinfo/rxtx
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nativelibs.pdf
Type: application/pdf
Size: 72425 bytes
Desc: not available
Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20030710/46bcf03a/nativelibs-0002.pdf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NativeLibs.java
Type: text/x-java
Size: 7537 bytes
Desc: not available
Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20030710/46bcf03a/NativeLibs.java
From awaisa at hotmail.com Thu Jul 10 20:25:20 2003
From: awaisa at hotmail.com (Awais Ahmed)
Date: Fri Jun 3 17:45:38 2005
Subject: [Rxtx] loading .dll or .so from jar
Message-ID:
Hello All,
I guess the first question is: if it is possible.
The answer is *NO*. I am not aware of any support
like this from Suns JVM implementation.
All JNI based shared libraries are loaded in the
following flow of functional execution.
1. Java Application somewhere requests to load a
native library. Using calls like
System.loadLibrary(""). Normally this
is done in some static initializers
2. Later, defining class loader of the class
containing loadLibrary Call invokes a one of its
JNI *native* function to load a library.
3. That particular native system library requests
JVM to load the requested library, which is then
loaded through the dynamic loader.
Now to make it happen, one will have to consider
security issues and see how to add support to
extract a native library from a jar and place it
in some location/path which could later be made
accessible to the dynamic loader to load. And this
again has an issue. Currently, I am not aware of
any scenario where a JVM creates any executible
code file anywhere in your secondary location.
Anything that is generated is mapped on memory
and is all dynamic. Introducing a system library
would be a new thing.
Note: It's it important to have a library be
loaded through some VM as then VM will be
responsible for unloading that library if it's
no more referenced.
Now I can think of folowing ways:
1. You create your own objects that makes use of
packages like java.util.jar or java.util.zip
or some other custom components and extract the
native libraries at some location and then
modify java.library.path and then let
System.loadLibrary play it trick. It is a
little ugly as one also will have to keep in
mind some files cleanup mechanism.
2. An ideal way (may not be in your control to
do it) could be:
Have the VM do it totally and issues would be:
Since dynamic loader also has a major role
in loading a library, which has to have some
physical existance accessible through some path.
And there are issues and concerns if VM will
create a new file with executible code in a
disk-space. As any runtime code should only be
laid out in memory. (Note it's not accesptable
to have VM create/introduce any new native code
based files) One option that makes it do-able
is if dynamic loader gives an interface to load
a library from memory. In this scenario VM could
extract the system library bits and map it in
some memory and let the dynamic loader accept
executible code from memory.
One can try it on some research VMs along with
some adding some support in dynamic loader.
Awais Sheikh
PS: I am not sure if this email will go through as
I am not sending it through my registered email
address.
----- Original Message -----
From: "Ricardo Trindade"
To: "Java RXTX discussion"
Sent: Thursday, July 10, 2003 10:35 AM
Subject: RE: [Rxtx] loading .dll or .so from jar
>I've looked this article up on the net, which explains the concept.
>
>I implemented it, but found an issue regarding the native lib. I load the
>library with System.load, but an exception
>is thrown on you System.loadlibrary("rxtxSerial"), saying I don't have the
>library on java.library.path. So I imagine that for this to be possible you
>would have to handle the loading with System.load, as stated in the
>article,
>or accept an argument to not load the library.
>
>What do you think of this ?
>
>Ricardo
>
>-----Mensagem original-----
>De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
>nome de Trent Jarvi
>Enviada: segunda-feira, 7 de Julho de 2003 1:45
>Para: Java RXTX discussion
>Assunto: Re: [Rxtx] loading .dll or .so from jar
>
>
>
>
>On Mon, 7 Jul 2003, Ricardo Trindade wrote:
>
> > Hi,
> >
> > Hi was wondering if you haver considered including the .dll and .so in
>the
> > jar, and loading the adequate one depending on the platform.
> >
> > Is this even possible ?
> >
> > It would also make life easier for rxtx begginners. The only drawback I
>see
> > is the increase in jar size, but people concerned about that could
>always
> > delete it. Also with tens of megs of JRE it's hardly a problem for any
>java
> > user...
> >
>
>Hi Ricardo
>
>Thats a great idea.
>
>Have you done something like this before? I can picture everything
>required except for the native library paths. Thats probably doable also.
>
>That certainly would simplify installs.
_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
From taj at linuxgrrls.org Thu Jul 10 21:39:28 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 17:45:38 2005
Subject: [Rxtx] loading .dll or .so from jar
In-Reply-To:
References:
Message-ID:
Yikes.
It may be more productive to look at an installer rather than gowing down
one of these directions.
It would not be too hard to extract the proper binary from a jar file and
place it in the correct location. Same for the comm.jar.
If we start creating directories, dumping files, looking at VM hacks, and
so forth, we will get in trouble one way or another.
On Thu, 10 Jul 2003, Awais Ahmed wrote:
> Hello All,
> I guess the first question is: if it is possible.
> The answer is *NO*. I am not aware of any support
> like this from Suns JVM implementation.
> All JNI based shared libraries are loaded in the
> following flow of functional execution.
> 1. Java Application somewhere requests to load a
> native library. Using calls like
> System.loadLibrary(""). Normally this
> is done in some static initializers
> 2. Later, defining class loader of the class
> containing loadLibrary Call invokes a one of its
> JNI *native* function to load a library.
> 3. That particular native system library requests
> JVM to load the requested library, which is then
> loaded through the dynamic loader.
>
> Now to make it happen, one will have to consider
> security issues and see how to add support to
> extract a native library from a jar and place it
> in some location/path which could later be made
> accessible to the dynamic loader to load. And this
> again has an issue. Currently, I am not aware of
> any scenario where a JVM creates any executible
> code file anywhere in your secondary location.
> Anything that is generated is mapped on memory
> and is all dynamic. Introducing a system library
> would be a new thing.
>
> Note: It's it important to have a library be
> loaded through some VM as then VM will be
> responsible for unloading that library if it's
> no more referenced.
>
> Now I can think of folowing ways:
> 1. You create your own objects that makes use of
> packages like java.util.jar or java.util.zip
> or some other custom components and extract the
> native libraries at some location and then
> modify java.library.path and then let
> System.loadLibrary play it trick. It is a
> little ugly as one also will have to keep in
> mind some files cleanup mechanism.
>
> 2. An ideal way (may not be in your control to
> do it) could be:
> Have the VM do it totally and issues would be:
> Since dynamic loader also has a major role
> in loading a library, which has to have some
> physical existance accessible through some path.
> And there are issues and concerns if VM will
> create a new file with executible code in a
> disk-space. As any runtime code should only be
> laid out in memory. (Note it's not accesptable
> to have VM create/introduce any new native code
> based files) One option that makes it do-able
> is if dynamic loader gives an interface to load
> a library from memory. In this scenario VM could
> extract the system library bits and map it in
> some memory and let the dynamic loader accept
> executible code from memory.
> One can try it on some research VMs along with
> some adding some support in dynamic loader.
>
> Awais Sheikh
>
> PS: I am not sure if this email will go through as
> I am not sending it through my registered email
> address.
>
> ----- Original Message -----
> From: "Ricardo Trindade"
> To: "Java RXTX discussion"
> Sent: Thursday, July 10, 2003 10:35 AM
> Subject: RE: [Rxtx] loading .dll or .so from jar
>
>
> >I've looked this article up on the net, which explains the concept.
> >
> >I implemented it, but found an issue regarding the native lib. I load the
> >library with System.load, but an exception
> >is thrown on you System.loadlibrary("rxtxSerial"), saying I don't have the
> >library on java.library.path. So I imagine that for this to be possible you
> >would have to handle the loading with System.load, as stated in the
> >article,
> >or accept an argument to not load the library.
> >
> >What do you think of this ?
> >
> >Ricardo
> >
> >-----Mensagem original-----
> >De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
> >nome de Trent Jarvi
> >Enviada: segunda-feira, 7 de Julho de 2003 1:45
> >Para: Java RXTX discussion
> >Assunto: Re: [Rxtx] loading .dll or .so from jar
> >
> >
> >
> >
> >On Mon, 7 Jul 2003, Ricardo Trindade wrote:
> >
> > > Hi,
> > >
> > > Hi was wondering if you haver considered including the .dll and .so in
> >the
> > > jar, and loading the adequate one depending on the platform.
> > >
> > > Is this even possible ?
> > >
> > > It would also make life easier for rxtx begginners. The only drawback I
> >see
> > > is the increase in jar size, but people concerned about that could
> >always
> > > delete it. Also with tens of megs of JRE it's hardly a problem for any
> >java
> > > user...
> > >
> >
> >Hi Ricardo
> >
> >Thats a great idea.
> >
> >Have you done something like this before? I can picture everything
> >required except for the native library paths. Thats probably doable also.
> >
> >That certainly would simplify installs.
>
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
From ricardo.trindade at emation.pt Fri Jul 11 10:46:11 2003
From: ricardo.trindade at emation.pt (Ricardo Trindade)
Date: Fri Jun 3 17:45:38 2005
Subject: [Rxtx] loading .dll or .so from jar
In-Reply-To:
Message-ID:
Hi,
Why all this complication ? It's so easy. Have you read the pdf and .java I
posted ? That's the way several projects are doing it.
1) Extract the correct .dll or .so to your current director, depending on
platform
2) Read said library with System.load( currentDir + libName );
3) done
The System.load call doesn't rely on java library path, just on absolute
filesystem location. if the library is extracted to the current directory,
no directory or path issues will appear.
If you find this inadequate to include in rxtx itself, please consider
adding a boolean flag to define wether or not RXTX will call
System.loadLibrary, so that people wanting to use the scheme above can do it
outside RXTX.
thanks
Ricardo
-----Mensagem original-----
De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
nome de Awais Ahmed
Enviada: quinta-feira, 10 de Julho de 2003 20:25
Para: rxtx@linuxgrrls.org
Cc: awaisa@hotmail.com
Assunto: Re: [Rxtx] loading .dll or .so from jar
Hello All,
I guess the first question is: if it is possible.
The answer is *NO*. I am not aware of any support
like this from Suns JVM implementation.
All JNI based shared libraries are loaded in the
following flow of functional execution.
1. Java Application somewhere requests to load a
native library. Using calls like
System.loadLibrary(""). Normally this
is done in some static initializers
2. Later, defining class loader of the class
containing loadLibrary Call invokes a one of its
JNI *native* function to load a library.
3. That particular native system library requests
JVM to load the requested library, which is then
loaded through the dynamic loader.
Now to make it happen, one will have to consider
security issues and see how to add support to
extract a native library from a jar and place it
in some location/path which could later be made
accessible to the dynamic loader to load. And this
again has an issue. Currently, I am not aware of
any scenario where a JVM creates any executible
code file anywhere in your secondary location.
Anything that is generated is mapped on memory
and is all dynamic. Introducing a system library
would be a new thing.
Note: It's it important to have a library be
loaded through some VM as then VM will be
responsible for unloading that library if it's
no more referenced.
Now I can think of folowing ways:
1. You create your own objects that makes use of
packages like java.util.jar or java.util.zip
or some other custom components and extract the
native libraries at some location and then
modify java.library.path and then let
System.loadLibrary play it trick. It is a
little ugly as one also will have to keep in
mind some files cleanup mechanism.
2. An ideal way (may not be in your control to
do it) could be:
Have the VM do it totally and issues would be:
Since dynamic loader also has a major role
in loading a library, which has to have some
physical existance accessible through some path.
And there are issues and concerns if VM will
create a new file with executible code in a
disk-space. As any runtime code should only be
laid out in memory. (Note it's not accesptable
to have VM create/introduce any new native code
based files) One option that makes it do-able
is if dynamic loader gives an interface to load
a library from memory. In this scenario VM could
extract the system library bits and map it in
some memory and let the dynamic loader accept
executible code from memory.
One can try it on some research VMs along with
some adding some support in dynamic loader.
Awais Sheikh
PS: I am not sure if this email will go through as
I am not sending it through my registered email
address.
----- Original Message -----
From: "Ricardo Trindade"
To: "Java RXTX discussion"
Sent: Thursday, July 10, 2003 10:35 AM
Subject: RE: [Rxtx] loading .dll or .so from jar
>I've looked this article up on the net, which explains the concept.
>
>I implemented it, but found an issue regarding the native lib. I load the
>library with System.load, but an exception
>is thrown on you System.loadlibrary("rxtxSerial"), saying I don't have the
>library on java.library.path. So I imagine that for this to be possible you
>would have to handle the loading with System.load, as stated in the
>article,
>or accept an argument to not load the library.
>
>What do you think of this ?
>
>Ricardo
>
>-----Mensagem original-----
>De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
>nome de Trent Jarvi
>Enviada: segunda-feira, 7 de Julho de 2003 1:45
>Para: Java RXTX discussion
>Assunto: Re: [Rxtx] loading .dll or .so from jar
>
>
>
>
>On Mon, 7 Jul 2003, Ricardo Trindade wrote:
>
> > Hi,
> >
> > Hi was wondering if you haver considered including the .dll and .so in
>the
> > jar, and loading the adequate one depending on the platform.
> >
> > Is this even possible ?
> >
> > It would also make life easier for rxtx begginners. The only drawback I
>see
> > is the increase in jar size, but people concerned about that could
>always
> > delete it. Also with tens of megs of JRE it's hardly a problem for any
>java
> > user...
> >
>
>Hi Ricardo
>
>Thats a great idea.
>
>Have you done something like this before? I can picture everything
>required except for the native library paths. Thats probably doable also.
>
>That certainly would simplify installs.
_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
_______________________________________________
Rxtx mailing list
Rxtx@linuxgrrls.org
http://hex.linuxgrrls.org/mailman/listinfo/rxtx
From taj at linuxgrrls.org Fri Jul 11 11:46:30 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 17:45:38 2005
Subject: [Rxtx] loading .dll or .so from jar
In-Reply-To:
References:
Message-ID:
The pdf solution is fairly easy to implement but does involve installing
native libraries. The security...
OK. Lets start with Unix which I'm more familiar with than w32. There
are two places these files would be allowed to be extracted:
~/ (the users home directory such as /home/jarvi
/tmp /usr/tmp /usr/local/tmp - one of the tmp directories
When applications do this they usually use a dot directory. If its in a
tmp directory then cleanup is expected to be done afterwards. Lets just
look at the home directory.
/home/jarvi/.rxtx The home direcotry could be shared across
multiple OS's and archs via NFS, SMB, ... so there would have
to be subdirecotries for OS and arch. solaris/i386 for instance.
Writing to the system/jre/jdk directories would be bad form and users
will typically not have permission anyhow.
In order for this to automatically happen, The lockfile feature would have
to be disabled. This means a person using this library could open say a
modem being used by another user and interfere with communications.
I'm not sure at all what would be acceptable in a modern NT environment.
Does anyone know what would be done as a user on say w2003? There are
probably simular issues and solutions.
On Fri, 11 Jul 2003, Ricardo Trindade wrote:
> Hi,
>
> Why all this complication ? It's so easy. Have you read the pdf and .java I
> posted ? That's the way several projects are doing it.
>
> 1) Extract the correct .dll or .so to your current director, depending on
> platform
> 2) Read said library with System.load( currentDir + libName );
> 3) done
>
> The System.load call doesn't rely on java library path, just on absolute
> filesystem location. if the library is extracted to the current directory,
> no directory or path issues will appear.
>
> If you find this inadequate to include in rxtx itself, please consider
> adding a boolean flag to define wether or not RXTX will call
> System.loadLibrary, so that people wanting to use the scheme above can do it
> outside RXTX.
>
> thanks
> Ricardo
>
> -----Mensagem original-----
> De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
> nome de Awais Ahmed
> Enviada: quinta-feira, 10 de Julho de 2003 20:25
> Para: rxtx@linuxgrrls.org
> Cc: awaisa@hotmail.com
> Assunto: Re: [Rxtx] loading .dll or .so from jar
>
>
> Hello All,
> I guess the first question is: if it is possible.
> The answer is *NO*. I am not aware of any support
> like this from Suns JVM implementation.
> All JNI based shared libraries are loaded in the
> following flow of functional execution.
> 1. Java Application somewhere requests to load a
> native library. Using calls like
> System.loadLibrary(""). Normally this
> is done in some static initializers
> 2. Later, defining class loader of the class
> containing loadLibrary Call invokes a one of its
> JNI *native* function to load a library.
> 3. That particular native system library requests
> JVM to load the requested library, which is then
> loaded through the dynamic loader.
>
> Now to make it happen, one will have to consider
> security issues and see how to add support to
> extract a native library from a jar and place it
> in some location/path which could later be made
> accessible to the dynamic loader to load. And this
> again has an issue. Currently, I am not aware of
> any scenario where a JVM creates any executible
> code file anywhere in your secondary location.
> Anything that is generated is mapped on memory
> and is all dynamic. Introducing a system library
> would be a new thing.
>
> Note: It's it important to have a library be
> loaded through some VM as then VM will be
> responsible for unloading that library if it's
> no more referenced.
>
> Now I can think of folowing ways:
> 1. You create your own objects that makes use of
> packages like java.util.jar or java.util.zip
> or some other custom components and extract the
> native libraries at some location and then
> modify java.library.path and then let
> System.loadLibrary play it trick. It is a
> little ugly as one also will have to keep in
> mind some files cleanup mechanism.
>
> 2. An ideal way (may not be in your control to
> do it) could be:
> Have the VM do it totally and issues would be:
> Since dynamic loader also has a major role
> in loading a library, which has to have some
> physical existance accessible through some path.
> And there are issues and concerns if VM will
> create a new file with executible code in a
> disk-space. As any runtime code should only be
> laid out in memory. (Note it's not accesptable
> to have VM create/introduce any new native code
> based files) One option that makes it do-able
> is if dynamic loader gives an interface to load
> a library from memory. In this scenario VM could
> extract the system library bits and map it in
> some memory and let the dynamic loader accept
> executible code from memory.
> One can try it on some research VMs along with
> some adding some support in dynamic loader.
>
> Awais Sheikh
>
> PS: I am not sure if this email will go through as
> I am not sending it through my registered email
> address.
>
> ----- Original Message -----
> From: "Ricardo Trindade"
> To: "Java RXTX discussion"
> Sent: Thursday, July 10, 2003 10:35 AM
> Subject: RE: [Rxtx] loading .dll or .so from jar
>
>
> >I've looked this article up on the net, which explains the concept.
> >
> >I implemented it, but found an issue regarding the native lib. I load the
> >library with System.load, but an exception
> >is thrown on you System.loadlibrary("rxtxSerial"), saying I don't have the
> >library on java.library.path. So I imagine that for this to be possible you
> >would have to handle the loading with System.load, as stated in the
> >article,
> >or accept an argument to not load the library.
> >
> >What do you think of this ?
> >
> >Ricardo
> >
> >-----Mensagem original-----
> >De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
> >nome de Trent Jarvi
> >Enviada: segunda-feira, 7 de Julho de 2003 1:45
> >Para: Java RXTX discussion
> >Assunto: Re: [Rxtx] loading .dll or .so from jar
> >
> >
> >
> >
> >On Mon, 7 Jul 2003, Ricardo Trindade wrote:
> >
> > > Hi,
> > >
> > > Hi was wondering if you haver considered including the .dll and .so in
> >the
> > > jar, and loading the adequate one depending on the platform.
> > >
> > > Is this even possible ?
> > >
> > > It would also make life easier for rxtx begginners. The only drawback I
> >see
> > > is the increase in jar size, but people concerned about that could
> >always
> > > delete it. Also with tens of megs of JRE it's hardly a problem for any
> >java
> > > user...
> > >
> >
> >Hi Ricardo
> >
> >Thats a great idea.
> >
> >Have you done something like this before? I can picture everything
> >required except for the native library paths. Thats probably doable also.
> >
> >That certainly would simplify installs.
>
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
From robilad at kaffe.org Mon Jul 14 12:41:38 2003
From: robilad at kaffe.org (Dalibor Topic)
Date: Fri Jun 3 17:45:38 2005
Subject: [Rxtx] Implementing javax.comm for free software java
implementations (Was:
Re: [kaffe] Notes on kaffe (GNU Classpath integration) todo items)
In-Reply-To: <200307140820.h6E8KM518684@guri.is.kpn.be>
References: <1058125728.1750.28.camel@localhost>
<200307140820.h6E8KM518684@guri.is.kpn.be>
Message-ID: <3F1296F2.9060801@kaffe.org>
Hi Chris,
I've CC:ed Trent Jarvi, the maintainer of rxtx, see http://www.rxtx.org
for more information about it.
Chris Gray wrote:
> On Monday 14 July 2003 00:11, Mark Wielaard wrote:
>
>
>>- javax.comm stuff
>> - Kaffe has incomplete stubs
>> - There is the rxtx (sp?) project which has been usable.
>> (Check kaffe mailinglist archives)
>> They have ported to lots of platforms
>> - Wonka also has a implementation... (Status?)
>
>
> Wonka implementation status:
> [+] works, tested in a number of real-life situations. Uses async i/o on
> Linux.
> [-] ugly as hell: hard-coded data structures for 4 serial ports, giant
> switch statements, etc. Uses Wonka Native Interface (WNI), would need porting
> to JNI (but this is not hard).
>
> For a project I'm working on currently it could be interesting to either
> convert the current Wonka implementation to JNI or switch to rxtx. Has anyone
> out there anyhing good or bad to say about rxtx?
For kaffe it would be nice to use rxtx, since
* we had it nicely running under kaffe
http://www.kaffe.org/pipermail/kaffe/2003-April/029251.html
* it is supposed to be quite portable
The following OS's should have full Serial Commapi Serial Support:
mingw32 (windows 9* NT*) (no printer support)
WinCE (no printer support)
Solaris 2.x (*-*-solaris2*) x86 and sparc
Linux ELF (*-*-linux*, except aout, coff, and oldld)
FreeBSD 3.x 4.x (*-*-freebsd2*, *-*-freebsd3*)
Mac OS X
HP-UX 10.x (*-*-hpux10*)
SCO OpenServer 5.x (*-*-sco3.2v5*) (there may be recent breakage)
UnixWare
Digital/UNIX
* it appears to be in widespread use in different projects.
* it can be 'plugged in' into Sun's javax.comm implementation.
On the negative side:
* it needs someone to write the java part of javax.comm (which wonka
already has working, kaffe has a GPLd implementation of unknown quality).
* We don't have anyone from rxtx on Classpath's or Kaffe's mailing
lists, so there is a communication gap.
cheers,
dalibor topic
From taj at linuxgrrls.org Mon Jul 14 16:28:29 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 17:45:38 2005
Subject: [Rxtx] Implementing javax.comm for free software java
implementations
(Was: Re: [kaffe] Notes on kaffe (GNU Classpath integration) todo
items)
In-Reply-To: <3F1296F2.9060801@kaffe.org>
References: <1058125728.1750.28.camel@localhost>
<200307140820.h6E8KM518684@guri.is.kpn.be>
<3F1296F2.9060801@kaffe.org>
Message-ID:
On Mon, 14 Jul 2003, Dalibor Topic wrote:
> Hi Chris,
>
> I've CC:ed Trent Jarvi, the maintainer of rxtx, see http://www.rxtx.org
> for more information about it.
>
> Chris Gray wrote:
> > On Monday 14 July 2003 00:11, Mark Wielaard wrote:
> >
> >
> >>- javax.comm stuff
> >> - Kaffe has incomplete stubs
> >> - There is the rxtx (sp?) project which has been usable.
> >> (Check kaffe mailinglist archives)
> >> They have ported to lots of platforms
> >> - Wonka also has a implementation... (Status?)
> >
> >
> > Wonka implementation status:
> > [+] works, tested in a number of real-life situations. Uses async i/o on
> > Linux.
> > [-] ugly as hell: hard-coded data structures for 4 serial ports, giant
> > switch statements, etc. Uses Wonka Native Interface (WNI), would need porting
> > to JNI (but this is not hard).
> >
> > For a project I'm working on currently it could be interesting to either
> > convert the current Wonka implementation to JNI or switch to rxtx. Has anyone
> > out there anyhing good or bad to say about rxtx?
>
> For kaffe it would be nice to use rxtx, since
>
> * we had it nicely running under kaffe
> http://www.kaffe.org/pipermail/kaffe/2003-April/029251.html
>
> * it is supposed to be quite portable
>
> The following OS's should have full Serial Commapi Serial Support:
>
> mingw32 (windows 9* NT*) (no printer support)
> WinCE (no printer support)
> Solaris 2.x (*-*-solaris2*) x86 and sparc
> Linux ELF (*-*-linux*, except aout, coff, and oldld)
> FreeBSD 3.x 4.x (*-*-freebsd2*, *-*-freebsd3*)
> Mac OS X
> HP-UX 10.x (*-*-hpux10*)
> SCO OpenServer 5.x (*-*-sco3.2v5*) (there may be recent breakage)
> UnixWare
> Digital/UNIX
>
> * it appears to be in widespread use in different projects.
>
> * it can be 'plugged in' into Sun's javax.comm implementation.
>
> On the negative side:
> * it needs someone to write the java part of javax.comm (which wonka
> already has working, kaffe has a GPLd implementation of unknown quality).
>
> * We don't have anyone from rxtx on Classpath's or Kaffe's mailing
> lists, so there is a communication gap.
>
There should also be minimal support for printer ports on w32 also.
We'd be more than willing to work with Classpath and or Kaffe to get this
working. RXTX 2.1 implements CommAPI from the top down but is in package
gnu.io to avoid confusion with Sun's impementation.
RXTX 2.0 implements the lower portion of CommAPI and could be made to work
with the upper portion offered in Kaffe. The Kaffe shell classes did look
acceptable when I read through them.
--
Trent Jarvi
From robilad at kaffe.org Mon Jul 14 17:03:17 2003
From: robilad at kaffe.org (Dalibor Topic)
Date: Fri Jun 3 17:45:38 2005
Subject: [Rxtx] Implementing javax.comm for free software java
implementations
(Was: Re: [kaffe] Notes on kaffe (GNU Classpath integration) todo
items)
In-Reply-To:
References: <1058125728.1750.28.camel@localhost> <200307140820.h6E8KM518684@guri.is.kpn.be> <3F1296F2.9060801@kaffe.org>
Message-ID: <3F12D445.5070808@kaffe.org>
Hi Trent,
Trent Jarvi wrote:
> We'd be more than willing to work with Classpath and or Kaffe to get this
> working. RXTX 2.1 implements CommAPI from the top down but is in package
> gnu.io to avoid confusion with Sun's impementation.
>
> RXTX 2.0 implements the lower portion of CommAPI and could be made to work
> with the upper portion offered in Kaffe. The Kaffe shell classes did look
> acceptable when I read through them.
Could we implement the javax.comm shell classes on top of RXTX 2.1
gnu.io API? I.e. would it be enough to just delegate method calls to
gnu.io. for a basic javax.comm implementation?
cheers,
dalibor topic
From taj at linuxgrrls.org Mon Jul 14 17:11:57 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 17:45:38 2005
Subject: [Rxtx] Implementing javax.comm for free software java
implementations
(Was: Re: [kaffe] Notes on kaffe (GNU Classpath integration) todo
items)
In-Reply-To: <3F12D445.5070808@kaffe.org>
References: <1058125728.1750.28.camel@localhost>
<200307140820.h6E8KM518684@guri.is.kpn.be>
<3F1296F2.9060801@kaffe.org>
<3F12D445.5070808@kaffe.org>
Message-ID:
On Mon, 14 Jul 2003, Dalibor Topic wrote:
> Hi Trent,
>
> Trent Jarvi wrote:
>
> > We'd be more than willing to work with Classpath and or Kaffe to get this
> > working. RXTX 2.1 implements CommAPI from the top down but is in package
> > gnu.io to avoid confusion with Sun's impementation.
> >
> > RXTX 2.0 implements the lower portion of CommAPI and could be made to work
> > with the upper portion offered in Kaffe. The Kaffe shell classes did look
> > acceptable when I read through them.
>
> Could we implement the javax.comm shell classes on top of RXTX 2.1
> gnu.io API? I.e. would it be enough to just delegate method calls to
> gnu.io. for a basic javax.comm implementation?
Hi Dalibor
That would be one possiblity. Another option would be to keep a diff
which simply converts RXTX 2.1 into javax.comm. There are even scripts
floating around which do that.
--
Trent Jarvi
From sylvie.locastello at thales-is.com Tue Jul 15 10:40:05 2003
From: sylvie.locastello at thales-is.com (Sylvie Locastello)
Date: Fri Jun 3 17:45:38 2005
Subject: [Rxtx] Java comm + kermit on rxtx
Message-ID: <3F13CBF5.6CEA1DFE@thales-is.com>
Hello,
1) Java SerialIO communication on Linux
We have to write a Java API, with serialIO communication
(RS232-RS422-RS485) protocol running on Linux target
machine.
we have found the "rxtx.org" website, the rxtx-2.1 seems to be a good
solution, so we're going to try it
2) Java Kermit on Linux
Further, we'll have probably to make file-transfert beetween machines
running on Linux, via serialIO communication
(RS232-RS422-RS485).
We actually think a good solution would be to have a Java Kermit API
running on Linux.
A good solution would be to add other LGPL code which already does
kermit into rxtx free of charge.
Has anybody already done this job : Java Kermit API on rxtx ?
Thanks in advance
Sylvie
From chris at kiffer.eunet.be Tue Jul 15 08:11:49 2003
From: chris at kiffer.eunet.be (Chris Gray)
Date: Fri Jun 3 17:45:38 2005
Subject: [Rxtx] Implementing javax.comm for free software java
implementations (Was: Re: [kaffe] Notes on kaffe (GNU Classpath
integration) todo items)
In-Reply-To:
References: <1058125728.1750.28.camel@localhost> <3F1296F2.9060801@kaffe.org>
Message-ID: <200307150711.h6F7Boj23624@xizor.is.kpn.be>
On Monday 14 July 2003 17:28, Trent Jarvi wrote:
> We'd be more than willing to work with Classpath and or Kaffe to get this
> working. RXTX 2.1 implements CommAPI from the top down but is in package
> gnu.io to avoid confusion with Sun's impementation.
>
> RXTX 2.0 implements the lower portion of CommAPI and could be made to work
> with the upper portion offered in Kaffe. The Kaffe shell classes did look
> acceptable when I read through them.
My current main project involves Wonka on uClinux, where everything is
statically linked: I'm a bit worried about the effects of LPGL contagion in
that environment. So I'll probably stick with the Wonka implementation for
that one, but check out rxtx for future projects.
--
Chris Gray /k/ Embedded Java Solutions
Embedded & Mobile Java, OSGi http://www.kiffer.be/k/
chris.gray@kiffer.be +32 477 599 703
From taj at linuxgrrls.org Tue Jul 15 20:00:53 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 17:45:38 2005
Subject: [Rxtx] Java comm + kermit on rxtx
In-Reply-To: <3F13CBF5.6CEA1DFE@thales-is.com>
References: <3F13CBF5.6CEA1DFE@thales-is.com>
Message-ID:
On Tue, 15 Jul 2003, Sylvie Locastello wrote:
> Hello,
>
>
> 1) Java SerialIO communication on Linux
> We have to write a Java API, with serialIO communication
> (RS232-RS422-RS485) protocol running on Linux target
> machine.
> we have found the "rxtx.org" website, the rxtx-2.1 seems to be a good
> solution, so we're going to try it
>
> 2) Java Kermit on Linux
>
> Further, we'll have probably to make file-transfert beetween machines
> running on Linux, via serialIO communication
> (RS232-RS422-RS485).
> We actually think a good solution would be to have a Java Kermit API
> running on Linux.
> A good solution would be to add other LGPL code which already does
> kermit into rxtx free of charge.
>
> Has anybody already done this job : Java Kermit API on rxtx ?
>
> Thanks in advance
> Sylvie
>
>
Hi Sylvie
I have looked at the Kermit project briefly. There is a G-kermit package
which is offered under the GPL. This would be a possible solution. One
could put together a JNI library which rxtx could call. It's my
understanding that commercial applications could then make calls to rxtx
but you should verify that.
It would not be very hard to make a java library with G-Kermit source.
Doing something in pure Java would probably be a larger project.
http://www.columbia.edu/kermit/gkermit.html
From taj at parcelfarce.linux.theplanet.co.uk Wed Jul 16 03:21:23 2003
From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk)
Date: Fri Jun 3 17:45:39 2005
Subject: [Rxtx] serial_select() modification for Win32 (fwd)
Message-ID:
--
Trent Jarvi
taj@www.linux.org.uk
---------- Forwarded message ----------
Hi Trent,
I was having troubles with rxtx-2.1-6 under Win32 so I
modified serial_select() in termios.c. I think I have
serial_select() acting a bit more like it's Linux
counter part. I have done very little testing with
this, namely used it with BlackBox and my application
both under Windows2000. I have attached the file so
you can review the changes.
Thanks for all your effort in developing this library,
it's much appreciated.
Mike Risi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: termios.c.tar.gz
Type: application/x-gzip-compressed
Size: 19392 bytes
Desc: termios.c.tar.gz
Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20030716/c9c9c113/termios.c.tar-0002.bin
From taj at parcelfarce.linux.theplanet.co.uk Thu Jul 17 18:03:01 2003
From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk)
Date: Fri Jun 3 17:45:39 2005
Subject: [Rxtx] WG: RXTX Issue (fwd)
Message-ID:
Summary:
rxtx requires an EventListener to use notifyOn*
The fix would involve moving code around in rxtx so it persists outside
the EventListener.
--
Trent Jarvi
taj@www.linux.org.uk
---------- Forwarded message ----------
HI!
I have found the problem/mistake with the parity error!
After removing the event listener it isn't possible to call any
notifyOn... Funktion.
In the file ErrorTest.java you can see the problem.
The problem occurs in all tested linux versions.
In windows we don't have this problems but there we use the sun classes!
Don't know why it happend but now i got rid of my problems.
Thankx for your help!
cu
----- Original Message -----
>
> As the case should be fairly simple, could you provide a test case
> that reproduces the problem so I can take a look?
>
> On Mon, 14 Jul 2003, Thomas Selner wrote:
>
> > I took a closer look at the function notifyOnParityError, and now i
> > know
why
> > i get the exception!
> > the function-call "nativeSetEventFlag" doesn't produce the
> > exception, but the function call "monThread.PE = true" does, because
> > "monThread"
always
> > has a "null"
> > value, but i couldn't find out why!
> >
> > could you help me with that?
> > i don't do nothing special with my serial port in my java program. i
> > just ...
> > * initialize a Serial-Port - object
> > * setSerialPortParams(1200,7,1,2)
> > * enableReceiveTimeout(1)
> > * call the functions "getInput/OutputStream"
> > * notifyOnParityError(true)
> > * notifyOnDataAvailable(true)
> > * sPort.addEventListener(...)
> >
> > that's all!
> >
> > ----- Original Message -----
> > >
> > > Hi Thomas
> > >
> > > I'm looking at RXTXPort.java
> > >
> > > public void notifyOnParityError( boolean enable )
> > > {
> > > if (debug)
> > > z.reportln( "RXTXPort:notifyOnParityError(
" +
> > > enable+" )");
> > > waitForTheNativeCodeSilly();
> > > MonitorThreadLock = true;
> > > nativeSetEventFlag( fd, SerialPortEvent.PE, enable
);
> > > monThread.PE = enable;
> > > MonitorThreadLock = false;
> > > }
> > >
> > > Lets assume there are no changes to SerialImp.c for a second. I'm
looking
> > > at rxtx-2.1-7pre16. If you are not using rxtx-2.1-7pre16, you can
test it
> > > by simply changing
> > >
> > > import javax.comm.*; to
> > > import gnu.io.*;
> > >
> > > in your source.
> > >
> > > If you comment out nativeSetEventFlag( fd, SerialPortEvent.PE,
enable );
> > > above, You can not generate the error you saw when you enable
> > > Parity
Error
> > > events.
> > >
> > > monThread.PE = true
> > >
> > > This is on the Java side. Perhaps you see an error as Parity
> > > Error
events
> > > are attempted to be sent but they must be different. Commenting
> > > out
that
> > > line just disabled Parity Error events.
> > >
> > > What is the error you see if you comment out the
> > > nativeSetEventFlag
shown
> > > above and leave the monThread.PE = true line?
> > >
> > > One way that PE events may not work on linux is if the serial port
driver
> > > used on your PC is not able to support TIOCGICOUNT. This would
> > > only happen on rare cards with very poor linux support.
> > >
> > > On Fri, 11 Jul 2003, Thomas Selner wrote:
> > >
> > > > Hello again, Mr. Jarvi!
> > > >
> > > > First, I really want to thank you for your help!!!
> > > >
> > > > I tried both suggestions for solving the problem, but ...
> > > >
> > > > @ Changes to SerialImp.c
> > >
> >
> ----------------------------------------------------------------------
> ----
> > --
> > > > --------------------------------------------
> > > > When I added the #ifndef Statement as you told me, i could
> > > > compile
and
> > run
> > > > my application, but
> > > > i wasn't able to receive any SerialEvent anymore!
> > >
> >
> ----------------------------------------------------------------------
> ----
> > --
> > > > --------------------------------------------
> > > >
> > > > @ Changes to RXTXPort.java
> > >
> >
> ----------------------------------------------------------------------
> ----
> > --
> > > > --------------------------------------------
> > > > I out-commented the line "nativeSetEventFlag( fd,
SerialPortEvent.PE,
> > > > enable );", but it didn't change something at all.
> > > > So i tried to out-comment the next line "monThread.PE = true".
> > > > That
> > worked
> > > > for me, but i am afraid that from now i
> > > > will never be able to get ParityEvents anymore. the problem is,
> > > > i
don't
> > how
> > > > to really test parity errors ... :-)
> > >
> >
> ----------------------------------------------------------------------
> ----
> > --
> > > > --------------------------------------------
> > > >
> > > > I really need to get ALL SerialEvents, PE and DATA_AVAILABLE and
> > > > ... (etc.)!!!
> > > >
> > > > I have to say that I used the RXTX Version 2.0.5, because I
> > > > didn't
want
> > to
> > > > change the "import" statements from
> > > > "javax.comm" to "gnu.io". I know that there is a script which
> > > > solves
> > this
> > > > problem ("changePackage.sh"), but i didn't really understand,
> > > > how and when (before or after compiling rxtx?) i should use it!
> > > >
> > > > Should i use a newer version of rxtx (e.g. 2.1.6)? will it work
there?
> > > >
> > > >
> > > > Thomas
> > > >
> > > >
> > > >
> > > >
> > > > ----- Original Message -----
> > > >
> > > > > On Thu, 10 Jul 2003, Thomas Selner wrote:
> > > > >
> > > > > > Hi Mr. Jarvi!
> > > > > >
> > > > > > I would like to use RXTX in relation with a serial device,
> > > > > > but i
> > need to
> > > > use the
> > > > > > CommAPI Function "SerialPort.notifyOnParityError(boolean)".
> > > > > >
> > > > > > When i compile my classes under windows xp with the comm-api
> > provided by
> > > > sun,
> > > > > > it works. under redhat linux 9 i get following exception
> > > > > > when
> > calling
> > > > the above function:
> > > > > >
> > > > > > nativeSetEventFlag !index java.lang.NullPointerException
> > > > > > at
> > gnu.io.RXTXPort$MonitorThread.access$702(RXTXPort.java:1500)
> > > > > > at
gnu.io.RXTXPort.notifyOnParityError(RXTXPort.java:990)
> > > > > > at
> > > > at.bdc.intersport.bk.eps48.Eps48Base.perform(Eps48Base.java:50)
> > > > > > at
> > > >
at.bdc.intersport.tester.serial.SerialTester.main(SerialTester.java:103)
> > > > > >
> > > > > >
> > > > > > could you plz tell me if this function is implemented in
> > > > > > rxtx or
> > when it
> > > > will be implemented?
> > > > > >
> > > > > >
> > > > > >
> > > > > > greetz ... thomas
> > > > >
> > > > > Hi Thomas
> > > > >
> > > > > I think this is implemented but there is some cruft that needs
> > > > > to
be
> > > > > fixed.
> > > > >
> > > > > in SerialImp.c there needs to be an ifdef TIOCSERGETLSR
> > > > > (remove
the "+
> > > > "'s):
> > > > > JNIEXPORT void JNICALL RXTXPort(nativeSetEventFlag)( JNIEnv
*env,
> > > > >
> > > > > jobject
jobj,
> > > > > jint
fd,
> > > > > jint
event,
> > > > >
> > > > > jboolean
> > flag )
> > > > > {
> > > > >
> > > > > + #ifndef TIOCSERGETLSR
> > > > > ... entire function
> > > > > + #endif /* TIOCSERGETLSR */
> > > > > }
> > > > >
> > > > > You could also comment out
> > > > >
> > > > > nativeSetEventFlag( fd, SerialPortEvent.PE, enable );
> > > > >
> > > > > in RXTXPort.java:notifyOnParityError( boolean enable )
> > > > >
> > > > > On linux the result would be the same either way.
> > > > >
> > > > > This function is a workaround for Solaris and is really
> > > > > unrelated
to
> > > > > getting linux PE working. I see that rxtx is checking for PE
> > > > > but
I'm
> > > > > guessing it is not well tested since this is the first time
> > > > > the
> > problem
> > > > > has shown up.
> > > > >
> > > > > Could you let me know if that works?
> > > > >
> > > > > --
> > > > > Trent Jarvi
> > > > > taj@www.linux.org.uk
> > > >
> > > >
> > >
> > > --
> > > Trent Jarvi
> > > taj@www.linux.org.uk
> >
> >
>
> --
> Trent Jarvi
> taj@www.linux.org.uk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ErrorTest.class
Type: application/octet-stream
Size: 1621 bytes
Desc:
Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20030717/6e365fc7/ErrorTest.class
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ErrorTest.java
Type: application/octet-stream
Size: 1281 bytes
Desc:
Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20030717/6e365fc7/ErrorTest-0004.obj
From emiliano at carlesi.vg Sat Jul 19 20:47:35 2003
From: emiliano at carlesi.vg (emiliano carlesi)
Date: Fri Jun 3 17:45:39 2005
Subject: [Rxtx] rxtx on osx
Message-ID:
hi to all !
this is my first mail in this ml ... so excuse if the question is
stupid !
i use osx and i need to use my cell phone via bluetooth, with java.
i have create the serial bluetooth link with the phone and from the
zterm console all work well.
now i need to do the same think from my program.
i write to the apple dev ml and all reply me to use the rxtx.
then i download rxtx and i try to compile it, following the
instructions. i have the version rxtx-2.1-7pre16.
i read on the instruction for osx users (using project builder). i
open the project the i need to compile
the target libSerial.jnilib, but i have not this target in this
project, i have only the librxtxSerial.jnilib target.
then i try to compile this. the compiler end with error because it
don't find the Zystem package.
i search on the rxtx site but i don't find nothing about this package.
i try then to download the previous version, the 1.5 (i see there are
some pointer to this version in the docs).
after the download (version 1.5-8) i try to compile and in this project
i find the LibSerial.jnilib target !
very happy i try to compile this and the compilation ... fail :-(
this is the error :
#!/bin/tcsh
cp build/RXTXcomm.jar
../ForPackageMaker/Install/System/Library/Frameworks/JavaVM.framework/
Versions/1.3.1/Home/lib/ext/
--- Output ---
cp:
../ForPackageMaker/Install/System/Library/Frameworks/JavaVM.framework/
Versions/1.3.1/Home/lib/ext: No such file or directory
=== Exit code: 1 ===
...failed PhaseScriptExecution
/Users/emilianocarlesi/Desktop/rxtx-1.5-8/MACOSX_IDE/PB/
build/LibSerial.build/RXTXcomm.build/BPTag004-script.sh ...
in the build directory i find : the RXTXcomm.jar package, a link to it
and a directory LibSerial.build.
instead for the documentation i need to find here the libSerial.jnilib
file.
thanks in advance
emiliano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 2014 bytes
Desc: not available
Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20030719/f1c69502/attachment-0002.bin
From taj at linuxgrrls.org Fri Jul 18 20:56:00 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 17:45:39 2005
Subject: [Rxtx] rxtx on osx
In-Reply-To:
References:
Message-ID:
On Sat, 19 Jul 2003, emiliano carlesi wrote:
> hi to all !
> this is my first mail in this ml ... so excuse if the question is
> stupid !
>
> i use osx and i need to use my cell phone via bluetooth, with java.
>
> i have create the serial bluetooth link with the phone and from the
> zterm console all work well.
>
> now i need to do the same think from my program.
>
> i write to the apple dev ml and all reply me to use the rxtx.
>
> then i download rxtx and i try to compile it, following the
> instructions. i have the version rxtx-2.1-7pre16.
> i read on the instruction for osx users (using project builder). i
> open the project the i need to compile
> the target libSerial.jnilib, but i have not this target in this
> project, i have only the librxtxSerial.jnilib target.
> then i try to compile this. the compiler end with error because it
> don't find the Zystem package.
> i search on the rxtx site but i don't find nothing about this package.
>
> i try then to download the previous version, the 1.5 (i see there are
> some pointer to this version in the docs).
> after the download (version 1.5-8) i try to compile and in this project
> i find the LibSerial.jnilib target !
> very happy i try to compile this and the compilation ... fail :-(
>
> this is the error :
>
> #!/bin/tcsh
> cp build/RXTXcomm.jar
> ../ForPackageMaker/Install/System/Library/Frameworks/JavaVM.framework/
> Versions/1.3.1/Home/lib/ext/
> --- Output ---
> cp:
> ../ForPackageMaker/Install/System/Library/Frameworks/JavaVM.framework/
> Versions/1.3.1/Home/lib/ext: No such file or directory
> === Exit code: 1 ===
> ...failed PhaseScriptExecution
> /Users/emilianocarlesi/Desktop/rxtx-1.5-8/MACOSX_IDE/PB/
> build/LibSerial.build/RXTXcomm.build/BPTag004-script.sh ...
>
>
> in the build directory i find : the RXTXcomm.jar package, a link to it
> and a directory LibSerial.build.
> instead for the documentation i need to find here the libSerial.jnilib
> file.
>
>
>
Hi Emiliano
This is probably my mistake. Could you email me the link to where you got
rxtx-2.1-7pre16.tar.gz and I'll make sure it is corrected.
Zystem was/is a debug library for w32 I threw together to figure out some
timing issues. It prints out debug messages with timestamps. Obviously
you dont need it.
I thought I had caught that in time. The correction is to change the
files to not use Zystem.
From emiliano at carlesi.vg Sat Jul 19 21:13:01 2003
From: emiliano at carlesi.vg (emiliano carlesi)
Date: Fri Jun 3 17:45:39 2005
Subject: [Rxtx] rxtx on osx
In-Reply-To:
Message-ID: <65C588FD-BA25-11D7-B422-000A95891300@carlesi.vg>
hi trent,
i found the package on the ftp ftp://jarvi.dsl.frii.com/pub and i have
download the latest in time order.
which version you think i can download ?
thank you very much for the speed in the response !!!!!
ciao
emiliano
On Friday, Jul 18, 2003, at 21:56 Europe/Rome, Trent Jarvi wrote:
>
>
> On Sat, 19 Jul 2003, emiliano carlesi wrote:
>
>> hi to all !
>> this is my first mail in this ml ... so excuse if the question is
>> stupid !
>>
>> i use osx and i need to use my cell phone via bluetooth, with java.
>>
>> i have create the serial bluetooth link with the phone and from the
>> zterm console all work well.
>>
>> now i need to do the same think from my program.
>>
>> i write to the apple dev ml and all reply me to use the rxtx.
>>
>> then i download rxtx and i try to compile it, following the
>> instructions. i have the version rxtx-2.1-7pre16.
>> i read on the instruction for osx users (using project builder). i
>> open the project the i need to compile
>> the target libSerial.jnilib, but i have not this target in this
>> project, i have only the librxtxSerial.jnilib target.
>> then i try to compile this. the compiler end with error because it
>> don't find the Zystem package.
>> i search on the rxtx site but i don't find nothing about this package.
>>
>> i try then to download the previous version, the 1.5 (i see there are
>> some pointer to this version in the docs).
>> after the download (version 1.5-8) i try to compile and in this
>> project
>> i find the LibSerial.jnilib target !
>> very happy i try to compile this and the compilation ... fail :-(
>>
>> this is the error :
>>
>> #!/bin/tcsh
>> cp build/RXTXcomm.jar
>> ../ForPackageMaker/Install/System/Library/Frameworks/JavaVM.framework/
>> Versions/1.3.1/Home/lib/ext/
>> --- Output ---
>> cp:
>> ../ForPackageMaker/Install/System/Library/Frameworks/JavaVM.framework/
>> Versions/1.3.1/Home/lib/ext: No such file or directory
>> === Exit code: 1 ===
>> ...failed PhaseScriptExecution
>> /Users/emilianocarlesi/Desktop/rxtx-1.5-8/MACOSX_IDE/PB/
>> build/LibSerial.build/RXTXcomm.build/BPTag004-script.sh ...
>>
>>
>> in the build directory i find : the RXTXcomm.jar package, a link to it
>> and a directory LibSerial.build.
>> instead for the documentation i need to find here the libSerial.jnilib
>> file.
>>
>>
>>
> Hi Emiliano
>
> This is probably my mistake. Could you email me the link to where you
> got
> rxtx-2.1-7pre16.tar.gz and I'll make sure it is corrected.
>
> Zystem was/is a debug library for w32 I threw together to figure out
> some
> timing issues. It prints out debug messages with timestamps.
> Obviously
> you dont need it.
>
> I thought I had caught that in time. The correction is to change the
> files to not use Zystem.
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
From taj at linuxgrrls.org Fri Jul 18 21:31:09 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 17:45:39 2005
Subject: [Rxtx] rxtx on osx
In-Reply-To: <65C588FD-BA25-11D7-B422-000A95891300@carlesi.vg>
References: <65C588FD-BA25-11D7-B422-000A95891300@carlesi.vg>
Message-ID:
Hmm OK.
The Zystem.java file looks fine:
static
{
/*
The rxtxZystem library uses Python code and is not
included with RXTX. A seperate library will be released
to avoid potential license conflicts.
Trent Jarvi taj@www.linux.org.uk
*/
//System.loadLibrary( "rxtxZystem" );
mode = SILENT_MODE;
}
I suspect the following is causing the compiler error
RXTXPort.java: private static Zystem z;
RXTXPort.java: z = new Zystem( Zystem.SILENT_MODE );
I'm not familiar with the Mac OS X build but I suspect it needs to have
Zystem.java and UnSupportedLoggerException.java added. These files are in
the src/ directory. Nothing else should be required.
These two files are new in the 2.1-7pre series. Dmitry may have these
fixed in CVS. You could try checking out the CVS files if you have cvs
installed:
export CVSROOT=:pserver:anonymous@cvs.milestonesolutions.com:/usr/local/cvsroot
cvs login (password is mousy)
cvs checkout -r commapi-0-0-1 rxtx-devel
It may be that rxtx 2-1.6 was the last release that compiled on Mac OS X
and we need to get some fixes in. Dmitry can be of more help here.
He should be on the mail list but can also be reached at dmarkman@mac.com.
Please let us know how things go so we can fix it for others.
On Sat, 19 Jul 2003, emiliano carlesi wrote:
> hi trent,
> i found the package on the ftp ftp://jarvi.dsl.frii.com/pub and i have
> download the latest in time order.
> which version you think i can download ?
> thank you very much for the speed in the response !!!!!
>
> ciao
> emiliano
>
> On Friday, Jul 18, 2003, at 21:56 Europe/Rome, Trent Jarvi wrote:
>
> >
> >
> > On Sat, 19 Jul 2003, emiliano carlesi wrote:
> >
> >> hi to all !
> >> this is my first mail in this ml ... so excuse if the question is
> >> stupid !
> >>
> >> i use osx and i need to use my cell phone via bluetooth, with java.
> >>
> >> i have create the serial bluetooth link with the phone and from the
> >> zterm console all work well.
> >>
> >> now i need to do the same think from my program.
> >>
> >> i write to the apple dev ml and all reply me to use the rxtx.
> >>
> >> then i download rxtx and i try to compile it, following the
> >> instructions. i have the version rxtx-2.1-7pre16.
> >> i read on the instruction for osx users (using project builder). i
> >> open the project the i need to compile
> >> the target libSerial.jnilib, but i have not this target in this
> >> project, i have only the librxtxSerial.jnilib target.
> >> then i try to compile this. the compiler end with error because it
> >> don't find the Zystem package.
> >> i search on the rxtx site but i don't find nothing about this package.
> >>
> >> i try then to download the previous version, the 1.5 (i see there are
> >> some pointer to this version in the docs).
> >> after the download (version 1.5-8) i try to compile and in this
> >> project
> >> i find the LibSerial.jnilib target !
> >> very happy i try to compile this and the compilation ... fail :-(
> >>
> >> this is the error :
> >>
> >> #!/bin/tcsh
> >> cp build/RXTXcomm.jar
> >> ../ForPackageMaker/Install/System/Library/Frameworks/JavaVM.framework/
> >> Versions/1.3.1/Home/lib/ext/
> >> --- Output ---
> >> cp:
> >> ../ForPackageMaker/Install/System/Library/Frameworks/JavaVM.framework/
> >> Versions/1.3.1/Home/lib/ext: No such file or directory
> >> === Exit code: 1 ===
> >> ...failed PhaseScriptExecution
> >> /Users/emilianocarlesi/Desktop/rxtx-1.5-8/MACOSX_IDE/PB/
> >> build/LibSerial.build/RXTXcomm.build/BPTag004-script.sh ...
> >>
> >>
> >> in the build directory i find : the RXTXcomm.jar package, a link to it
> >> and a directory LibSerial.build.
> >> instead for the documentation i need to find here the libSerial.jnilib
> >> file.
> >>
> >>
> >>
> > Hi Emiliano
> >
> > This is probably my mistake. Could you email me the link to where you
> > got
> > rxtx-2.1-7pre16.tar.gz and I'll make sure it is corrected.
> >
> > Zystem was/is a debug library for w32 I threw together to figure out
> > some
> > timing issues. It prints out debug messages with timestamps.
> > Obviously
> > you dont need it.
> >
> > I thought I had caught that in time. The correction is to change the
> > files to not use Zystem.
> > _______________________________________________
> > Rxtx mailing list
> > Rxtx@linuxgrrls.org
> > http://hex.linuxgrrls.org/mailman/listinfo/rxtx
> >
>
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
From emiliano at carlesi.vg Sat Jul 19 23:08:18 2003
From: emiliano at carlesi.vg (emiliano carlesi)
Date: Fri Jun 3 17:45:40 2005
Subject: [Rxtx] rxtx on osx
In-Reply-To:
Message-ID: <80DFE280-BA35-11D7-997E-000A95891300@carlesi.vg>
hi,
i try to download these files from the cvs but i can't access it. the
error is the following :
cvs login: authorization failed: server cvs.milestonesolutions.com
rejected access to /usr/local/cvsroot for user anonymous
thank you very much !!!!!!!!!!
emiliano
On Friday, Jul 18, 2003, at 22:31 Europe/Rome, Trent Jarvi wrote:
>
> Hmm OK.
>
> The Zystem.java file looks fine:
>
> static
> {
> /*
> The rxtxZystem library uses Python code and is not
> included with RXTX. A seperate library will be
> released
> to avoid potential license conflicts.
>
> Trent Jarvi taj@www.linux.org.uk
> */
>
> //System.loadLibrary( "rxtxZystem" );
> mode = SILENT_MODE;
> }
>
> I suspect the following is causing the compiler error
>
> RXTXPort.java: private static Zystem z;
> RXTXPort.java: z = new Zystem( Zystem.SILENT_MODE );
>
> I'm not familiar with the Mac OS X build but I suspect it needs to have
> Zystem.java and UnSupportedLoggerException.java added. These files
> are in
> the src/ directory. Nothing else should be required.
>
> These two files are new in the 2.1-7pre series. Dmitry may have these
> fixed in CVS. You could try checking out the CVS files if you have cvs
> installed:
>
> export
> CVSROOT=:pserver:anonymous@cvs.milestonesolutions.com:/usr/local/
> cvsroot
> cvs login (password is mousy)
> cvs checkout -r commapi-0-0-1 rxtx-devel
>
> It may be that rxtx 2-1.6 was the last release that compiled on Mac OS
> X
> and we need to get some fixes in. Dmitry can be of more help here.
> He should be on the mail list but can also be reached at
> dmarkman@mac.com.
>
> Please let us know how things go so we can fix it for others.
>
> On Sat, 19 Jul 2003, emiliano carlesi wrote:
>
>> hi trent,
>> i found the package on the ftp ftp://jarvi.dsl.frii.com/pub and i
>> have
>> download the latest in time order.
>> which version you think i can download ?
>> thank you very much for the speed in the response !!!!!
>>
>> ciao
>> emiliano
>>
>> On Friday, Jul 18, 2003, at 21:56 Europe/Rome, Trent Jarvi wrote:
>>
>>>
>>>
>>> On Sat, 19 Jul 2003, emiliano carlesi wrote:
>>>
>>>> hi to all !
>>>> this is my first mail in this ml ... so excuse if the question is
>>>> stupid !
>>>>
>>>> i use osx and i need to use my cell phone via bluetooth, with java.
>>>>
>>>> i have create the serial bluetooth link with the phone and from the
>>>> zterm console all work well.
>>>>
>>>> now i need to do the same think from my program.
>>>>
>>>> i write to the apple dev ml and all reply me to use the rxtx.
>>>>
>>>> then i download rxtx and i try to compile it, following the
>>>> instructions. i have the version rxtx-2.1-7pre16.
>>>> i read on the instruction for osx users (using project builder). i
>>>> open the project the i need to compile
>>>> the target libSerial.jnilib, but i have not this target in this
>>>> project, i have only the librxtxSerial.jnilib target.
>>>> then i try to compile this. the compiler end with error because it
>>>> don't find the Zystem package.
>>>> i search on the rxtx site but i don't find nothing about this
>>>> package.
>>>>
>>>> i try then to download the previous version, the 1.5 (i see there
>>>> are
>>>> some pointer to this version in the docs).
>>>> after the download (version 1.5-8) i try to compile and in this
>>>> project
>>>> i find the LibSerial.jnilib target !
>>>> very happy i try to compile this and the compilation ... fail :-(
>>>>
>>>> this is the error :
>>>>
>>>> #!/bin/tcsh
>>>> cp build/RXTXcomm.jar
>>>> ../ForPackageMaker/Install/System/Library/Frameworks/
>>>> JavaVM.framework/
>>>> Versions/1.3.1/Home/lib/ext/
>>>> --- Output ---
>>>> cp:
>>>> ../ForPackageMaker/Install/System/Library/Frameworks/
>>>> JavaVM.framework/
>>>> Versions/1.3.1/Home/lib/ext: No such file or directory
>>>> === Exit code: 1 ===
>>>> ...failed PhaseScriptExecution
>>>> /Users/emilianocarlesi/Desktop/rxtx-1.5-8/MACOSX_IDE/PB/
>>>> build/LibSerial.build/RXTXcomm.build/BPTag004-script.sh ...
>>>>
>>>>
>>>> in the build directory i find : the RXTXcomm.jar package, a link to
>>>> it
>>>> and a directory LibSerial.build.
>>>> instead for the documentation i need to find here the
>>>> libSerial.jnilib
>>>> file.
>>>>
>>>>
>>>>
>>> Hi Emiliano
>>>
>>> This is probably my mistake. Could you email me the link to where
>>> you
>>> got
>>> rxtx-2.1-7pre16.tar.gz and I'll make sure it is corrected.
>>>
>>> Zystem was/is a debug library for w32 I threw together to figure out
>>> some
>>> timing issues. It prints out debug messages with timestamps.
>>> Obviously
>>> you dont need it.
>>>
>>> I thought I had caught that in time. The correction is to change the
>>> files to not use Zystem.
>>> _______________________________________________
>>> Rxtx mailing list
>>> Rxtx@linuxgrrls.org
>>> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>>>
>>
>> _______________________________________________
>> Rxtx mailing list
>> Rxtx@linuxgrrls.org
>> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>>
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
From taj at linuxgrrls.org Fri Jul 18 23:20:40 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 17:45:40 2005
Subject: [Rxtx] rxtx on osx
In-Reply-To: <80DFE280-BA35-11D7-997E-000A95891300@carlesi.vg>
References: <80DFE280-BA35-11D7-997E-000A95891300@carlesi.vg>
Message-ID:
hmm. Could you try again? I saw an error the first time I tried. Maybe
Ken saw something in the logs and fixed it.
$ export CVSROOT=:pserver:anonymous@cvs.milestonesolutions
$ cvs login
Logging in to :pserver:anonymous@cvs.milestonesolutions.com:2401/usr/local/cvsroot
CVS password: (I typed "mousy" here)
$ cvs checkout -r commapi-0-0-1 rxtx-devel
cvs server: Updating rxtx-devel
U rxtx-devel/.cvsignore
U rxtx-devel/AUTHORS
U rxtx-devel/BeOS
...
On Sun, 20 Jul 2003, emiliano carlesi wrote:
> hi,
> i try to download these files from the cvs but i can't access it. the
> error is the following :
> cvs login: authorization failed: server cvs.milestonesolutions.com
> rejected access to /usr/local/cvsroot for user anonymous
>
> thank you very much !!!!!!!!!!
>
> emiliano
>
>
> On Friday, Jul 18, 2003, at 22:31 Europe/Rome, Trent Jarvi wrote:
>
> >
> > Hmm OK.
> >
> > The Zystem.java file looks fine:
> >
> > static
> > {
> > /*
> > The rxtxZystem library uses Python code and is not
> > included with RXTX. A seperate library will be
> > released
> > to avoid potential license conflicts.
> >
> > Trent Jarvi taj@www.linux.org.uk
> > */
> >
> > //System.loadLibrary( "rxtxZystem" );
> > mode = SILENT_MODE;
> > }
> >
> > I suspect the following is causing the compiler error
> >
> > RXTXPort.java: private static Zystem z;
> > RXTXPort.java: z = new Zystem( Zystem.SILENT_MODE );
> >
> > I'm not familiar with the Mac OS X build but I suspect it needs to have
> > Zystem.java and UnSupportedLoggerException.java added. These files
> > are in
> > the src/ directory. Nothing else should be required.
> >
> > These two files are new in the 2.1-7pre series. Dmitry may have these
> > fixed in CVS. You could try checking out the CVS files if you have cvs
> > installed:
> >
> > export
> > CVSROOT=:pserver:anonymous@cvs.milestonesolutions.com:/usr/local/
> > cvsroot
> > cvs login (password is mousy)
> > cvs checkout -r commapi-0-0-1 rxtx-devel
> >
> > It may be that rxtx 2-1.6 was the last release that compiled on Mac OS
> > X
> > and we need to get some fixes in. Dmitry can be of more help here.
> > He should be on the mail list but can also be reached at
> > dmarkman@mac.com.
> >
> > Please let us know how things go so we can fix it for others.
> >
> > On Sat, 19 Jul 2003, emiliano carlesi wrote:
> >
> >> hi trent,
> >> i found the package on the ftp ftp://jarvi.dsl.frii.com/pub and i
> >> have
> >> download the latest in time order.
> >> which version you think i can download ?
> >> thank you very much for the speed in the response !!!!!
> >>
> >> ciao
> >> emiliano
> >>
> >> On Friday, Jul 18, 2003, at 21:56 Europe/Rome, Trent Jarvi wrote:
> >>
> >>>
> >>>
> >>> On Sat, 19 Jul 2003, emiliano carlesi wrote:
> >>>
> >>>> hi to all !
> >>>> this is my first mail in this ml ... so excuse if the question is
> >>>> stupid !
> >>>>
> >>>> i use osx and i need to use my cell phone via bluetooth, with java.
> >>>>
> >>>> i have create the serial bluetooth link with the phone and from the
> >>>> zterm console all work well.
> >>>>
> >>>> now i need to do the same think from my program.
> >>>>
> >>>> i write to the apple dev ml and all reply me to use the rxtx.
> >>>>
> >>>> then i download rxtx and i try to compile it, following the
> >>>> instructions. i have the version rxtx-2.1-7pre16.
> >>>> i read on the instruction for osx users (using project builder). i
> >>>> open the project the i need to compile
> >>>> the target libSerial.jnilib, but i have not this target in this
> >>>> project, i have only the librxtxSerial.jnilib target.
> >>>> then i try to compile this. the compiler end with error because it
> >>>> don't find the Zystem package.
> >>>> i search on the rxtx site but i don't find nothing about this
> >>>> package.
> >>>>
> >>>> i try then to download the previous version, the 1.5 (i see there
> >>>> are
> >>>> some pointer to this version in the docs).
> >>>> after the download (version 1.5-8) i try to compile and in this
> >>>> project
> >>>> i find the LibSerial.jnilib target !
> >>>> very happy i try to compile this and the compilation ... fail :-(
> >>>>
> >>>> this is the error :
> >>>>
> >>>> #!/bin/tcsh
> >>>> cp build/RXTXcomm.jar
> >>>> ../ForPackageMaker/Install/System/Library/Frameworks/
> >>>> JavaVM.framework/
> >>>> Versions/1.3.1/Home/lib/ext/
> >>>> --- Output ---
> >>>> cp:
> >>>> ../ForPackageMaker/Install/System/Library/Frameworks/
> >>>> JavaVM.framework/
> >>>> Versions/1.3.1/Home/lib/ext: No such file or directory
> >>>> === Exit code: 1 ===
> >>>> ...failed PhaseScriptExecution
> >>>> /Users/emilianocarlesi/Desktop/rxtx-1.5-8/MACOSX_IDE/PB/
> >>>> build/LibSerial.build/RXTXcomm.build/BPTag004-script.sh ...
> >>>>
> >>>>
> >>>> in the build directory i find : the RXTXcomm.jar package, a link to
> >>>> it
> >>>> and a directory LibSerial.build.
> >>>> instead for the documentation i need to find here the
> >>>> libSerial.jnilib
> >>>> file.
> >>>>
> >>>>
> >>>>
> >>> Hi Emiliano
> >>>
> >>> This is probably my mistake. Could you email me the link to where
> >>> you
> >>> got
> >>> rxtx-2.1-7pre16.tar.gz and I'll make sure it is corrected.
> >>>
> >>> Zystem was/is a debug library for w32 I threw together to figure out
> >>> some
> >>> timing issues. It prints out debug messages with timestamps.
> >>> Obviously
> >>> you dont need it.
> >>>
> >>> I thought I had caught that in time. The correction is to change the
> >>> files to not use Zystem.
> >>> _______________________________________________
> >>> Rxtx mailing list
> >>> Rxtx@linuxgrrls.org
> >>> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
> >>>
> >>
> >> _______________________________________________
> >> Rxtx mailing list
> >> Rxtx@linuxgrrls.org
> >> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
> >>
> > _______________________________________________
> > Rxtx mailing list
> > Rxtx@linuxgrrls.org
> > http://hex.linuxgrrls.org/mailman/listinfo/rxtx
> >
>
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
From emiliano at carlesi.vg Sun Jul 20 00:21:11 2003
From: emiliano at carlesi.vg (emiliano carlesi)
Date: Fri Jun 3 17:45:40 2005
Subject: [Rxtx] rxtx on osx
In-Reply-To:
Message-ID:
ok !!!
i have downloaded the rxtx-devel, compiled, and installed. i try a
sample and work !!!!
i have only changed the property of the files Zystem.java and
UnSupportedLoggerException.java
in the project because the reference are fixed with the path of another
machine (absolute path)
thank you very very much !!!!!!!!!!!!!!!
ciao
emiliano
On Saturday, Jul 19, 2003, at 00:20 Europe/Rome, Trent Jarvi wrote:
>
> hmm. Could you try again? I saw an error the first time I tried.
> Maybe
> Ken saw something in the logs and fixed it.
>
> $ export CVSROOT=:pserver:anonymous@cvs.milestonesolutions
> $ cvs login
> Logging in to
> :pserver:anonymous@cvs.milestonesolutions.com:2401/usr/local/cvsroot
> CVS password: (I typed "mousy" here)
> $ cvs checkout -r commapi-0-0-1 rxtx-devel
> cvs server: Updating rxtx-devel
> U rxtx-devel/.cvsignore
> U rxtx-devel/AUTHORS
> U rxtx-devel/BeOS
> ...
>
> On Sun, 20 Jul 2003, emiliano carlesi wrote:
>
>> hi,
>> i try to download these files from the cvs but i can't access it.
>> the
>> error is the following :
>> cvs login: authorization failed: server cvs.milestonesolutions.com
>> rejected access to /usr/local/cvsroot for user anonymous
>>
>> thank you very much !!!!!!!!!!
>>
>> emiliano
>>
>>
>> On Friday, Jul 18, 2003, at 22:31 Europe/Rome, Trent Jarvi wrote:
>>
>>>
>>> Hmm OK.
>>>
>>> The Zystem.java file looks fine:
>>>
>>> static
>>> {
>>> /*
>>> The rxtxZystem library uses Python code and is not
>>> included with RXTX. A seperate library will be
>>> released
>>> to avoid potential license conflicts.
>>>
>>> Trent Jarvi taj@www.linux.org.uk
>>> */
>>>
>>> //System.loadLibrary( "rxtxZystem" );
>>> mode = SILENT_MODE;
>>> }
>>>
>>> I suspect the following is causing the compiler error
>>>
>>> RXTXPort.java: private static Zystem z;
>>> RXTXPort.java: z = new Zystem( Zystem.SILENT_MODE );
>>>
>>> I'm not familiar with the Mac OS X build but I suspect it needs to
>>> have
>>> Zystem.java and UnSupportedLoggerException.java added. These files
>>> are in
>>> the src/ directory. Nothing else should be required.
>>>
>>> These two files are new in the 2.1-7pre series. Dmitry may have
>>> these
>>> fixed in CVS. You could try checking out the CVS files if you have
>>> cvs
>>> installed:
>>>
>>> export
>>> CVSROOT=:pserver:anonymous@cvs.milestonesolutions.com:/usr/local/
>>> cvsroot
>>> cvs login (password is mousy)
>>> cvs checkout -r commapi-0-0-1 rxtx-devel
>>>
>>> It may be that rxtx 2-1.6 was the last release that compiled on Mac
>>> OS
>>> X
>>> and we need to get some fixes in. Dmitry can be of more help here.
>>> He should be on the mail list but can also be reached at
>>> dmarkman@mac.com.
>>>
>>> Please let us know how things go so we can fix it for others.
>>>
>>> On Sat, 19 Jul 2003, emiliano carlesi wrote:
>>>
>>>> hi trent,
>>>> i found the package on the ftp ftp://jarvi.dsl.frii.com/pub and i
>>>> have
>>>> download the latest in time order.
>>>> which version you think i can download ?
>>>> thank you very much for the speed in the response !!!!!
>>>>
>>>> ciao
>>>> emiliano
>>>>
>>>> On Friday, Jul 18, 2003, at 21:56 Europe/Rome, Trent Jarvi wrote:
>>>>
>>>>>
>>>>>
>>>>> On Sat, 19 Jul 2003, emiliano carlesi wrote:
>>>>>
>>>>>> hi to all !
>>>>>> this is my first mail in this ml ... so excuse if the question
>>>>>> is
>>>>>> stupid !
>>>>>>
>>>>>> i use osx and i need to use my cell phone via bluetooth, with
>>>>>> java.
>>>>>>
>>>>>> i have create the serial bluetooth link with the phone and from
>>>>>> the
>>>>>> zterm console all work well.
>>>>>>
>>>>>> now i need to do the same think from my program.
>>>>>>
>>>>>> i write to the apple dev ml and all reply me to use the rxtx.
>>>>>>
>>>>>> then i download rxtx and i try to compile it, following the
>>>>>> instructions. i have the version rxtx-2.1-7pre16.
>>>>>> i read on the instruction for osx users (using project builder).
>>>>>> i
>>>>>> open the project the i need to compile
>>>>>> the target libSerial.jnilib, but i have not this target in this
>>>>>> project, i have only the librxtxSerial.jnilib target.
>>>>>> then i try to compile this. the compiler end with error because it
>>>>>> don't find the Zystem package.
>>>>>> i search on the rxtx site but i don't find nothing about this
>>>>>> package.
>>>>>>
>>>>>> i try then to download the previous version, the 1.5 (i see there
>>>>>> are
>>>>>> some pointer to this version in the docs).
>>>>>> after the download (version 1.5-8) i try to compile and in this
>>>>>> project
>>>>>> i find the LibSerial.jnilib target !
>>>>>> very happy i try to compile this and the compilation ... fail :-(
>>>>>>
>>>>>> this is the error :
>>>>>>
>>>>>> #!/bin/tcsh
>>>>>> cp build/RXTXcomm.jar
>>>>>> ../ForPackageMaker/Install/System/Library/Frameworks/
>>>>>> JavaVM.framework/
>>>>>> Versions/1.3.1/Home/lib/ext/
>>>>>> --- Output ---
>>>>>> cp:
>>>>>> ../ForPackageMaker/Install/System/Library/Frameworks/
>>>>>> JavaVM.framework/
>>>>>> Versions/1.3.1/Home/lib/ext: No such file or directory
>>>>>> === Exit code: 1 ===
>>>>>> ...failed PhaseScriptExecution
>>>>>> /Users/emilianocarlesi/Desktop/rxtx-1.5-8/MACOSX_IDE/
>>>>>> PB/
>>>>>> build/LibSerial.build/RXTXcomm.build/BPTag004-script.sh ...
>>>>>>
>>>>>>
>>>>>> in the build directory i find : the RXTXcomm.jar package, a link
>>>>>> to
>>>>>> it
>>>>>> and a directory LibSerial.build.
>>>>>> instead for the documentation i need to find here the
>>>>>> libSerial.jnilib
>>>>>> file.
>>>>>>
>>>>>>
>>>>>>
>>>>> Hi Emiliano
>>>>>
>>>>> This is probably my mistake. Could you email me the link to where
>>>>> you
>>>>> got
>>>>> rxtx-2.1-7pre16.tar.gz and I'll make sure it is corrected.
>>>>>
>>>>> Zystem was/is a debug library for w32 I threw together to figure
>>>>> out
>>>>> some
>>>>> timing issues. It prints out debug messages with timestamps.
>>>>> Obviously
>>>>> you dont need it.
>>>>>
>>>>> I thought I had caught that in time. The correction is to change
>>>>> the
>>>>> files to not use Zystem.
>>>>> _______________________________________________
>>>>> Rxtx mailing list
>>>>> Rxtx@linuxgrrls.org
>>>>> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>>>>>
>>>>
>>>> _______________________________________________
>>>> Rxtx mailing list
>>>> Rxtx@linuxgrrls.org
>>>> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>>>>
>>> _______________________________________________
>>> Rxtx mailing list
>>> Rxtx@linuxgrrls.org
>>> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>>>
>>
>> _______________________________________________
>> Rxtx mailing list
>> Rxtx@linuxgrrls.org
>> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>>
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
From ricardo.trindade at emation.pt Sun Jul 20 17:27:37 2003
From: ricardo.trindade at emation.pt (Ricardo Trindade)
Date: Fri Jun 3 17:45:40 2005
Subject: [Rxtx] loading .dll or .so from jar
In-Reply-To:
Message-ID:
answers inline
OK. Lets start with Unix which I'm more familiar with than w32. There
are two places these files would be allowed to be extracted:
~/ (the users home directory such as /home/jarvi
/tmp /usr/tmp /usr/local/tmp - one of the tmp directories
RT : why not the current dir ? Or better yet, providing one of the above as
default, but allowing the user to specify the directory ?
When applications do this they usually use a dot directory. If its in a
tmp directory then cleanup is expected to be done afterwards. Lets just
look at the home directory.
/home/jarvi/.rxtx The home direcotry could be shared across
multiple OS's and archs via NFS, SMB, ... so there would have
to be subdirecotries for OS and arch. solaris/i386 for instance.
R: why ? the filename is different, they could all live alongside
Writing to the system/jre/jdk directories would be bad form and users
will typically not have permission anyhow.
r: agreed. bad.
In order for this to automatically happen, The lockfile feature would have
to be disabled. This means a person using this library could open say a
modem being used by another user and interfere with communications.
R: why ?
I'm not sure at all what would be acceptable in a modern NT environment.
Does anyone know what would be done as a user on say w2003? There are
probably simular issues and solutions.
R: I think there are several user classes here. I can imagine a end user
using a desktop app, in that case it should go to the home directory, either
in windows or linux, as he won't have system permission.
We, on the other hand, develop industrial and other unatended systems and
would like to extract the lib to the directory of our choice, perhaps
current, or /tmp.
I really think it should be configurable, but with a sane default (like ~)
for end users.
From nsayer at quack.kfu.com Tue Jul 22 08:30:47 2003
From: nsayer at quack.kfu.com (Nick Sayer)
Date: Fri Jun 3 17:45:40 2005
Subject: [Rxtx] RXTX javax.comm user
Message-ID: <69BB7F1A-BC16-11D7-BD11-000A9575D7CC@kfu.com>
MacXM (sf.net/projects/macxm) got ported to javax.comm this weekend.
The onyl problem is that it appears impossible for System.loadLibrary()
to actually find and load the JNI unless it's installed (as opposed to
simply hitchhiking in with the rest of the classes.
From cdaller at iicm.tu-graz.ac.at Thu Jul 24 10:39:37 2003
From: cdaller at iicm.tu-graz.ac.at (Christof Dallermassl)
Date: Fri Jun 3 17:45:40 2005
Subject: [Rxtx] high cpu load on mac os x
Message-ID: <16159.43353.831354.984153@fiicmpc57.tu-graz.ac.at>
Hi!
My gps applicaiton (http://gpsmap.sf.net) uses the comm api to
communicate with the gps devices. Everything works fine on
linux/windows. But on a mac the process of reading from the serial
device uses lots of cpu cycles.
The BlackBox application (example app from sun's comm.api) uses nearly
half of the cpu power just to read some data from the serial gps
device (well actually, it is a usb-serial converter, could this be the
problem?)
Is there anyone having similar problems?
The system is a
Darwin Kernel System 6.6
As my experience with macintosh computers is nearly non-existent, I
would be very happy if someone could tell me, how to overcome this cpu
hunger.
mit freundlichen Gruessen
Christof
--
---------------------------------------------------------------------------
Christof Dallermassl / Institute for Information Processing and Computer
cdaller@iicm.edu / Supported new Media, Graz University of Technology
---------------------------------------------------------------------------
Dino Developer Community - be a part of it - http://www.dinopolis.org
From taj at linuxgrrls.org Thu Jul 24 16:23:07 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 17:45:40 2005
Subject: [Rxtx] high cpu load on mac os x
In-Reply-To: <16159.43353.831354.984153@fiicmpc57.tu-graz.ac.at>
References: <16159.43353.831354.984153@fiicmpc57.tu-graz.ac.at>
Message-ID:
On Thu, 24 Jul 2003, Christof Dallermassl wrote:
> Hi!
>
> My gps applicaiton (http://gpsmap.sf.net) uses the comm api to
> communicate with the gps devices. Everything works fine on
> linux/windows. But on a mac the process of reading from the serial
> device uses lots of cpu cycles.
>
> The BlackBox application (example app from sun's comm.api) uses nearly
> half of the cpu power just to read some data from the serial gps
> device (well actually, it is a usb-serial converter, could this be the
> problem?)
>
> Is there anyone having similar problems?
>
> The system is a
> Darwin Kernel System 6.6
>
> As my experience with macintosh computers is nearly non-existent, I
> would be very happy if someone could tell me, how to overcome this cpu
> hunger.
>
Hi Christopher
I don't have a Mac OS X system but can guess what is going on here and
make some suggestions as to where to look.
There are about three locations where rxtx will run select() in
SerialImp.c waiting for the port to change. The code will be something
like:
ret=SELECT( fd + 1, &rfds, NULL, NULL, psleep );
the two places I can think of right off are the eventLoop() which would
be waiting for the port to change so it can send events and
read_byte_array() which any read() will end up in.
The potential problem is select() does not block while data is available.
One can change the code by adding usleep(1000) - a 1 millisecond sleep -
in suspect areas to keep the loop from spinning.
I can picture CPU use going high if you generally sit with data available
on the port rather than reading it on the DATAAVAILABLE event. You may
try slowing things down with usleep() as mentioned. Without a box to play
with I can just give the hint that the code is most likely spinning around
the select call.
From cdaller at iicm.tu-graz.ac.at Thu Jul 24 16:35:21 2003
From: cdaller at iicm.tu-graz.ac.at (Christof Dallermassl)
Date: Fri Jun 3 17:45:40 2005
Subject: [Rxtx] high cpu load on mac os x
In-Reply-To:
References: <16159.43353.831354.984153@fiicmpc57.tu-graz.ac.at>
Message-ID: <16159.64697.763407.981482@fiicmpc57.tu-graz.ac.at>
Hi Trent,
thanks for your quick response. As I do not have direct access to a
Mac box either, I will forward your description to the user that
reported the problems to me!
Thanks a lot for your answer, I will tell you the results as soon as I
hear of.
Trent> On Thu, 24 Jul 2003, Christof Dallermassl wrote:
>> Hi!
>>
>> My gps applicaiton (http://gpsmap.sf.net) uses the comm api to
>> communicate with the gps devices. Everything works fine on
>> linux/windows. But on a mac the process of reading from the serial
>> device uses lots of cpu cycles.
>>
>> The BlackBox application (example app from sun's comm.api) uses nearly
>> half of the cpu power just to read some data from the serial gps
>> device (well actually, it is a usb-serial converter, could this be the
>> problem?)
>>
>> Is there anyone having similar problems?
>>
>> The system is a
>> Darwin Kernel System 6.6
>>
>> As my experience with macintosh computers is nearly non-existent, I
>> would be very happy if someone could tell me, how to overcome this cpu
>> hunger.
>>
Trent> Hi Christopher
Trent> I don't have a Mac OS X system but can guess what is going on here and
Trent> make some suggestions as to where to look.
Trent> There are about three locations where rxtx will run select() in
Trent> SerialImp.c waiting for the port to change. The code will be something
Trent> like:
Trent> ret=SELECT( fd + 1, &rfds, NULL, NULL, psleep );
Trent> the two places I can think of right off are the eventLoop() which would
Trent> be waiting for the port to change so it can send events and
Trent> read_byte_array() which any read() will end up in.
Trent> The potential problem is select() does not block while data is available.
Trent> One can change the code by adding usleep(1000) - a 1 millisecond sleep -
Trent> in suspect areas to keep the loop from spinning.
Trent> I can picture CPU use going high if you generally sit with data available
Trent> on the port rather than reading it on the DATAAVAILABLE event. You may
Trent> try slowing things down with usleep() as mentioned. Without a box to play
Trent> with I can just give the hint that the code is most likely spinning around
Trent> the select call.
Trent> _______________________________________________
Trent> Rxtx mailing list
Trent> Rxtx@linuxgrrls.org
Trent> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
mit freundlichen Gruessen
Christof
--
---------------------------------------------------------------------------
Christof Dallermassl / Institute for Information Processing and Computer
cdaller@iicm.edu / Supported new Media, Graz University of Technology
---------------------------------------------------------------------------
Dino Developer Community - be a part of it - http://www.dinopolis.org
From taj at parcelfarce.linux.theplanet.co.uk Fri Jul 25 15:17:47 2003
From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk)
Date: Fri Jun 3 17:45:40 2005
Subject: [Rxtx] Re: [adding ports on Linux] WG: Other Problem
In-Reply-To:
Message-ID:
I'm actually sitting in a talk right now about how information will be
shared in the linux kernel to user space that will allow better
enumeration. Right now you will have to add a hack like the following.
--- RXTXCommDriver.java 2003-04-04 12:54:38.000000000 -0700
+++ RXTXCommDriver.java.new 2003-07-25 08:16:05.000000000 -0600
@@ -491,6 +491,7 @@
{
String[] Temp = {
"ttyS", // linux Serial Ports
+ "ttyn", // Daniel's Ports
"ttySA" // for the IPAQs
};
CandidatePortPrefixes=Temp;
On Fri, 25 Jul 2003, Daniel Schmoll / BDC EDV-Consulting wrote:
> HI!
>
> It's me again!
> I have one more problem/question!
>
> Wie have a driver(+Hardware) which emulate com ports (/dev/ttySxx). But
> the new driver (for RedHat 9 and Suse 8.2) didn't suppurt manual
> renaming of the virtual com ports. For example wie have /dev/ttyn10
> instead of /dev/ttyS10. This is a problem with your RXTX classes,
> because your classes can only find the com ports if they have a name
> like ttySxx. Is there any possibility that your classes can find ports
> with other names?
>
> Thanks for your help!
>
> Daniel Schmoll
>
>
--
Trent Jarvi
taj@www.linux.org.uk
From rsumit_2001 at yahoo.co.in Sat Jul 26 08:10:41 2003
From: rsumit_2001 at yahoo.co.in (=?iso-8859-1?q?Sumit?=)
Date: Fri Jun 3 17:45:40 2005
Subject: [Rxtx] Java and Multiport serial port
Message-ID: <20030726071041.8023.qmail@web8005.mail.in.yahoo.com>
Hi
I am trying to establish serial communication via
one of the port of RocketPort multiport serial Port
using Java 1.4 on RH 9.0. I had installed rxtx as a
comm
package(http://wass.homelinux.net/howtos/Comm_How-To.shtml)
For the code
-------------------------------------------------
String commPort ="/dev/ttyR6";
CommPortIdentifier portId =
CommPortIdentifier.getPortIdentifier ( commPort );
--------------------------------------------------
Things work fine if I use commPort ="/dev/ttyS0" but
with "/dev/ttyR6"(which is one of the rocketport port)
it causes exception.
The card is properly configured and I had tested
/dev/ttyR6 is working using od -tx1 /dev/ttyR6. I am
executing all this as root.
Moreover using
Enumeration ports =
CommPortIdentifier.getPortIdentifiers();
and listing the ports list only /dev/ttyS0 and
/dev/lp0 as the available ports.
I am quite new to Java, so I am not sure, but do I
need to use CommPortIdentifier.addPortName to add the
/dev/ttyR0-6 port.
Thanks,
Sumit
=====
The essence of knowledge is, having it, to apply it; not having it, to confess your ignorance.
Confucius BC 551-479, Chinese Ethical Teacher, Philosopher
________________________________________________________________________
Send free SMS using the Yahoo! Messenger. Go to http://in.mobile.yahoo.com/new/pc/
From taj at linuxgrrls.org Sat Jul 26 20:58:34 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 17:45:40 2005
Subject: [Rxtx] Java and Multiport serial port
In-Reply-To: <20030726071041.8023.qmail@web8005.mail.in.yahoo.com>
References: <20030726071041.8023.qmail@web8005.mail.in.yahoo.com>
Message-ID:
Here is the deal. We used to enumerate all ports on all multiport cards.
It then became painfully obviously that this was taking too long. At that
point we commented the code that enumerates all known serial ports.
The short term fix is to either add your port of interest or revert to the
slower code that enumerates all ports. 99% of the users dont need more
than /dev/ttyS so we went with that and the arm ports.
A typical patch which was just posted to the list looks like this:
--- RXTXCommDriver.java 2003-04-04 12:54:38.000000000 -0700
+++ RXTXCommDriver.java.new 2003-07-25 08:16:05.000000000 -0600
@@ -491,6 +491,7 @@
{
String[] Temp = {
"ttyS", // linux SerialPorts
+ "ttyX", // My Ports
"ttySA" // for the IPAQs
};
CandidatePortPrefixes=Temp;
A quick and dirty solution is to rename /dev/ttyR* /dev/ttyS*. The device
minor and major numbers are all that is required. THe filename is for
convenience.
There are much better solutions comming in perhaps 2.6 kernels. The
kernel already enumerates the ports and the kernel developers are going to
expose this information to user space so rxtx will be able to quickly
enumerate whatever the kernel knows about.
On Sat, 26 Jul 2003, [iso-8859-1] Sumit wrote:
> Hi
> I am trying to establish serial communication via
> one of the port of RocketPort multiport serial Port
> using Java 1.4 on RH 9.0. I had installed rxtx as a
> comm
> package(http://wass.homelinux.net/howtos/Comm_How-To.shtml)
>
> For the code
> -------------------------------------------------
> String commPort ="/dev/ttyR6";
> CommPortIdentifier portId =
> CommPortIdentifier.getPortIdentifier ( commPort );
> --------------------------------------------------
> Things work fine if I use commPort ="/dev/ttyS0" but
> with "/dev/ttyR6"(which is one of the rocketport port)
> it causes exception.
>
> The card is properly configured and I had tested
> /dev/ttyR6 is working using od -tx1 /dev/ttyR6. I am
> executing all this as root.
>
>
> Moreover using
> Enumeration ports =
> CommPortIdentifier.getPortIdentifiers();
>
> and listing the ports list only /dev/ttyS0 and
> /dev/lp0 as the available ports.
>
> I am quite new to Java, so I am not sure, but do I
> need to use CommPortIdentifier.addPortName to add the
> /dev/ttyR0-6 port.
>
>
> Thanks,
> Sumit
>
>
>
> =====
>
> The essence of knowledge is, having it, to apply it; not having it, to confess your ignorance.
> Confucius BC 551-479, Chinese Ethical Teacher, Philosopher
>
>
>
>
> ________________________________________________________________________
> Send free SMS using the Yahoo! Messenger. Go to http://in.mobile.yahoo.com/new/pc/
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
From rsumit_2001 at yahoo.co.in Sun Jul 27 01:45:57 2003
From: rsumit_2001 at yahoo.co.in (=?iso-8859-1?q?Sumit?=)
Date: Fri Jun 3 17:45:40 2005
Subject: [Rxtx] Java and Multiport serial port
In-Reply-To:
Message-ID: <20030727004557.58908.qmail@web8007.mail.in.yahoo.com>
Hi Trent,
--- Trent Jarvi wrote: >
>
>
> A typical patch which was just posted to the list
> looks like this:
Just two more question:
(a) Is it possible to get the archives of this
mailing list. The link on
http://www.linuxgrrls.org/mailman/listinfo/rxtx/ to
the archives does not work.
(b) From where can I get the source code to make the
change you suggested. I downloaded the package from
http://www.linux.org.uk/~taj/rxtx-bins.1.tar.gz
>
> A quick and dirty solution is to rename /dev/ttyR*
> /dev/ttyS*.
I tried this and it worked.
Thanks however for the help. Atleast I now have one
way of getting things done.
Sumit
=====
The essence of knowledge is, having it, to apply it; not having it, to confess your ignorance.
Confucius BC 551-479, Chinese Ethical Teacher, Philosopher
________________________________________________________________________
Send free SMS using the Yahoo! Messenger. Go to http://in.mobile.yahoo.com/new/pc/
From minyal at nortelnetworks.com Mon Jul 28 16:09:23 2003
From: minyal at nortelnetworks.com (Minya Liang)
Date: Fri Jun 3 17:45:41 2005
Subject: [Rxtx] Java and Multiport serial port
Message-ID: <870397D7C140C84DB081B88396458DAFB525AD@zrc2c000.us.nortel.com>
pass the following property to the VM
-Dgnu.io.rxtx.SerialPorts=/dev/ttyR6:/dev/ttyS0:
this is because the rocketport serial ports are named /dev/ttyR*, and by
default, only the well-known ports (/dev/ttyS* and /dev/ttym* and /dev/lp*,
etc) are scanned.
the "INSTALL" file in the rxtx directory also mentioned about this.
LMY
-----Original Message-----
From: Sumit [mailto:rsumit_2001@yahoo.co.in]
Sent: Saturday, July 26, 2003 2:11 AM
To: rxtx@linuxgrrls.org
Subject: [Rxtx] Java and Multiport serial port
Hi
I am trying to establish serial communication via
one of the port of RocketPort multiport serial Port
using Java 1.4 on RH 9.0. I had installed rxtx as a
comm
package(http://wass.homelinux.net/howtos/Comm_How-To.shtml)
For the code
-------------------------------------------------
String commPort ="/dev/ttyR6";
CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier ( commPort
);
--------------------------------------------------
Things work fine if I use commPort ="/dev/ttyS0" but
with "/dev/ttyR6"(which is one of the rocketport port)
it causes exception.
The card is properly configured and I had tested
/dev/ttyR6 is working using od -tx1 /dev/ttyR6. I am
executing all this as root.
Moreover using
Enumeration ports =
CommPortIdentifier.getPortIdentifiers();
and listing the ports list only /dev/ttyS0 and
/dev/lp0 as the available ports.
I am quite new to Java, so I am not sure, but do I
need to use CommPortIdentifier.addPortName to add the /dev/ttyR0-6 port.
Thanks,
Sumit
=====
The essence of knowledge is, having it, to apply it; not having it, to
confess your ignorance.
Confucius BC 551-479, Chinese Ethical Teacher, Philosopher
________________________________________________________________________
Send free SMS using the Yahoo! Messenger. Go to
http://in.mobile.yahoo.com/new/pc/
_______________________________________________
Rxtx mailing list
Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20030728/d0ff9e56/attachment-0002.htm
From maryp at magiclamp.org Tue Jul 29 21:04:00 2003
From: maryp at magiclamp.org (Mary Pietrowicz)
Date: Fri Jun 3 17:45:41 2005
Subject: [Rxtx] Fwd: Re: error in latest pre-release
Message-ID: <5.1.1.6.0.20030729143533.00b7ffd0@magiclamp.org>
Hi,
I've run into the error below in running the latest rxtx on Windows (see
below):
no rxtxZystem in java.library.path
I tried to use the dll downloaded from
ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/i386-pc-mingw/
Is there a new build available?
Also, should the jar file be named comm.jar?
Thanks very much,
Mary
>Envelope-to: maryp@magiclamp.org
>Delivered-To: rxtx-outgoing@hex.linuxgrrls.org
>Delivered-To: rxtx@hex.linuxgrrls.org
>Date: Thu, 17 Apr 2003 15:59:56 +0100 (BST)
>From: Trent Jarvi
>To: Ricardo Trindade
>Cc:
>Subject: Re: error in latest pre-release
>Sender: owner-rxtx@hex.linuxgrrls.org
>X-Spam-Status: No, hits=-25.3 required=5.0
> tests=EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT,
> REPLY_WITH_QUOTES,USER_AGENT_PINE
> autolearn=ham version=2.52
>X-Spam-Level:
>X-Spam-Checker-Version: SpamAssassin 2.52 (1.174.2.8-2003-03-24-exp)
>
>
>
>Hi Ricardo
>
>That sounds like my mistake. If you could send me the link to the file
>you downloaded, I can fix it. Zystem is a debugging library used on
>w32. The file (jar) you downlowaded needs to be compiled without Zystem.
>
>Zystem is not distributed with rxtx. Its some python code hacked to
>generate timing information as a JNI lib. I'm not sure how the licensing
>would work with it so I just pull it out.
>
>On Thu, 17 Apr 2003, Ricardo Trindade wrote:
>
> > Hi,
> >
> > I get the following error when trying to run the latest rxtx :
> >
> > no rxtxZystem in java.library.path
> >
> > I have the .dll in the right place, and if I remove it, I get the
> expected
> > :
> >
> > no rxtxSerial in java.library.path thrown while loading
> > gnu.io.RXTXCommDriver
> >
> > If find it strange that the jar has changed it's name from
> RXTXcomm.jar to
> > comm.jar. Is something wrong here ?
> >
> > I'm using jdk1.3.1_06
> >
> > any ideas ?
> >
> > thanks
> > Ricardo
> >
From d.escuro at weserv.com.ph Wed Jul 30 10:37:05 2003
From: d.escuro at weserv.com.ph (Dohnald Escuro)
Date: Fri Jun 3 17:45:41 2005
Subject: [Rxtx] infinite OUTPUT_BUFFER_EMPTY serial event
Message-ID:
Hi! I'm Vicel Borlongan from the Philippines. I've been using RXTX Comm API for
our POS project.
Just want to ask for your help regarding its implementation. I've been having
problem receiving input streams
from rxtx 2.1-6 because it seems to generates infinite OUTPUT_BUFFER_EMPTY
serial event.
Is there a way I could make the input stream behavior much like that of JAVA
Comm API where the
OUTPUT_BUFFER_EMPTY serial event stops at a certain point.
Hope you can help us on this.
Thank you.
Vicel Borlongan
-------------- next part --------------
------------------------------------------------------------------------
FPI Gateway Scanner scanned email-body and no virus found
------------------------------------------------------------------------
From maryp at magiclamp.org Wed Jul 30 19:16:49 2003
From: maryp at magiclamp.org (Mary Pietrowicz)
Date: Fri Jun 3 17:45:41 2005
Subject: [Rxtx] Application working under linux and OSX, problems with same
code on Windows
Message-ID: <5.1.1.6.0.20030730093658.00b3e3c8@magiclamp.org>
Hi,
I've been using rxtx 2.1.x to talk to RFID readers in Linux and OSX
environments. I would like to use rxtx 2.1 with my application (same code)
on Windows. I have also run the my app successfully on Windows with Sun's
comm package, but I would like to keep a common code base and use
rxtx. Here is what I have tried sofar to get things running with rxtx on
windows (below). Any help would be greatly appreciated!
Attempted to build 2.1.6 with lcc (one of the build options in the
installation instructions). Could not get a successful compile.
When I noticed that all of the Windows prereleases had been built with
mingw, I switched to those build tools and installed MinGW@-3.0.0-rc3,
gcj-3.2-20021210-1, MSYS-1.0.10-rc-1.
I'm using jdk1.4.1-b21. No comm.jar in lib\ext. :-)
I'm running Windows XP.
I attempted to build rxtx 2.1.6 from within cygwin, since that is what I
already had in my Windows environment. Makefile is attached. In my first
build attempt (ran make per instructions), I got
../src/SerialImp.c:22:20:config.h: No such file or directory. Then, I did
a "make include/config.h" to produce the config.h file.
At the next attempt, the libgcj-config file could not be found. I copied
d:\mingw
lib\gcc-lib\mingw32\3.2\include\gcj\libgcj-config.h to d:\mingw\include\gcj
where it could be found. I ran "make", no errors. Then I did a "make
install". The build process asked to copy *.c and *.java files back into
.../build/gnu/io, compiled everything again, overwrote Serial.def again,
and then copied out RXTXcomm.jar and rxtxSerial.dll. No errors. I rebuilt
my java source, and ran it from the DOS shell. I got the following runtime
error:
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x6D401C0E
Function=JVM_RegisterUnsafeMethods+0x18C
Library=d:\j2sdk1.4.1\jre\bin\client\jvm.dll
Current Java thread:
at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method)
at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:56)
at java.lang.Class.forName0
at Java.lang.Class.forName(Class.java:140)
at gnu.io.CommPortIdentifier(CommPortIdentifier.java:67)
.... Stack trace calls from my code from here
Error file hs_err_pid2244.log is attached.
I thought I might have better luck building from the MSYS shell using the
same Makefile. So, I cleaned everything out, and did a "make
include/config.h", a "make", and a "make install". I got a build - no
errors - rebuilt my code again from scratch, and ran it from the DOS
shell. I got a related runtime error:
java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading
gnu.io.RXTXCommDriver
I also tried the prebuilt prerelease.
(From ~/jarvi/rxtx//download/prerelease/2.1)
I installed RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll)
I tried to run it, and when it complained about missing Zsystem libraries,
I snagged the Zsystem-0.0-1.tar.gz and dropped Zsystem.jar into
jre\lib\ext. I rebuilt all my stuff, and tried to run again.
At run time, it confirmed the version:
Native lib Version = RXTX-2.1-7pre12
Java lib Version = RXTX-2.1-7pre12
At the point where I wrote to the serial port, and listened for a response
from the device, I got:
Error reading from the serial port: No error in readArray
java.io.IOException: No error in readArray
at gnu.io.RXTXPort.readArray(Native Method)
at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1296)
at gnu.io.BufferedInputStream.fill(BufferedInputStream.java:183)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:222)
at java.io.BufferedInputStream.read(BufferedInputStream.java:277)
at java.io.FilterInputStream.read(FilterInputStream.java:90)
... Rest is stack trace of my code
Does anyone have any thoughts?
Thanks!
Mary
-------------- next part --------------
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x6D401C0E
Function=JVM_RegisterUnsafeMethods+0x18C
Library=d:\j2sdk1.4.1\jre\bin\client\jvm.dll
Current Java thread:
at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method)
at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:56)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:140)
at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67)
at edu.iu.pervasivetechnologylabs.services.rfid.RfidListener.initialize(RfidListener.java:46)
at edu.iu.pervasivetechnologylabs.services.rfid.RfidListener.(RfidListener.java:37)
at edu.iu.pervasivetechnologylabs.services.rfid.RfidListener.main(RfidListener.java:179)
Dynamic libraries:
0x00400000 - 0x00406000 d:\j2sdk1.4.1\bin\java.exe
0x77F50000 - 0x77FF9000 C:\WINDOWS\System32\ntdll.dll
0x77E60000 - 0x77F45000 C:\WINDOWS\system32\kernel32.dll
0x77DD0000 - 0x77E5B000 C:\WINDOWS\system32\ADVAPI32.dll
0x78000000 - 0x7806E000 C:\WINDOWS\system32\RPCRT4.dll
0x77C10000 - 0x77C63000 C:\WINDOWS\system32\MSVCRT.dll
0x6D330000 - 0x6D45C000 d:\j2sdk1.4.1\jre\bin\client\jvm.dll
0x77D40000 - 0x77DC6000 C:\WINDOWS\system32\USER32.dll
0x77C70000 - 0x77CB0000 C:\WINDOWS\system32\GDI32.dll
0x76B40000 - 0x76B6C000 C:\WINDOWS\System32\WINMM.dll
0x76390000 - 0x763AA000 C:\WINDOWS\System32\IMM32.DLL
0x629C0000 - 0x629C8000 C:\WINDOWS\System32\LPK.DLL
0x72FA0000 - 0x72FFA000 C:\WINDOWS\System32\USP10.dll
0x6D1D0000 - 0x6D1D7000 d:\j2sdk1.4.1\jre\bin\hpi.dll
0x6D300000 - 0x6D30D000 d:\j2sdk1.4.1\jre\bin\verify.dll
0x6D210000 - 0x6D229000 d:\j2sdk1.4.1\jre\bin\java.dll
0x6D320000 - 0x6D32D000 d:\j2sdk1.4.1\jre\bin\zip.dll
0x003F0000 - 0x00400000 D:\j2sdk1.4.1\jre\bin\rxtxSerial.dll
0x73D90000 - 0x73DB7000 C:\WINDOWS\System32\crtdll.dll
0x76C90000 - 0x76CB2000 C:\WINDOWS\system32\imagehlp.dll
0x6D510000 - 0x6D58C000 C:\WINDOWS\system32\DBGHELP.dll
0x77C00000 - 0x77C07000 C:\WINDOWS\system32\VERSION.dll
0x76BF0000 - 0x76BFB000 C:\WINDOWS\System32\PSAPI.DLL
Local Time = Wed Jul 30 10:21:35 2003
Elapsed Time = 0
#
# HotSpot Virtual Machine Error : EXCEPTION_ACCESS_VIOLATION
# Error ID : 4F530E43505002E6
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Java VM: Java HotSpot(TM) Client VM (1.4.1-b21 mixed mode)
#
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: application/octet-stream
Size: 6353 bytes
Desc: not available
Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20030730/a0058903/Makefile-0002.obj
From taj at parcelfarce.linux.theplanet.co.uk Thu Jul 31 23:48:23 2003
From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk)
Date: Fri Jun 3 17:45:41 2005
Subject: [Rxtx] Re: USB API for w32 [was Hi!]
In-Reply-To:
Message-ID:
On Thu, 31 Jul 2003, Savio, John-Benedict-Domnic (FH) wrote:
> Hello Trent,
>
> Is there an API for USB running in the Windows OS !.
>
Hi Domnic
you may want to check out the jusb http://jusb.sourceforge.net/
I've cc'd their email list but you may want to join and ask questions
there. RXTX works with Mac OSX USB but not w32 USB.
--
Trent Jarvi
taj@www.linux.org.uk
www.rxtx.org
From phil at webwaste.de Tue Jul 1 11:48:28 2003
From: phil at webwaste.de (Philipp Hofmann)
Date: Fri Jun 3 18:07:57 2005
Subject: [Rxtx] linux, rxtx and serial ports
Message-ID: <20030701104828.GH25468@d508a.hadiko.de>
Hi,
this ist my test program. Shouldn't it print a list of valid ports? I
am especialy interested in serial ports.
$ cat Test.java
import gnu.io.*;
import java.util.Enumeration;
public class Test {
public static void main(String[] arg) {
System.out.println("start");
Enumeration e = CommPortIdentifier.getPortIdentifiers();
while(e.hasMoreElements()) {
System.out.println(((CommPortIdentifier)e.nextElement()).getName());
}
System.out.println("stop");
}
}
I am using rxtx 1.5 from the binary package. Run as user it prints the
following error message:
$ java Test
start
0 1075106032
RXTX WARNING: This library requires the user running applications to be in
group uucp. Please consult the INSTALL documentation. More information is
avaiable under the topic 'How can I use Lock Files with rxtx?'
check_lock_status: No permission to create lock file.
please see: How can I use Lock Files with rxtx? in INSTALL
Therefore I added my user to group uucp.
$ groups
users tty uucp dialout
But that didn't seem to change anything. That's why I additionally
changed the permissions of the devices I would like it to find to 666.
$ ls -la /dev/ttyS*
crw-rw-rw- 1 root dialout 4, 64 Apr 15 2001 /dev/ttyS0
crw-rw-rw- 1 root dialout 4, 65 Apr 15 2001 /dev/ttyS1
crw-rw-rw- 1 root dialout 4, 66 Apr 15 2001 /dev/ttyS2
crw-rw-rw- 1 root dialout 4, 67 Apr 15 2001 /dev/ttyS3
But that didn't change anything, either. Anyway, run as root it
somehow worked. But unfortunately, not exactly how I expected it to:
# java Test
start
stop
So I read in INSTALL of rxtx the following:
rxtx tries to detect ports on by scanning /dev for files matching any
of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on.
Any ones that exist, are supposed to be good for the current operating
system, and that can be read and written are offered back from
CommPortIdentifier.getPortIdentifiers(), and only these can be used as
ports.
And for I also tried to set the ports to use manually like this ...
# java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyS1 Test
start
stop
I began to doubt that my serial ports a well supported by my current
configuration. The following is the result of my investigations
concerning this problem. I hope that someone might be able to read the
key point out of it.
*Standard/generic (8250/16550 and compatible UARTs) serial support* is
built into the kernel (not as a module).
$ uname -a
Linux zoe 2.4.19 #2 Tue Oct 15 00:35:25 CEST 2002 i686 unknown
$ grep -v "#" /etc/serial.conf
/dev/ttyS0 uart 16550A port 0x03f8 irq 4 baud_base 115200 spd_normal skip_test
/dev/ttyS1 uart 16550A port 0x02f8 irq 3 baud_base 115200 spd_normal skip_test
$ grep serial /proc/ioports
02f8-02ff : serial(set)
03f8-03ff : serial(set)
$ cat /proc/tty/driver/serial
serinfo:1.0 driver:5.05c revision:2001-07-08
0: uart:16550A port:3F8 irq:4 tx:0 rx:0 CTS|DSR|CD|RI
1: uart:16550A port:2F8 irq:3 tx:0 rx:0 CTS|DSR|CD|RI
$ setserial -g /dev/ttyS*
/dev/ttyS0: No such device
/dev/ttyS1: No such device
/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
$ sudo setserial -g /dev/ttyS*
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3
/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
$ statserial
statserial: can't open device `/dev/ttyS1': No such device
$ sudo statserial
statserial: TIOCMGET failed: Input/output error
It is espacialy the last command I worry about. Because i found
similar error messages running an strace on the root java process of
Test.class.
Any help greatly appreciated
Philipp Hofmann
From taj at linuxgrrls.org Tue Jul 1 12:14:13 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 18:07:58 2005
Subject: [Rxtx] linux, rxtx and serial ports
In-Reply-To: <20030701104828.GH25468@d508a.hadiko.de>
References: <20030701104828.GH25468@d508a.hadiko.de>
Message-ID:
On Tue, 1 Jul 2003, Philipp Hofmann wrote:
> Hi,
>
> this ist my test program. Shouldn't it print a list of valid ports? I
> am especialy interested in serial ports.
>
>
> $ cat Test.java
> import gnu.io.*;
> import java.util.Enumeration;
>
> public class Test {
> public static void main(String[] arg) {
> System.out.println("start");
> Enumeration e = CommPortIdentifier.getPortIdentifiers();
> while(e.hasMoreElements()) {
> System.out.println(((CommPortIdentifier)e.nextElement()).getName());
> }
> System.out.println("stop");
> }
> }
>
>
> I am using rxtx 1.5 from the binary package. Run as user it prints the
> following error message:
>
>
> $ java Test
> start
> 0 1075106032
>
>
>
> RXTX WARNING: This library requires the user running applications to be in
> group uucp. Please consult the INSTALL documentation. More information is
> avaiable under the topic 'How can I use Lock Files with rxtx?'
> check_lock_status: No permission to create lock file.
>
> please see: How can I use Lock Files with rxtx? in INSTALL
>
>
> Therefore I added my user to group uucp.
>
>
> $ groups
> users tty uucp dialout
>
>
> But that didn't seem to change anything. That's why I additionally
> changed the permissions of the devices I would like it to find to 666.
>
>
> $ ls -la /dev/ttyS*
> crw-rw-rw- 1 root dialout 4, 64 Apr 15 2001 /dev/ttyS0
> crw-rw-rw- 1 root dialout 4, 65 Apr 15 2001 /dev/ttyS1
> crw-rw-rw- 1 root dialout 4, 66 Apr 15 2001 /dev/ttyS2
> crw-rw-rw- 1 root dialout 4, 67 Apr 15 2001 /dev/ttyS3
>
>
> But that didn't change anything, either. Anyway, run as root it
> somehow worked. But unfortunately, not exactly how I expected it to:
>
> # java Test
> start
> stop
>
> So I read in INSTALL of rxtx the following:
>
>
> rxtx tries to detect ports on by scanning /dev for files matching any
> of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on.
> Any ones that exist, are supposed to be good for the current operating
> system, and that can be read and written are offered back from
> CommPortIdentifier.getPortIdentifiers(), and only these can be used as
> ports.
>
>
> And for I also tried to set the ports to use manually like this ...
>
> # java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyS1 Test
> start
> stop
>
> I began to doubt that my serial ports a well supported by my current
> configuration. The following is the result of my investigations
> concerning this problem. I hope that someone might be able to read the
> key point out of it.
>
> *Standard/generic (8250/16550 and compatible UARTs) serial support* is
> built into the kernel (not as a module).
>
>
> $ uname -a
> Linux zoe 2.4.19 #2 Tue Oct 15 00:35:25 CEST 2002 i686 unknown
>
> $ grep -v "#" /etc/serial.conf
> /dev/ttyS0 uart 16550A port 0x03f8 irq 4 baud_base 115200 spd_normal skip_test
> /dev/ttyS1 uart 16550A port 0x02f8 irq 3 baud_base 115200 spd_normal skip_test
>
> $ grep serial /proc/ioports
> 02f8-02ff : serial(set)
> 03f8-03ff : serial(set)
>
> $ cat /proc/tty/driver/serial
> serinfo:1.0 driver:5.05c revision:2001-07-08
> 0: uart:16550A port:3F8 irq:4 tx:0 rx:0 CTS|DSR|CD|RI
> 1: uart:16550A port:2F8 irq:3 tx:0 rx:0 CTS|DSR|CD|RI
>
> $ setserial -g /dev/ttyS*
> /dev/ttyS0: No such device
> /dev/ttyS1: No such device
> /dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
> /dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
>
> $ sudo setserial -g /dev/ttyS*
> /dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
> /dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3
> /dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
> /dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
>
> $ statserial
> statserial: can't open device `/dev/ttyS1': No such device
>
> $ sudo statserial
> statserial: TIOCMGET failed: Input/output error
>
>
> It is espacialy the last command I worry about. Because i found
> similar error messages running an strace on the root java process of
> Test.class.
>
Hi Philipp
The setup looks like one I'm not familiar with. Here is the Test.java
output on my machine using rxtx 2.1-7pre16 (It's like rxtx 1.5 and can be
found on rxtx.org).
java Test
start
Devel Library
=========================================
Native lib Version = RXTX-2.1-7pre16
Java lib Version = RXTX-2.1-7pre16
/dev/ttyS0
/dev/ttyS1
/dev/lp0
stop
That TIOCMGET error is disturbing. Just to help simplify... If you run
as root, the lockfiles should work. The lock files should be going into
/var/lock. Sometimes the group ownership of that directory is not uucp.
For instance, some redhats use group lock. I see you have a group dialup
in there too.
You may want to step back and see if you can get minicom/kermit/tip/
something simple for serial comm working.
Could this be user mode linux perhaps? I see the TIOCMGET became
unsupported in UML around 2.4.18
http://user-mode-linux.sourceforge.net/changelog-linux-2.4.18-15.bz2.html
I'm not sure what to think. Have you checked your BIOS and made sure
there are no IRQ conflicts? Let us know if you can open the port with any
software as mentioned.
It sounds like something is wrong underneath rxtx BIOS, IRQ, kernel.
From phil at webwaste.de Tue Jul 1 13:13:33 2003
From: phil at webwaste.de (Philipp Hofmann)
Date: Fri Jun 3 18:07:58 2005
Subject: [Rxtx] linux, rxtx and serial ports
In-Reply-To:
References: <20030701104828.GH25468@d508a.hadiko.de>
Message-ID: <20030701121333.GI25468@d508a.hadiko.de>
On Tue, Jul 01, 2003 at 12:14:13PM +0100, Trent Jarvi wrote:
>
> Hi Philipp
>
> The setup looks like one I'm not familiar with. Here is the Test.java
> output on my machine using rxtx 2.1-7pre16 (It's like rxtx 1.5 and can be
> found on rxtx.org).
>
> java Test
> start
> Devel Library
> =========================================
> Native lib Version = RXTX-2.1-7pre16
> Java lib Version = RXTX-2.1-7pre16
> /dev/ttyS0
> /dev/ttyS1
> /dev/lp0
> stop
*sigh*
> That TIOCMGET error is disturbing. Just to help simplify... If you run
> as root, the lockfiles should work. The lock files should be going into
> /var/lock. Sometimes the group ownership of that directory is not uucp.
> For instance, some redhats use group lock. I see you have a group dialup
> in there too.
No, on my machine its like this:
[phil@zoe] ~ > ls -ld /var/lock
drwxrwxrwt 4 root root 4096 Jul 1 12:35 /var/lock
For the t among the permissions means something like everybody is
allowed to create a files, this should work right?
> You may want to step back and see if you can get minicom/kermit/tip/
> something simple for serial comm working.
Yes, i tried to run minicom, but didn't succeed to change settings to
any other device then /dev/ttyS3 (even as root). I'll spend some more
time on it.
> Could this be user mode linux perhaps? I see the TIOCMGET became
> unsupported in UML around 2.4.18
>
> http://user-mode-linux.sourceforge.net/changelog-linux-2.4.18-15.bz2.html
No it's just a debian linux (woody).
> I'm not sure what to think. Have you checked your BIOS and made sure
> there are no IRQ conflicts? Let us know if you can open the port with any
> software as mentioned.
I'll do.
thanks phil
From taj at linuxgrrls.org Tue Jul 1 13:37:15 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 18:07:58 2005
Subject: [Rxtx] linux, rxtx and serial ports
In-Reply-To: <20030701121333.GI25468@d508a.hadiko.de>
References: <20030701104828.GH25468@d508a.hadiko.de>
<20030701121333.GI25468@d508a.hadiko.de>
Message-ID:
>
> [phil@zoe] ~ > ls -ld /var/lock
> drwxrwxrwt 4 root root 4096 Jul 1 12:35 /var/lock
>
> For the t among the permissions means something like everybody is
> allowed to create a files, this should work right?
>
This may cause a problem if root creates a lockfile, the program crashes
or exits abnormally, and a user tries to use the port afterwards:
STICKY DIRECTORIES
When the sticky bit is set on a directory, files in that directory may
be unlinked or renamed only by root or their owner. Without the sticky
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bit, anyone able to write to the directory can delete or rename files.
The sticky bit is commonly found on directories, such as /tmp, that are
world-writable.
Otherwise it should work properly. (t is sticky) RXTX should give a
clear message about not being able to create a lock file if that happens.
From phil at webwaste.de Sun Jul 6 15:55:49 2003
From: phil at webwaste.de (Philipp Hofmann)
Date: Fri Jun 3 18:07:58 2005
Subject: [Rxtx] first problem solved, more to go
Message-ID: <20030706145549.GN24717@d508a.hadiko.de>
hello again,
ok, on one side it's distressing, but one the other side i'm pretty
happy that it was this easy to solve this problem.
i finally checked the bios settings, and - you quessed it already -
the com ports were simply disabeld. shame on me. but thanks for the
hint.
but now that i finished writing the application i get a strange error
message after moving the whole stuff to another machine.
*snip*
java.lang.ClassCastException thrown while loading gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.UnsatisfiedLinkError: Native
Library /home/phil/java/libSerial-1.5.8.so already loaded in another
classloader
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1437)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1397)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:832)
at gnu.io.CommPortIdentifier.(CommPortIdentifier.java)
at TelefonServer.doSerialPhoneStuff(TelefonServer.java:204)
at TelefonServer.(TelefonServer.java:96)
at TelefonServer.main(TelefonServer.java:30)
*snip*
i am sure, there is no other process of this software running, for ps
looks like this (right after rebooting the machine).
*snip*
medea:/home/phil/java# ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.1 0.5 1272 72 ? S 16:02 0:06 init [2]
root 2 0.0 0.0 0 0 ? SW 16:02 0:01 [kflushd]
root 3 0.0 0.0 0 0 ? SW 16:02 0:00 [kupdate]
root 4 0.0 0.0 0 0 ? SW 16:02 0:03 [kswapd]
root 5 0.0 0.0 0 0 ? SW 16:02 0:00 [keventd]
root 163 0.0 0.6 1344 88 ? S 16:03 0:00 /sbin/syslogd
root 166 0.0 0.0 1744 0 ? SW 16:03 0:00 [klogd]
root 174 0.0 0.0 1292 0 ? SW 16:03 0:00 [inetd]
root 181 0.0 0.0 2792 0 ? SW 16:03 0:00 [sshd]
daemon 184 0.0 0.0 1388 0 ? SW 16:03 0:00 [atd]
root 187 0.0 1.1 1652 160 ? S 16:03 0:00 /usr/sbin/cron
root 190 0.0 0.0 1256 0 tty1 SW 16:03 0:00 [getty]
root 191 0.0 0.0 1256 0 tty2 SW 16:03 0:00 [getty]
root 192 0.0 0.0 1256 0 tty3 SW 16:03 0:00 [getty]
root 193 0.0 0.0 1256 0 tty4 SW 16:03 0:00 [getty]
root 194 0.0 0.0 1256 0 tty5 SW 16:03 0:00 [getty]
root 195 0.0 0.0 1256 0 tty6 SW 16:03 0:00 [getty]
root 206 0.0 0.0 5624 0 ? SW 16:06 0:00 [sshd]
phil 208 0.0 1.9 5636 264 ? D 16:06 0:02 /usr/sbin/sshd
phil 209 0.0 0.0 2220 0 pts/0 SW 16:06 0:00 [bash]
root 488 0.1 3.2 2212 448 pts/0 S 17:21 0:00 -su
root 570 37.0 9.0 3164 1240 pts/0 R 17:27 0:00 ps aux
*snip*
it has mostly the same configuration (same dist (debian woody), same
j2sdk, same rxtx version).
no clue.
grettings phil
From taj at linuxgrrls.org Sun Jul 6 16:11:48 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 18:07:58 2005
Subject: [Rxtx] first problem solved, more to go
In-Reply-To: <20030706145549.GN24717@d508a.hadiko.de>
References: <20030706145549.GN24717@d508a.hadiko.de>
Message-ID:
On Sun, 6 Jul 2003, Philipp Hofmann wrote:
> hello again,
>
> ok, on one side it's distressing, but one the other side i'm pretty
> happy that it was this easy to solve this problem.
>
> i finally checked the bios settings, and - you quessed it already -
> the com ports were simply disabeld. shame on me. but thanks for the
> hint.
>
> but now that i finished writing the application i get a strange error
> message after moving the whole stuff to another machine.
>
> *snip*
>
> java.lang.ClassCastException thrown while loading gnu.io.RXTXCommDriver
> Exception in thread "main" java.lang.UnsatisfiedLinkError: Native
> Library /home/phil/java/libSerial-1.5.8.so already loaded in another
> classloader
> at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1437)
> at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1397)
> at java.lang.Runtime.loadLibrary0(Runtime.java:788)
> at java.lang.System.loadLibrary(System.java:832)
> at gnu.io.CommPortIdentifier.(CommPortIdentifier.java)
> at TelefonServer.doSerialPhoneStuff(TelefonServer.java:204)
> at TelefonServer.(TelefonServer.java:96)
> at TelefonServer.main(TelefonServer.java:30)
>
> *snip*
>
> i am sure, there is no other process of this software running, for ps
> looks like this (right after rebooting the machine).
>
> *snip*
>
> medea:/home/phil/java# ps aux
> USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
> root 1 0.1 0.5 1272 72 ? S 16:02 0:06 init [2]
> root 2 0.0 0.0 0 0 ? SW 16:02 0:01 [kflushd]
> root 3 0.0 0.0 0 0 ? SW 16:02 0:00 [kupdate]
> root 4 0.0 0.0 0 0 ? SW 16:02 0:03 [kswapd]
> root 5 0.0 0.0 0 0 ? SW 16:02 0:00 [keventd]
> root 163 0.0 0.6 1344 88 ? S 16:03 0:00 /sbin/syslogd
> root 166 0.0 0.0 1744 0 ? SW 16:03 0:00 [klogd]
> root 174 0.0 0.0 1292 0 ? SW 16:03 0:00 [inetd]
> root 181 0.0 0.0 2792 0 ? SW 16:03 0:00 [sshd]
> daemon 184 0.0 0.0 1388 0 ? SW 16:03 0:00 [atd]
> root 187 0.0 1.1 1652 160 ? S 16:03 0:00 /usr/sbin/cron
> root 190 0.0 0.0 1256 0 tty1 SW 16:03 0:00 [getty]
> root 191 0.0 0.0 1256 0 tty2 SW 16:03 0:00 [getty]
> root 192 0.0 0.0 1256 0 tty3 SW 16:03 0:00 [getty]
> root 193 0.0 0.0 1256 0 tty4 SW 16:03 0:00 [getty]
> root 194 0.0 0.0 1256 0 tty5 SW 16:03 0:00 [getty]
> root 195 0.0 0.0 1256 0 tty6 SW 16:03 0:00 [getty]
> root 206 0.0 0.0 5624 0 ? SW 16:06 0:00 [sshd]
> phil 208 0.0 1.9 5636 264 ? D 16:06 0:02 /usr/sbin/sshd
> phil 209 0.0 0.0 2220 0 pts/0 SW 16:06 0:00 [bash]
> root 488 0.1 3.2 2212 448 pts/0 S 17:21 0:00 -su
> root 570 37.0 9.0 3164 1240 pts/0 R 17:27 0:00 ps aux
>
> *snip*
>
> it has mostly the same configuration (same dist (debian woody), same
> j2sdk, same rxtx version).
>
> no clue.
>
Hi Phil
You really want to use rxtx 2.1-7pre16 which is the functional equiv of
rxtx 1.5 with bug fixes but this bug has not shown up before. I suspect
you accidently duplicated some code. Possibly in RXTXCommDriver.java
I would look for two instances of the following in one of your java files.
System.loadLibrary( "Serial" );
That said, This bug has not shown up before so you may want to just start
with a clean tarball of rxtx and reinstall.
From phil at hadiko.de Sun Jul 6 18:21:09 2003
From: phil at hadiko.de (Philipp Hofmann)
Date: Fri Jun 3 18:07:58 2005
Subject: [Rxtx] first problem solved, more to go
In-Reply-To:
References: <20030706145549.GN24717@d508a.hadiko.de>
Message-ID: <20030706172109.GO24717@d508a.hadiko.de>
hey,
you convinced me. i got lib-rxtx-java_2.1.6-1_i386.deb and installed it.
but ...
even my previously used test-app reports the same error:
*snip*
Native Library /usr/lib/librxtxSerial-2.1-6.so already loaded in
another classloader
*snip*
after some straceing it seems to me that firstly it looks for a
libSerial.so if it doesn't find one it aborts although it loads the
librxtxSerial afterwards. and if it finds one because of a symlink i
provide it aborts because it tries to load the same lib twice.
i didn't do any changes to the rxtx-code and i'm not using
System.loadLibrary("...");
$ grep loadLib RXTXCommDriver.java
System.loadLibrary( "rxtxSerial" );
which means it should only be looking for *librxtxSerial.so*. where
does the *libSerial.so* request come from? it is defenatly not part of
my test-app. :)
so far
g phil
On Sun, Jul 06, 2003 at 04:11:48PM +0100, Trent Jarvi wrote:
> Hi Phil
>
>
> You really want to use rxtx 2.1-7pre16 which is the functional equiv of
> rxtx 1.5 with bug fixes but this bug has not shown up before. I suspect
> you accidently duplicated some code. Possibly in RXTXCommDriver.java
>
> I would look for two instances of the following in one of your java files.
>
> System.loadLibrary( "Serial" );
>
> That said, This bug has not shown up before so you may want to just start
> with a clean tarball of rxtx and reinstall.
>
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
From taj at linuxgrrls.org Sun Jul 6 18:33:06 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 18:07:58 2005
Subject: [Rxtx] first problem solved, more to go
In-Reply-To: <20030706172109.GO24717@d508a.hadiko.de>
References: <20030706145549.GN24717@d508a.hadiko.de>
<20030706172109.GO24717@d508a.hadiko.de>
Message-ID:
On Sun, 6 Jul 2003, Philipp Hofmann wrote:
> hey,
>
> you convinced me. i got lib-rxtx-java_2.1.6-1_i386.deb and installed it.
>
> but ...
>
> even my previously used test-app reports the same error:
>
> *snip*
> Native Library /usr/lib/librxtxSerial-2.1-6.so already loaded in
> another classloader
> *snip*
>
> after some straceing it seems to me that firstly it looks for a
> libSerial.so if it doesn't find one it aborts although it loads the
> librxtxSerial afterwards. and if it finds one because of a symlink i
> provide it aborts because it tries to load the same lib twice.
>
> i didn't do any changes to the rxtx-code and i'm not using
> System.loadLibrary("...");
>
> $ grep loadLib RXTXCommDriver.java
> System.loadLibrary( "rxtxSerial" );
>
> which means it should only be looking for *librxtxSerial.so*. where
> does the *libSerial.so* request come from? it is defenatly not part of
> my test-app. :)
>
> so far
>
> g phil
>
>
Hi Phil
I don't think libSerial.so should be loaded at all in rxtx 2.1. Perhaps
there is something in the Java distribution you are using?
If you have a sample to try I can try reproducing the problem. There is
something unusual in your setup or code. I looked at the .deb a couple
months ago and its not making code changes. It should be fine.
From phil at webwaste.de Sun Jul 6 18:59:19 2003
From: phil at webwaste.de (Philipp Hofmann)
Date: Fri Jun 3 18:07:58 2005
Subject: [Rxtx] first problem solved, more to go
In-Reply-To:
References: <20030706145549.GN24717@d508a.hadiko.de>
<20030706172109.GO24717@d508a.hadiko.de>
Message-ID: <20030706175919.GQ24717@d508a.hadiko.de>
you were right again.
thanks a lot. it works now.
i still had a comm.jar in ext of my jdk.
information about this project will soon be put on
http://versfabrik.de
g phil
On Sun, Jul 06, 2003 at 06:33:06PM +0100, Trent Jarvi wrote:
>
>
> On Sun, 6 Jul 2003, Philipp Hofmann wrote:
>
> > hey,
> >
> > you convinced me. i got lib-rxtx-java_2.1.6-1_i386.deb and installed it.
> >
> > but ...
> >
> > even my previously used test-app reports the same error:
> >
> > *snip*
> > Native Library /usr/lib/librxtxSerial-2.1-6.so already loaded in
> > another classloader
> > *snip*
> >
> > after some straceing it seems to me that firstly it looks for a
> > libSerial.so if it doesn't find one it aborts although it loads the
> > librxtxSerial afterwards. and if it finds one because of a symlink i
> > provide it aborts because it tries to load the same lib twice.
> >
> > i didn't do any changes to the rxtx-code and i'm not using
> > System.loadLibrary("...");
> >
> > $ grep loadLib RXTXCommDriver.java
> > System.loadLibrary( "rxtxSerial" );
> >
> > which means it should only be looking for *librxtxSerial.so*. where
> > does the *libSerial.so* request come from? it is defenatly not part of
> > my test-app. :)
> >
> > so far
> >
> > g phil
> >
> >
>
> Hi Phil
>
> I don't think libSerial.so should be loaded at all in rxtx 2.1. Perhaps
> there is something in the Java distribution you are using?
>
> If you have a sample to try I can try reproducing the problem. There is
> something unusual in your setup or code. I looked at the .deb a couple
> months ago and its not making code changes. It should be fine.
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
From ricardo.trindade at emation.pt Mon Jul 7 00:59:06 2003
From: ricardo.trindade at emation.pt (Ricardo Trindade)
Date: Fri Jun 3 18:07:58 2005
Subject: [Rxtx] loading .dll or .so from jar
Message-ID:
Hi,
Hi was wondering if you haver considered including the .dll and .so in the
jar, and loading the adequate one depending on the platform.
Is this even possible ?
It would also make life easier for rxtx begginners. The only drawback I see
is the increase in jar size, but people concerned about that could always
delete it. Also with tens of megs of JRE it's hardly a problem for any java
user...
ricardo
From taj at linuxgrrls.org Mon Jul 7 01:45:23 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 18:07:58 2005
Subject: [Rxtx] loading .dll or .so from jar
In-Reply-To:
References:
Message-ID:
On Mon, 7 Jul 2003, Ricardo Trindade wrote:
> Hi,
>
> Hi was wondering if you haver considered including the .dll and .so in the
> jar, and loading the adequate one depending on the platform.
>
> Is this even possible ?
>
> It would also make life easier for rxtx begginners. The only drawback I see
> is the increase in jar size, but people concerned about that could always
> delete it. Also with tens of megs of JRE it's hardly a problem for any java
> user...
>
Hi Ricardo
Thats a great idea.
Have you done something like this before? I can picture everything
required except for the native library paths. Thats probably doable also.
That certainly would simplify installs.
From moritz.gmelin at gmx.de Mon Jul 7 06:31:51 2003
From: moritz.gmelin at gmx.de (Moritz Gmelin)
Date: Fri Jun 3 18:07:58 2005
Subject: [Rxtx] loading .dll or .so from jar
In-Reply-To:
Message-ID: <4FE80175-B03C-11D7-8199-000393719396@gmx.de>
Hi,
you can do that for a WebStart-Application. Just put the .so (.dll)
file in a jar. I believe you have to sign it. But I'm not sure about
the signing part. The rest works great.
M.
Am Montag, 07.07.03, um 02:45 Uhr (Europe/Berlin) schrieb Trent Jarvi:
>
>
> On Mon, 7 Jul 2003, Ricardo Trindade wrote:
>
>> Hi,
>>
>> Hi was wondering if you haver considered including the .dll and .so
>> in the
>> jar, and loading the adequate one depending on the platform.
>>
>> Is this even possible ?
>>
>> It would also make life easier for rxtx begginners. The only
>> drawback I see
>> is the increase in jar size, but people concerned about that could
>> always
>> delete it. Also with tens of megs of JRE it's hardly a problem for
>> any java
>> user...
>>
>
> Hi Ricardo
>
> Thats a great idea.
>
> Have you done something like this before? I can picture everything
> required except for the native library paths. Thats probably doable
> also.
>
> That certainly would simplify installs.
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
From glenn at satlantic.com Wed Jul 9 21:17:24 2003
From: glenn at satlantic.com (Glenn Davidson)
Date: Fri Jun 3 18:07:58 2005
Subject: [Rxtx] ClassCastException using RXTX 2.1-6
Message-ID: <3F0C7854.9000003@satlantic.com>
I am using Java 1.4.1 on RedHat Linux (version 9) I currently have installed rxtx 2.1.6 and when my application runs I get the error:
"Caught java.lang.ClassCastException while loading driver
gnu.io.RXTXCommDriver"
Does any onyone recognize this problem?
--
Glenn Davidson |*| Phone: (902)492-4780
Satlantic Inc., Richmond Terminal, Pier 9 |*| Fax: (902)492-4781
3295 Barrington St., Halifax, NS, Canada |*| E-mail: glenn@satlantic.com
From taj at linuxgrrls.org Wed Jul 9 21:25:38 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 18:07:58 2005
Subject: [Rxtx] ClassCastException using RXTX 2.1-6
In-Reply-To: <3F0C7854.9000003@satlantic.com>
References: <3F0C7854.9000003@satlantic.com>
Message-ID:
This error is reported to the list now and then. I just looked through my
email and the only thing I saw was that this does happen when the native
library is unable to load. hmm. what do you have in
.../java/jre/lib/i386/
If you did an install from source, there should be
librxtxSerial-2.1-7pre16.so
librxtxSerial.so (symbolic link to the above)
Make sure you do not mix rxtx 2.1 with Sun's comm.jar and rxtx 2.0 jcl.jar
On Wed, 9 Jul 2003, Glenn Davidson wrote:
> I am using Java 1.4.1 on RedHat Linux (version 9) I currently have installed rxtx 2.1.6 and when my application runs I get the error:
>
> "Caught java.lang.ClassCastException while loading driver
> gnu.io.RXTXCommDriver"
>
> Does any onyone recognize this problem?
>
> --
> Glenn Davidson |*| Phone: (902)492-4780
> Satlantic Inc., Richmond Terminal, Pier 9 |*| Fax: (902)492-4781
> 3295 Barrington St., Halifax, NS, Canada |*| E-mail: glenn@satlantic.com
>
>
>
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
From ricardo.trindade at emation.pt Thu Jul 10 18:35:04 2003
From: ricardo.trindade at emation.pt (Ricardo Trindade)
Date: Fri Jun 3 18:07:58 2005
Subject: [Rxtx] loading .dll or .so from jar
In-Reply-To:
Message-ID:
I've looked this article up on the net, which explains the concept.
I implemented it, but found an issue regarding the native lib. I load the
library with System.load, but an exception
is thrown on you System.loadlibrary("rxtxSerial"), saying I don't have the
library on java.library.path. So I imagine that for this to be possible you
would have to handle the loading with System.load, as stated in the article,
or accept an argument to not load the library.
What do you think of this ?
Ricardo
-----Mensagem original-----
De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
nome de Trent Jarvi
Enviada: segunda-feira, 7 de Julho de 2003 1:45
Para: Java RXTX discussion
Assunto: Re: [Rxtx] loading .dll or .so from jar
On Mon, 7 Jul 2003, Ricardo Trindade wrote:
> Hi,
>
> Hi was wondering if you haver considered including the .dll and .so in
the
> jar, and loading the adequate one depending on the platform.
>
> Is this even possible ?
>
> It would also make life easier for rxtx begginners. The only drawback I
see
> is the increase in jar size, but people concerned about that could always
> delete it. Also with tens of megs of JRE it's hardly a problem for any
java
> user...
>
Hi Ricardo
Thats a great idea.
Have you done something like this before? I can picture everything
required except for the native library paths. Thats probably doable also.
That certainly would simplify installs.
_______________________________________________
Rxtx mailing list
Rxtx@linuxgrrls.org
http://hex.linuxgrrls.org/mailman/listinfo/rxtx
From ricardo.trindade at emation.pt Thu Jul 10 19:02:25 2003
From: ricardo.trindade at emation.pt (Ricardo Trindade)
Date: Fri Jun 3 18:07:59 2005
Subject: [Rxtx] loading .dll or .so from jar
In-Reply-To:
Message-ID:
I'm replying to myself to add two attachments interesting to this issue :
The .java is from the JUGS project.
-----Mensagem original-----
De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
nome de Ricardo Trindade
Enviada: quinta-feira, 10 de Julho de 2003 18:35
Para: Java RXTX discussion
Assunto: RE: [Rxtx] loading .dll or .so from jar
I've looked this article up on the net, which explains the concept.
I implemented it, but found an issue regarding the native lib. I load the
library with System.load, but an exception
is thrown on you System.loadlibrary("rxtxSerial"), saying I don't have the
library on java.library.path. So I imagine that for this to be possible you
would have to handle the loading with System.load, as stated in the article,
or accept an argument to not load the library.
What do you think of this ?
Ricardo
-----Mensagem original-----
De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
nome de Trent Jarvi
Enviada: segunda-feira, 7 de Julho de 2003 1:45
Para: Java RXTX discussion
Assunto: Re: [Rxtx] loading .dll or .so from jar
On Mon, 7 Jul 2003, Ricardo Trindade wrote:
> Hi,
>
> Hi was wondering if you haver considered including the .dll and .so in
the
> jar, and loading the adequate one depending on the platform.
>
> Is this even possible ?
>
> It would also make life easier for rxtx begginners. The only drawback I
see
> is the increase in jar size, but people concerned about that could always
> delete it. Also with tens of megs of JRE it's hardly a problem for any
java
> user...
>
Hi Ricardo
Thats a great idea.
Have you done something like this before? I can picture everything
required except for the native library paths. Thats probably doable also.
That certainly would simplify installs.
_______________________________________________
Rxtx mailing list
Rxtx@linuxgrrls.org
http://hex.linuxgrrls.org/mailman/listinfo/rxtx
_______________________________________________
Rxtx mailing list
Rxtx@linuxgrrls.org
http://hex.linuxgrrls.org/mailman/listinfo/rxtx
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nativelibs.pdf
Type: application/pdf
Size: 72425 bytes
Desc: not available
Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20030710/46bcf03a/nativelibs-0003.pdf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NativeLibs.java
Type: text/x-java
Size: 7537 bytes
Desc: not available
Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20030710/46bcf03a/NativeLibs-0001.java
From awaisa at hotmail.com Thu Jul 10 20:25:20 2003
From: awaisa at hotmail.com (Awais Ahmed)
Date: Fri Jun 3 18:07:59 2005
Subject: [Rxtx] loading .dll or .so from jar
Message-ID:
Hello All,
I guess the first question is: if it is possible.
The answer is *NO*. I am not aware of any support
like this from Suns JVM implementation.
All JNI based shared libraries are loaded in the
following flow of functional execution.
1. Java Application somewhere requests to load a
native library. Using calls like
System.loadLibrary(""). Normally this
is done in some static initializers
2. Later, defining class loader of the class
containing loadLibrary Call invokes a one of its
JNI *native* function to load a library.
3. That particular native system library requests
JVM to load the requested library, which is then
loaded through the dynamic loader.
Now to make it happen, one will have to consider
security issues and see how to add support to
extract a native library from a jar and place it
in some location/path which could later be made
accessible to the dynamic loader to load. And this
again has an issue. Currently, I am not aware of
any scenario where a JVM creates any executible
code file anywhere in your secondary location.
Anything that is generated is mapped on memory
and is all dynamic. Introducing a system library
would be a new thing.
Note: It's it important to have a library be
loaded through some VM as then VM will be
responsible for unloading that library if it's
no more referenced.
Now I can think of folowing ways:
1. You create your own objects that makes use of
packages like java.util.jar or java.util.zip
or some other custom components and extract the
native libraries at some location and then
modify java.library.path and then let
System.loadLibrary play it trick. It is a
little ugly as one also will have to keep in
mind some files cleanup mechanism.
2. An ideal way (may not be in your control to
do it) could be:
Have the VM do it totally and issues would be:
Since dynamic loader also has a major role
in loading a library, which has to have some
physical existance accessible through some path.
And there are issues and concerns if VM will
create a new file with executible code in a
disk-space. As any runtime code should only be
laid out in memory. (Note it's not accesptable
to have VM create/introduce any new native code
based files) One option that makes it do-able
is if dynamic loader gives an interface to load
a library from memory. In this scenario VM could
extract the system library bits and map it in
some memory and let the dynamic loader accept
executible code from memory.
One can try it on some research VMs along with
some adding some support in dynamic loader.
Awais Sheikh
PS: I am not sure if this email will go through as
I am not sending it through my registered email
address.
----- Original Message -----
From: "Ricardo Trindade"
To: "Java RXTX discussion"
Sent: Thursday, July 10, 2003 10:35 AM
Subject: RE: [Rxtx] loading .dll or .so from jar
>I've looked this article up on the net, which explains the concept.
>
>I implemented it, but found an issue regarding the native lib. I load the
>library with System.load, but an exception
>is thrown on you System.loadlibrary("rxtxSerial"), saying I don't have the
>library on java.library.path. So I imagine that for this to be possible you
>would have to handle the loading with System.load, as stated in the
>article,
>or accept an argument to not load the library.
>
>What do you think of this ?
>
>Ricardo
>
>-----Mensagem original-----
>De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
>nome de Trent Jarvi
>Enviada: segunda-feira, 7 de Julho de 2003 1:45
>Para: Java RXTX discussion
>Assunto: Re: [Rxtx] loading .dll or .so from jar
>
>
>
>
>On Mon, 7 Jul 2003, Ricardo Trindade wrote:
>
> > Hi,
> >
> > Hi was wondering if you haver considered including the .dll and .so in
>the
> > jar, and loading the adequate one depending on the platform.
> >
> > Is this even possible ?
> >
> > It would also make life easier for rxtx begginners. The only drawback I
>see
> > is the increase in jar size, but people concerned about that could
>always
> > delete it. Also with tens of megs of JRE it's hardly a problem for any
>java
> > user...
> >
>
>Hi Ricardo
>
>Thats a great idea.
>
>Have you done something like this before? I can picture everything
>required except for the native library paths. Thats probably doable also.
>
>That certainly would simplify installs.
_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
From taj at linuxgrrls.org Thu Jul 10 21:39:28 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 18:07:59 2005
Subject: [Rxtx] loading .dll or .so from jar
In-Reply-To:
References:
Message-ID:
Yikes.
It may be more productive to look at an installer rather than gowing down
one of these directions.
It would not be too hard to extract the proper binary from a jar file and
place it in the correct location. Same for the comm.jar.
If we start creating directories, dumping files, looking at VM hacks, and
so forth, we will get in trouble one way or another.
On Thu, 10 Jul 2003, Awais Ahmed wrote:
> Hello All,
> I guess the first question is: if it is possible.
> The answer is *NO*. I am not aware of any support
> like this from Suns JVM implementation.
> All JNI based shared libraries are loaded in the
> following flow of functional execution.
> 1. Java Application somewhere requests to load a
> native library. Using calls like
> System.loadLibrary(""). Normally this
> is done in some static initializers
> 2. Later, defining class loader of the class
> containing loadLibrary Call invokes a one of its
> JNI *native* function to load a library.
> 3. That particular native system library requests
> JVM to load the requested library, which is then
> loaded through the dynamic loader.
>
> Now to make it happen, one will have to consider
> security issues and see how to add support to
> extract a native library from a jar and place it
> in some location/path which could later be made
> accessible to the dynamic loader to load. And this
> again has an issue. Currently, I am not aware of
> any scenario where a JVM creates any executible
> code file anywhere in your secondary location.
> Anything that is generated is mapped on memory
> and is all dynamic. Introducing a system library
> would be a new thing.
>
> Note: It's it important to have a library be
> loaded through some VM as then VM will be
> responsible for unloading that library if it's
> no more referenced.
>
> Now I can think of folowing ways:
> 1. You create your own objects that makes use of
> packages like java.util.jar or java.util.zip
> or some other custom components and extract the
> native libraries at some location and then
> modify java.library.path and then let
> System.loadLibrary play it trick. It is a
> little ugly as one also will have to keep in
> mind some files cleanup mechanism.
>
> 2. An ideal way (may not be in your control to
> do it) could be:
> Have the VM do it totally and issues would be:
> Since dynamic loader also has a major role
> in loading a library, which has to have some
> physical existance accessible through some path.
> And there are issues and concerns if VM will
> create a new file with executible code in a
> disk-space. As any runtime code should only be
> laid out in memory. (Note it's not accesptable
> to have VM create/introduce any new native code
> based files) One option that makes it do-able
> is if dynamic loader gives an interface to load
> a library from memory. In this scenario VM could
> extract the system library bits and map it in
> some memory and let the dynamic loader accept
> executible code from memory.
> One can try it on some research VMs along with
> some adding some support in dynamic loader.
>
> Awais Sheikh
>
> PS: I am not sure if this email will go through as
> I am not sending it through my registered email
> address.
>
> ----- Original Message -----
> From: "Ricardo Trindade"
> To: "Java RXTX discussion"
> Sent: Thursday, July 10, 2003 10:35 AM
> Subject: RE: [Rxtx] loading .dll or .so from jar
>
>
> >I've looked this article up on the net, which explains the concept.
> >
> >I implemented it, but found an issue regarding the native lib. I load the
> >library with System.load, but an exception
> >is thrown on you System.loadlibrary("rxtxSerial"), saying I don't have the
> >library on java.library.path. So I imagine that for this to be possible you
> >would have to handle the loading with System.load, as stated in the
> >article,
> >or accept an argument to not load the library.
> >
> >What do you think of this ?
> >
> >Ricardo
> >
> >-----Mensagem original-----
> >De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
> >nome de Trent Jarvi
> >Enviada: segunda-feira, 7 de Julho de 2003 1:45
> >Para: Java RXTX discussion
> >Assunto: Re: [Rxtx] loading .dll or .so from jar
> >
> >
> >
> >
> >On Mon, 7 Jul 2003, Ricardo Trindade wrote:
> >
> > > Hi,
> > >
> > > Hi was wondering if you haver considered including the .dll and .so in
> >the
> > > jar, and loading the adequate one depending on the platform.
> > >
> > > Is this even possible ?
> > >
> > > It would also make life easier for rxtx begginners. The only drawback I
> >see
> > > is the increase in jar size, but people concerned about that could
> >always
> > > delete it. Also with tens of megs of JRE it's hardly a problem for any
> >java
> > > user...
> > >
> >
> >Hi Ricardo
> >
> >Thats a great idea.
> >
> >Have you done something like this before? I can picture everything
> >required except for the native library paths. Thats probably doable also.
> >
> >That certainly would simplify installs.
>
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
From ricardo.trindade at emation.pt Fri Jul 11 10:46:11 2003
From: ricardo.trindade at emation.pt (Ricardo Trindade)
Date: Fri Jun 3 18:07:59 2005
Subject: [Rxtx] loading .dll or .so from jar
In-Reply-To:
Message-ID:
Hi,
Why all this complication ? It's so easy. Have you read the pdf and .java I
posted ? That's the way several projects are doing it.
1) Extract the correct .dll or .so to your current director, depending on
platform
2) Read said library with System.load( currentDir + libName );
3) done
The System.load call doesn't rely on java library path, just on absolute
filesystem location. if the library is extracted to the current directory,
no directory or path issues will appear.
If you find this inadequate to include in rxtx itself, please consider
adding a boolean flag to define wether or not RXTX will call
System.loadLibrary, so that people wanting to use the scheme above can do it
outside RXTX.
thanks
Ricardo
-----Mensagem original-----
De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
nome de Awais Ahmed
Enviada: quinta-feira, 10 de Julho de 2003 20:25
Para: rxtx@linuxgrrls.org
Cc: awaisa@hotmail.com
Assunto: Re: [Rxtx] loading .dll or .so from jar
Hello All,
I guess the first question is: if it is possible.
The answer is *NO*. I am not aware of any support
like this from Suns JVM implementation.
All JNI based shared libraries are loaded in the
following flow of functional execution.
1. Java Application somewhere requests to load a
native library. Using calls like
System.loadLibrary(""). Normally this
is done in some static initializers
2. Later, defining class loader of the class
containing loadLibrary Call invokes a one of its
JNI *native* function to load a library.
3. That particular native system library requests
JVM to load the requested library, which is then
loaded through the dynamic loader.
Now to make it happen, one will have to consider
security issues and see how to add support to
extract a native library from a jar and place it
in some location/path which could later be made
accessible to the dynamic loader to load. And this
again has an issue. Currently, I am not aware of
any scenario where a JVM creates any executible
code file anywhere in your secondary location.
Anything that is generated is mapped on memory
and is all dynamic. Introducing a system library
would be a new thing.
Note: It's it important to have a library be
loaded through some VM as then VM will be
responsible for unloading that library if it's
no more referenced.
Now I can think of folowing ways:
1. You create your own objects that makes use of
packages like java.util.jar or java.util.zip
or some other custom components and extract the
native libraries at some location and then
modify java.library.path and then let
System.loadLibrary play it trick. It is a
little ugly as one also will have to keep in
mind some files cleanup mechanism.
2. An ideal way (may not be in your control to
do it) could be:
Have the VM do it totally and issues would be:
Since dynamic loader also has a major role
in loading a library, which has to have some
physical existance accessible through some path.
And there are issues and concerns if VM will
create a new file with executible code in a
disk-space. As any runtime code should only be
laid out in memory. (Note it's not accesptable
to have VM create/introduce any new native code
based files) One option that makes it do-able
is if dynamic loader gives an interface to load
a library from memory. In this scenario VM could
extract the system library bits and map it in
some memory and let the dynamic loader accept
executible code from memory.
One can try it on some research VMs along with
some adding some support in dynamic loader.
Awais Sheikh
PS: I am not sure if this email will go through as
I am not sending it through my registered email
address.
----- Original Message -----
From: "Ricardo Trindade"
To: "Java RXTX discussion"
Sent: Thursday, July 10, 2003 10:35 AM
Subject: RE: [Rxtx] loading .dll or .so from jar
>I've looked this article up on the net, which explains the concept.
>
>I implemented it, but found an issue regarding the native lib. I load the
>library with System.load, but an exception
>is thrown on you System.loadlibrary("rxtxSerial"), saying I don't have the
>library on java.library.path. So I imagine that for this to be possible you
>would have to handle the loading with System.load, as stated in the
>article,
>or accept an argument to not load the library.
>
>What do you think of this ?
>
>Ricardo
>
>-----Mensagem original-----
>De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
>nome de Trent Jarvi
>Enviada: segunda-feira, 7 de Julho de 2003 1:45
>Para: Java RXTX discussion
>Assunto: Re: [Rxtx] loading .dll or .so from jar
>
>
>
>
>On Mon, 7 Jul 2003, Ricardo Trindade wrote:
>
> > Hi,
> >
> > Hi was wondering if you haver considered including the .dll and .so in
>the
> > jar, and loading the adequate one depending on the platform.
> >
> > Is this even possible ?
> >
> > It would also make life easier for rxtx begginners. The only drawback I
>see
> > is the increase in jar size, but people concerned about that could
>always
> > delete it. Also with tens of megs of JRE it's hardly a problem for any
>java
> > user...
> >
>
>Hi Ricardo
>
>Thats a great idea.
>
>Have you done something like this before? I can picture everything
>required except for the native library paths. Thats probably doable also.
>
>That certainly would simplify installs.
_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
_______________________________________________
Rxtx mailing list
Rxtx@linuxgrrls.org
http://hex.linuxgrrls.org/mailman/listinfo/rxtx
From taj at linuxgrrls.org Fri Jul 11 11:46:30 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 18:07:59 2005
Subject: [Rxtx] loading .dll or .so from jar
In-Reply-To:
References:
Message-ID:
The pdf solution is fairly easy to implement but does involve installing
native libraries. The security...
OK. Lets start with Unix which I'm more familiar with than w32. There
are two places these files would be allowed to be extracted:
~/ (the users home directory such as /home/jarvi
/tmp /usr/tmp /usr/local/tmp - one of the tmp directories
When applications do this they usually use a dot directory. If its in a
tmp directory then cleanup is expected to be done afterwards. Lets just
look at the home directory.
/home/jarvi/.rxtx The home direcotry could be shared across
multiple OS's and archs via NFS, SMB, ... so there would have
to be subdirecotries for OS and arch. solaris/i386 for instance.
Writing to the system/jre/jdk directories would be bad form and users
will typically not have permission anyhow.
In order for this to automatically happen, The lockfile feature would have
to be disabled. This means a person using this library could open say a
modem being used by another user and interfere with communications.
I'm not sure at all what would be acceptable in a modern NT environment.
Does anyone know what would be done as a user on say w2003? There are
probably simular issues and solutions.
On Fri, 11 Jul 2003, Ricardo Trindade wrote:
> Hi,
>
> Why all this complication ? It's so easy. Have you read the pdf and .java I
> posted ? That's the way several projects are doing it.
>
> 1) Extract the correct .dll or .so to your current director, depending on
> platform
> 2) Read said library with System.load( currentDir + libName );
> 3) done
>
> The System.load call doesn't rely on java library path, just on absolute
> filesystem location. if the library is extracted to the current directory,
> no directory or path issues will appear.
>
> If you find this inadequate to include in rxtx itself, please consider
> adding a boolean flag to define wether or not RXTX will call
> System.loadLibrary, so that people wanting to use the scheme above can do it
> outside RXTX.
>
> thanks
> Ricardo
>
> -----Mensagem original-----
> De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
> nome de Awais Ahmed
> Enviada: quinta-feira, 10 de Julho de 2003 20:25
> Para: rxtx@linuxgrrls.org
> Cc: awaisa@hotmail.com
> Assunto: Re: [Rxtx] loading .dll or .so from jar
>
>
> Hello All,
> I guess the first question is: if it is possible.
> The answer is *NO*. I am not aware of any support
> like this from Suns JVM implementation.
> All JNI based shared libraries are loaded in the
> following flow of functional execution.
> 1. Java Application somewhere requests to load a
> native library. Using calls like
> System.loadLibrary(""). Normally this
> is done in some static initializers
> 2. Later, defining class loader of the class
> containing loadLibrary Call invokes a one of its
> JNI *native* function to load a library.
> 3. That particular native system library requests
> JVM to load the requested library, which is then
> loaded through the dynamic loader.
>
> Now to make it happen, one will have to consider
> security issues and see how to add support to
> extract a native library from a jar and place it
> in some location/path which could later be made
> accessible to the dynamic loader to load. And this
> again has an issue. Currently, I am not aware of
> any scenario where a JVM creates any executible
> code file anywhere in your secondary location.
> Anything that is generated is mapped on memory
> and is all dynamic. Introducing a system library
> would be a new thing.
>
> Note: It's it important to have a library be
> loaded through some VM as then VM will be
> responsible for unloading that library if it's
> no more referenced.
>
> Now I can think of folowing ways:
> 1. You create your own objects that makes use of
> packages like java.util.jar or java.util.zip
> or some other custom components and extract the
> native libraries at some location and then
> modify java.library.path and then let
> System.loadLibrary play it trick. It is a
> little ugly as one also will have to keep in
> mind some files cleanup mechanism.
>
> 2. An ideal way (may not be in your control to
> do it) could be:
> Have the VM do it totally and issues would be:
> Since dynamic loader also has a major role
> in loading a library, which has to have some
> physical existance accessible through some path.
> And there are issues and concerns if VM will
> create a new file with executible code in a
> disk-space. As any runtime code should only be
> laid out in memory. (Note it's not accesptable
> to have VM create/introduce any new native code
> based files) One option that makes it do-able
> is if dynamic loader gives an interface to load
> a library from memory. In this scenario VM could
> extract the system library bits and map it in
> some memory and let the dynamic loader accept
> executible code from memory.
> One can try it on some research VMs along with
> some adding some support in dynamic loader.
>
> Awais Sheikh
>
> PS: I am not sure if this email will go through as
> I am not sending it through my registered email
> address.
>
> ----- Original Message -----
> From: "Ricardo Trindade"
> To: "Java RXTX discussion"
> Sent: Thursday, July 10, 2003 10:35 AM
> Subject: RE: [Rxtx] loading .dll or .so from jar
>
>
> >I've looked this article up on the net, which explains the concept.
> >
> >I implemented it, but found an issue regarding the native lib. I load the
> >library with System.load, but an exception
> >is thrown on you System.loadlibrary("rxtxSerial"), saying I don't have the
> >library on java.library.path. So I imagine that for this to be possible you
> >would have to handle the loading with System.load, as stated in the
> >article,
> >or accept an argument to not load the library.
> >
> >What do you think of this ?
> >
> >Ricardo
> >
> >-----Mensagem original-----
> >De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em
> >nome de Trent Jarvi
> >Enviada: segunda-feira, 7 de Julho de 2003 1:45
> >Para: Java RXTX discussion
> >Assunto: Re: [Rxtx] loading .dll or .so from jar
> >
> >
> >
> >
> >On Mon, 7 Jul 2003, Ricardo Trindade wrote:
> >
> > > Hi,
> > >
> > > Hi was wondering if you haver considered including the .dll and .so in
> >the
> > > jar, and loading the adequate one depending on the platform.
> > >
> > > Is this even possible ?
> > >
> > > It would also make life easier for rxtx begginners. The only drawback I
> >see
> > > is the increase in jar size, but people concerned about that could
> >always
> > > delete it. Also with tens of megs of JRE it's hardly a problem for any
> >java
> > > user...
> > >
> >
> >Hi Ricardo
> >
> >Thats a great idea.
> >
> >Have you done something like this before? I can picture everything
> >required except for the native library paths. Thats probably doable also.
> >
> >That certainly would simplify installs.
>
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
> _______________________________________________
> Rxtx mailing list
> Rxtx@linuxgrrls.org
> http://hex.linuxgrrls.org/mailman/listinfo/rxtx
>
From robilad at kaffe.org Mon Jul 14 12:41:38 2003
From: robilad at kaffe.org (Dalibor Topic)
Date: Fri Jun 3 18:07:59 2005
Subject: [Rxtx] Implementing javax.comm for free software java
implementations (Was:
Re: [kaffe] Notes on kaffe (GNU Classpath integration) todo items)
In-Reply-To: <200307140820.h6E8KM518684@guri.is.kpn.be>
References: <1058125728.1750.28.camel@localhost>
<200307140820.h6E8KM518684@guri.is.kpn.be>
Message-ID: <3F1296F2.9060801@kaffe.org>
Hi Chris,
I've CC:ed Trent Jarvi, the maintainer of rxtx, see http://www.rxtx.org
for more information about it.
Chris Gray wrote:
> On Monday 14 July 2003 00:11, Mark Wielaard wrote:
>
>
>>- javax.comm stuff
>> - Kaffe has incomplete stubs
>> - There is the rxtx (sp?) project which has been usable.
>> (Check kaffe mailinglist archives)
>> They have ported to lots of platforms
>> - Wonka also has a implementation... (Status?)
>
>
> Wonka implementation status:
> [+] works, tested in a number of real-life situations. Uses async i/o on
> Linux.
> [-] ugly as hell: hard-coded data structures for 4 serial ports, giant
> switch statements, etc. Uses Wonka Native Interface (WNI), would need porting
> to JNI (but this is not hard).
>
> For a project I'm working on currently it could be interesting to either
> convert the current Wonka implementation to JNI or switch to rxtx. Has anyone
> out there anyhing good or bad to say about rxtx?
For kaffe it would be nice to use rxtx, since
* we had it nicely running under kaffe
http://www.kaffe.org/pipermail/kaffe/2003-April/029251.html
* it is supposed to be quite portable
The following OS's should have full Serial Commapi Serial Support:
mingw32 (windows 9* NT*) (no printer support)
WinCE (no printer support)
Solaris 2.x (*-*-solaris2*) x86 and sparc
Linux ELF (*-*-linux*, except aout, coff, and oldld)
FreeBSD 3.x 4.x (*-*-freebsd2*, *-*-freebsd3*)
Mac OS X
HP-UX 10.x (*-*-hpux10*)
SCO OpenServer 5.x (*-*-sco3.2v5*) (there may be recent breakage)
UnixWare
Digital/UNIX
* it appears to be in widespread use in different projects.
* it can be 'plugged in' into Sun's javax.comm implementation.
On the negative side:
* it needs someone to write the java part of javax.comm (which wonka
already has working, kaffe has a GPLd implementation of unknown quality).
* We don't have anyone from rxtx on Classpath's or Kaffe's mailing
lists, so there is a communication gap.
cheers,
dalibor topic
From taj at linuxgrrls.org Mon Jul 14 16:28:29 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 18:07:59 2005
Subject: [Rxtx] Implementing javax.comm for free software java
implementations
(Was: Re: [kaffe] Notes on kaffe (GNU Classpath integration) todo
items)
In-Reply-To: <3F1296F2.9060801@kaffe.org>
References: <1058125728.1750.28.camel@localhost>
<200307140820.h6E8KM518684@guri.is.kpn.be>
<3F1296F2.9060801@kaffe.org>
Message-ID:
On Mon, 14 Jul 2003, Dalibor Topic wrote:
> Hi Chris,
>
> I've CC:ed Trent Jarvi, the maintainer of rxtx, see http://www.rxtx.org
> for more information about it.
>
> Chris Gray wrote:
> > On Monday 14 July 2003 00:11, Mark Wielaard wrote:
> >
> >
> >>- javax.comm stuff
> >> - Kaffe has incomplete stubs
> >> - There is the rxtx (sp?) project which has been usable.
> >> (Check kaffe mailinglist archives)
> >> They have ported to lots of platforms
> >> - Wonka also has a implementation... (Status?)
> >
> >
> > Wonka implementation status:
> > [+] works, tested in a number of real-life situations. Uses async i/o on
> > Linux.
> > [-] ugly as hell: hard-coded data structures for 4 serial ports, giant
> > switch statements, etc. Uses Wonka Native Interface (WNI), would need porting
> > to JNI (but this is not hard).
> >
> > For a project I'm working on currently it could be interesting to either
> > convert the current Wonka implementation to JNI or switch to rxtx. Has anyone
> > out there anyhing good or bad to say about rxtx?
>
> For kaffe it would be nice to use rxtx, since
>
> * we had it nicely running under kaffe
> http://www.kaffe.org/pipermail/kaffe/2003-April/029251.html
>
> * it is supposed to be quite portable
>
> The following OS's should have full Serial Commapi Serial Support:
>
> mingw32 (windows 9* NT*) (no printer support)
> WinCE (no printer support)
> Solaris 2.x (*-*-solaris2*) x86 and sparc
> Linux ELF (*-*-linux*, except aout, coff, and oldld)
> FreeBSD 3.x 4.x (*-*-freebsd2*, *-*-freebsd3*)
> Mac OS X
> HP-UX 10.x (*-*-hpux10*)
> SCO OpenServer 5.x (*-*-sco3.2v5*) (there may be recent breakage)
> UnixWare
> Digital/UNIX
>
> * it appears to be in widespread use in different projects.
>
> * it can be 'plugged in' into Sun's javax.comm implementation.
>
> On the negative side:
> * it needs someone to write the java part of javax.comm (which wonka
> already has working, kaffe has a GPLd implementation of unknown quality).
>
> * We don't have anyone from rxtx on Classpath's or Kaffe's mailing
> lists, so there is a communication gap.
>
There should also be minimal support for printer ports on w32 also.
We'd be more than willing to work with Classpath and or Kaffe to get this
working. RXTX 2.1 implements CommAPI from the top down but is in package
gnu.io to avoid confusion with Sun's impementation.
RXTX 2.0 implements the lower portion of CommAPI and could be made to work
with the upper portion offered in Kaffe. The Kaffe shell classes did look
acceptable when I read through them.
--
Trent Jarvi
From robilad at kaffe.org Mon Jul 14 17:03:17 2003
From: robilad at kaffe.org (Dalibor Topic)
Date: Fri Jun 3 18:07:59 2005
Subject: [Rxtx] Implementing javax.comm for free software java
implementations
(Was: Re: [kaffe] Notes on kaffe (GNU Classpath integration) todo
items)
In-Reply-To:
References: <1058125728.1750.28.camel@localhost> <200307140820.h6E8KM518684@guri.is.kpn.be> <3F1296F2.9060801@kaffe.org>
Message-ID: <3F12D445.5070808@kaffe.org>
Hi Trent,
Trent Jarvi wrote:
> We'd be more than willing to work with Classpath and or Kaffe to get this
> working. RXTX 2.1 implements CommAPI from the top down but is in package
> gnu.io to avoid confusion with Sun's impementation.
>
> RXTX 2.0 implements the lower portion of CommAPI and could be made to work
> with the upper portion offered in Kaffe. The Kaffe shell classes did look
> acceptable when I read through them.
Could we implement the javax.comm shell classes on top of RXTX 2.1
gnu.io API? I.e. would it be enough to just delegate method calls to
gnu.io. for a basic javax.comm implementation?
cheers,
dalibor topic
From taj at linuxgrrls.org Mon Jul 14 17:11:57 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 18:08:00 2005
Subject: [Rxtx] Implementing javax.comm for free software java
implementations
(Was: Re: [kaffe] Notes on kaffe (GNU Classpath integration) todo
items)
In-Reply-To: <3F12D445.5070808@kaffe.org>
References: <1058125728.1750.28.camel@localhost>
<200307140820.h6E8KM518684@guri.is.kpn.be>
<3F1296F2.9060801@kaffe.org>
<3F12D445.5070808@kaffe.org>
Message-ID:
On Mon, 14 Jul 2003, Dalibor Topic wrote:
> Hi Trent,
>
> Trent Jarvi wrote:
>
> > We'd be more than willing to work with Classpath and or Kaffe to get this
> > working. RXTX 2.1 implements CommAPI from the top down but is in package
> > gnu.io to avoid confusion with Sun's impementation.
> >
> > RXTX 2.0 implements the lower portion of CommAPI and could be made to work
> > with the upper portion offered in Kaffe. The Kaffe shell classes did look
> > acceptable when I read through them.
>
> Could we implement the javax.comm shell classes on top of RXTX 2.1
> gnu.io API? I.e. would it be enough to just delegate method calls to
> gnu.io. for a basic javax.comm implementation?
Hi Dalibor
That would be one possiblity. Another option would be to keep a diff
which simply converts RXTX 2.1 into javax.comm. There are even scripts
floating around which do that.
--
Trent Jarvi
From sylvie.locastello at thales-is.com Tue Jul 15 10:40:05 2003
From: sylvie.locastello at thales-is.com (Sylvie Locastello)
Date: Fri Jun 3 18:08:00 2005
Subject: [Rxtx] Java comm + kermit on rxtx
Message-ID: <3F13CBF5.6CEA1DFE@thales-is.com>
Hello,
1) Java SerialIO communication on Linux
We have to write a Java API, with serialIO communication
(RS232-RS422-RS485) protocol running on Linux target
machine.
we have found the "rxtx.org" website, the rxtx-2.1 seems to be a good
solution, so we're going to try it
2) Java Kermit on Linux
Further, we'll have probably to make file-transfert beetween machines
running on Linux, via serialIO communication
(RS232-RS422-RS485).
We actually think a good solution would be to have a Java Kermit API
running on Linux.
A good solution would be to add other LGPL code which already does
kermit into rxtx free of charge.
Has anybody already done this job : Java Kermit API on rxtx ?
Thanks in advance
Sylvie
From chris at kiffer.eunet.be Tue Jul 15 08:11:49 2003
From: chris at kiffer.eunet.be (Chris Gray)
Date: Fri Jun 3 18:08:00 2005
Subject: [Rxtx] Implementing javax.comm for free software java
implementations (Was: Re: [kaffe] Notes on kaffe (GNU Classpath
integration) todo items)
In-Reply-To:
References: <1058125728.1750.28.camel@localhost> <3F1296F2.9060801@kaffe.org>
Message-ID: <200307150711.h6F7Boj23624@xizor.is.kpn.be>
On Monday 14 July 2003 17:28, Trent Jarvi wrote:
> We'd be more than willing to work with Classpath and or Kaffe to get this
> working. RXTX 2.1 implements CommAPI from the top down but is in package
> gnu.io to avoid confusion with Sun's impementation.
>
> RXTX 2.0 implements the lower portion of CommAPI and could be made to work
> with the upper portion offered in Kaffe. The Kaffe shell classes did look
> acceptable when I read through them.
My current main project involves Wonka on uClinux, where everything is
statically linked: I'm a bit worried about the effects of LPGL contagion in
that environment. So I'll probably stick with the Wonka implementation for
that one, but check out rxtx for future projects.
--
Chris Gray /k/ Embedded Java Solutions
Embedded & Mobile Java, OSGi http://www.kiffer.be/k/
chris.gray@kiffer.be +32 477 599 703
From taj at linuxgrrls.org Tue Jul 15 20:00:53 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 18:08:00 2005
Subject: [Rxtx] Java comm + kermit on rxtx
In-Reply-To: <3F13CBF5.6CEA1DFE@thales-is.com>
References: <3F13CBF5.6CEA1DFE@thales-is.com>
Message-ID:
On Tue, 15 Jul 2003, Sylvie Locastello wrote:
> Hello,
>
>
> 1) Java SerialIO communication on Linux
> We have to write a Java API, with serialIO communication
> (RS232-RS422-RS485) protocol running on Linux target
> machine.
> we have found the "rxtx.org" website, the rxtx-2.1 seems to be a good
> solution, so we're going to try it
>
> 2) Java Kermit on Linux
>
> Further, we'll have probably to make file-transfert beetween machines
> running on Linux, via serialIO communication
> (RS232-RS422-RS485).
> We actually think a good solution would be to have a Java Kermit API
> running on Linux.
> A good solution would be to add other LGPL code which already does
> kermit into rxtx free of charge.
>
> Has anybody already done this job : Java Kermit API on rxtx ?
>
> Thanks in advance
> Sylvie
>
>
Hi Sylvie
I have looked at the Kermit project briefly. There is a G-kermit package
which is offered under the GPL. This would be a possible solution. One
could put together a JNI library which rxtx could call. It's my
understanding that commercial applications could then make calls to rxtx
but you should verify that.
It would not be very hard to make a java library with G-Kermit source.
Doing something in pure Java would probably be a larger project.
http://www.columbia.edu/kermit/gkermit.html
From taj at parcelfarce.linux.theplanet.co.uk Wed Jul 16 03:21:23 2003
From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk)
Date: Fri Jun 3 18:08:00 2005
Subject: [Rxtx] serial_select() modification for Win32 (fwd)
Message-ID:
--
Trent Jarvi
taj@www.linux.org.uk
---------- Forwarded message ----------
Hi Trent,
I was having troubles with rxtx-2.1-6 under Win32 so I
modified serial_select() in termios.c. I think I have
serial_select() acting a bit more like it's Linux
counter part. I have done very little testing with
this, namely used it with BlackBox and my application
both under Windows2000. I have attached the file so
you can review the changes.
Thanks for all your effort in developing this library,
it's much appreciated.
Mike Risi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: termios.c.tar.gz
Type: application/x-gzip-compressed
Size: 19392 bytes
Desc: termios.c.tar.gz
Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20030716/c9c9c113/termios.c.tar-0003.bin
From taj at parcelfarce.linux.theplanet.co.uk Thu Jul 17 18:03:01 2003
From: taj at parcelfarce.linux.theplanet.co.uk (taj@parcelfarce.linux.theplanet.co.uk)
Date: Fri Jun 3 18:08:01 2005
Subject: [Rxtx] WG: RXTX Issue (fwd)
Message-ID:
Summary:
rxtx requires an EventListener to use notifyOn*
The fix would involve moving code around in rxtx so it persists outside
the EventListener.
--
Trent Jarvi
taj@www.linux.org.uk
---------- Forwarded message ----------
HI!
I have found the problem/mistake with the parity error!
After removing the event listener it isn't possible to call any
notifyOn... Funktion.
In the file ErrorTest.java you can see the problem.
The problem occurs in all tested linux versions.
In windows we don't have this problems but there we use the sun classes!
Don't know why it happend but now i got rid of my problems.
Thankx for your help!
cu
----- Original Message -----
>
> As the case should be fairly simple, could you provide a test case
> that reproduces the problem so I can take a look?
>
> On Mon, 14 Jul 2003, Thomas Selner wrote:
>
> > I took a closer look at the function notifyOnParityError, and now i
> > know
why
> > i get the exception!
> > the function-call "nativeSetEventFlag" doesn't produce the
> > exception, but the function call "monThread.PE = true" does, because
> > "monThread"
always
> > has a "null"
> > value, but i couldn't find out why!
> >
> > could you help me with that?
> > i don't do nothing special with my serial port in my java program. i
> > just ...
> > * initialize a Serial-Port - object
> > * setSerialPortParams(1200,7,1,2)
> > * enableReceiveTimeout(1)
> > * call the functions "getInput/OutputStream"
> > * notifyOnParityError(true)
> > * notifyOnDataAvailable(true)
> > * sPort.addEventListener(...)
> >
> > that's all!
> >
> > ----- Original Message -----
> > >
> > > Hi Thomas
> > >
> > > I'm looking at RXTXPort.java
> > >
> > > public void notifyOnParityError( boolean enable )
> > > {
> > > if (debug)
> > > z.reportln( "RXTXPort:notifyOnParityError(
" +
> > > enable+" )");
> > > waitForTheNativeCodeSilly();
> > > MonitorThreadLock = true;
> > > nativeSetEventFlag( fd, SerialPortEvent.PE, enable
);
> > > monThread.PE = enable;
> > > MonitorThreadLock = false;
> > > }
> > >
> > > Lets assume there are no changes to SerialImp.c for a second. I'm
looking
> > > at rxtx-2.1-7pre16. If you are not using rxtx-2.1-7pre16, you can
test it
> > > by simply changing
> > >
> > > import javax.comm.*; to
> > > import gnu.io.*;
> > >
> > > in your source.
> > >
> > > If you comment out nativeSetEventFlag( fd, SerialPortEvent.PE,
enable );
> > > above, You can not generate the error you saw when you enable
> > > Parity
Error
> > > events.
> > >
> > > monThread.PE = true
> > >
> > > This is on the Java side. Perhaps you see an error as Parity
> > > Error
events
> > > are attempted to be sent but they must be different. Commenting
> > > out
that
> > > line just disabled Parity Error events.
> > >
> > > What is the error you see if you comment out the
> > > nativeSetEventFlag
shown
> > > above and leave the monThread.PE = true line?
> > >
> > > One way that PE events may not work on linux is if the serial port
driver
> > > used on your PC is not able to support TIOCGICOUNT. This would
> > > only happen on rare cards with very poor linux support.
> > >
> > > On Fri, 11 Jul 2003, Thomas Selner wrote:
> > >
> > > > Hello again, Mr. Jarvi!
> > > >
> > > > First, I really want to thank you for your help!!!
> > > >
> > > > I tried both suggestions for solving the problem, but ...
> > > >
> > > > @ Changes to SerialImp.c
> > >
> >
> ----------------------------------------------------------------------
> ----
> > --
> > > > --------------------------------------------
> > > > When I added the #ifndef Statement as you told me, i could
> > > > compile
and
> > run
> > > > my application, but
> > > > i wasn't able to receive any SerialEvent anymore!
> > >
> >
> ----------------------------------------------------------------------
> ----
> > --
> > > > --------------------------------------------
> > > >
> > > > @ Changes to RXTXPort.java
> > >
> >
> ----------------------------------------------------------------------
> ----
> > --
> > > > --------------------------------------------
> > > > I out-commented the line "nativeSetEventFlag( fd,
SerialPortEvent.PE,
> > > > enable );", but it didn't change something at all.
> > > > So i tried to out-comment the next line "monThread.PE = true".
> > > > That
> > worked
> > > > for me, but i am afraid that from now i
> > > > will never be able to get ParityEvents anymore. the problem is,
> > > > i
don't
> > how
> > > > to really test parity errors ... :-)
> > >
> >
> ----------------------------------------------------------------------
> ----
> > --
> > > > --------------------------------------------
> > > >
> > > > I really need to get ALL SerialEvents, PE and DATA_AVAILABLE and
> > > > ... (etc.)!!!
> > > >
> > > > I have to say that I used the RXTX Version 2.0.5, because I
> > > > didn't
want
> > to
> > > > change the "import" statements from
> > > > "javax.comm" to "gnu.io". I know that there is a script which
> > > > solves
> > this
> > > > problem ("changePackage.sh"), but i didn't really understand,
> > > > how and when (before or after compiling rxtx?) i should use it!
> > > >
> > > > Should i use a newer version of rxtx (e.g. 2.1.6)? will it work
there?
> > > >
> > > >
> > > > Thomas
> > > >
> > > >
> > > >
> > > >
> > > > ----- Original Message -----
> > > >
> > > > > On Thu, 10 Jul 2003, Thomas Selner wrote:
> > > > >
> > > > > > Hi Mr. Jarvi!
> > > > > >
> > > > > > I would like to use RXTX in relation with a serial device,
> > > > > > but i
> > need to
> > > > use the
> > > > > > CommAPI Function "SerialPort.notifyOnParityError(boolean)".
> > > > > >
> > > > > > When i compile my classes under windows xp with the comm-api
> > provided by
> > > > sun,
> > > > > > it works. under redhat linux 9 i get following exception
> > > > > > when
> > calling
> > > > the above function:
> > > > > >
> > > > > > nativeSetEventFlag !index java.lang.NullPointerException
> > > > > > at
> > gnu.io.RXTXPort$MonitorThread.access$702(RXTXPort.java:1500)
> > > > > > at
gnu.io.RXTXPort.notifyOnParityError(RXTXPort.java:990)
> > > > > > at
> > > > at.bdc.intersport.bk.eps48.Eps48Base.perform(Eps48Base.java:50)
> > > > > > at
> > > >
at.bdc.intersport.tester.serial.SerialTester.main(SerialTester.java:103)
> > > > > >
> > > > > >
> > > > > > could you plz tell me if this function is implemented in
> > > > > > rxtx or
> > when it
> > > > will be implemented?
> > > > > >
> > > > > >
> > > > > >
> > > > > > greetz ... thomas
> > > > >
> > > > > Hi Thomas
> > > > >
> > > > > I think this is implemented but there is some cruft that needs
> > > > > to
be
> > > > > fixed.
> > > > >
> > > > > in SerialImp.c there needs to be an ifdef TIOCSERGETLSR
> > > > > (remove
the "+
> > > > "'s):
> > > > > JNIEXPORT void JNICALL RXTXPort(nativeSetEventFlag)( JNIEnv
*env,
> > > > >
> > > > > jobject
jobj,
> > > > > jint
fd,
> > > > > jint
event,
> > > > >
> > > > > jboolean
> > flag )
> > > > > {
> > > > >
> > > > > + #ifndef TIOCSERGETLSR
> > > > > ... entire function
> > > > > + #endif /* TIOCSERGETLSR */
> > > > > }
> > > > >
> > > > > You could also comment out
> > > > >
> > > > > nativeSetEventFlag( fd, SerialPortEvent.PE, enable );
> > > > >
> > > > > in RXTXPort.java:notifyOnParityError( boolean enable )
> > > > >
> > > > > On linux the result would be the same either way.
> > > > >
> > > > > This function is a workaround for Solaris and is really
> > > > > unrelated
to
> > > > > getting linux PE working. I see that rxtx is checking for PE
> > > > > but
I'm
> > > > > guessing it is not well tested since this is the first time
> > > > > the
> > problem
> > > > > has shown up.
> > > > >
> > > > > Could you let me know if that works?
> > > > >
> > > > > --
> > > > > Trent Jarvi
> > > > > taj@www.linux.org.uk
> > > >
> > > >
> > >
> > > --
> > > Trent Jarvi
> > > taj@www.linux.org.uk
> >
> >
>
> --
> Trent Jarvi
> taj@www.linux.org.uk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ErrorTest.class
Type: application/octet-stream
Size: 1621 bytes
Desc:
Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20030717/6e365fc7/ErrorTest-0001.class
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ErrorTest.java
Type: application/octet-stream
Size: 1281 bytes
Desc:
Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20030717/6e365fc7/ErrorTest-0005.obj
From emiliano at carlesi.vg Sat Jul 19 20:47:35 2003
From: emiliano at carlesi.vg (emiliano carlesi)
Date: Fri Jun 3 18:08:01 2005
Subject: [Rxtx] rxtx on osx
Message-ID:
hi to all !
this is my first mail in this ml ... so excuse if the question is
stupid !
i use osx and i need to use my cell phone via bluetooth, with java.
i have create the serial bluetooth link with the phone and from the
zterm console all work well.
now i need to do the same think from my program.
i write to the apple dev ml and all reply me to use the rxtx.
then i download rxtx and i try to compile it, following the
instructions. i have the version rxtx-2.1-7pre16.
i read on the instruction for osx users (using project builder). i
open the project the i need to compile
the target libSerial.jnilib, but i have not this target in this
project, i have only the librxtxSerial.jnilib target.
then i try to compile this. the compiler end with error because it
don't find the Zystem package.
i search on the rxtx site but i don't find nothing about this package.
i try then to download the previous version, the 1.5 (i see there are
some pointer to this version in the docs).
after the download (version 1.5-8) i try to compile and in this project
i find the LibSerial.jnilib target !
very happy i try to compile this and the compilation ... fail :-(
this is the error :
#!/bin/tcsh
cp build/RXTXcomm.jar
../ForPackageMaker/Install/System/Library/Frameworks/JavaVM.framework/
Versions/1.3.1/Home/lib/ext/
--- Output ---
cp:
../ForPackageMaker/Install/System/Library/Frameworks/JavaVM.framework/
Versions/1.3.1/Home/lib/ext: No such file or directory
=== Exit code: 1 ===
...failed PhaseScriptExecution
/Users/emilianocarlesi/Desktop/rxtx-1.5-8/MACOSX_IDE/PB/
build/LibSerial.build/RXTXcomm.build/BPTag004-script.sh ...
in the build directory i find : the RXTXcomm.jar package, a link to it
and a directory LibSerial.build.
instead for the documentation i need to find here the libSerial.jnilib
file.
thanks in advance
emiliano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 2014 bytes
Desc: not available
Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20030719/f1c69502/attachment-0003.bin
From taj at linuxgrrls.org Fri Jul 18 20:56:00 2003
From: taj at linuxgrrls.org (Trent Jarvi)
Date: Fri Jun 3 18:08:01 2005
Subject: [Rxtx] rxtx on osx
In-Reply-To:
References: