Hi, I am trying to use the Java API however I’ve faced several issues.
Using the latest release v1.3.2, code compiles however crashed with warning:
Summary
Jun 29, 2025 6:31:00 PM com.digi.xbee.api.AbstractXBeeDevice open
INFO: [COM9 - 9600/8/N/1/N] Opening the connection interface…
WARNING: RXTX Version mismatch
Jar version = RXTX-2.2pre1
native lib Version = RXTX-2.2pre2
Jun 29, 2025 6:31:01 PM com.digi.xbee.api.AbstractXBeeDevice open
INFO: [COM9 - 9600/8/N/1/N] Connection interface open.
A fatal error has been detected by the Java Runtime Environment:
EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000001800044cb, pid=2924, tid=15492
[quote=“Thomas7414, post:1, topic:37301”]
Jun 29, 2025 6:31:00 PM com.digi.xbee.api.AbstractXBeeDevice open
INFO: [COM9 - 9600/8/N/1/N] Opening the connection interface…
WARNING: RXTX Version mismatch
Jar version = RXTX-2.2pre1
native lib Version = RXTX-2.2pre2
Jun 29, 2025 6:31:01 PM com.digi.xbee.api.AbstractXBeeDevice open
INFO: [COM9 - 9600/8/N/1/N] Connection interface open.
A fatal error has been detected by the Java Runtime Environment:
EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000001800044cb, pid=2924, tid=15492
The crash happened outside the Java Virtual Machine in native code.
See problematic frame for where to report the bug.
Process finished with exit code 1
[/quote] doing a quick search indicates that the .jar file (RXTXcom.jar and the native .dll (rxtxSerial.dll) are not from the same release.
The best way to address this is to replace both files with a trusted source or from the Digi SDK.
Just did a bit more testing today, I noticed that I cannot call open on an xbee device (XBeeDevice#open), otherwise it terminates without any errors.
This is the log, tested on both the example projects on the official github and my own project:
XBeeDevice xbee = new XBeeDevice("COM3", 9600);
xbee.open();
WARNING: RXTX Version mismatch
Jar version = RXTX-2.2pre1
native lib Version = RXTX-2.2 (CVS snapshot 2011.02.03, modified by CMU CREATE Lab, http://code.google.com/p/create-lab-commons/)
Jul 24, 2025 4:06:42 PM com.digi.xbee.api.AbstractXBeeDevice open
INFO: [COM3 - 9600/8/N/1/N] Opening the connection interface...
Jul 24, 2025 4:06:42 PM com.digi.xbee.api.AbstractXBeeDevice open
INFO: [COM3 - 9600/8/N/1/N] Connection interface open.
Process finished with exit code -1073741571 (0xC00000FD)