NoSuchPortException problem for serial port

623 Views Asked by At

I tried to connect to SerialPort COM6 using (Windows XP) javax.comm library with this piece of code

portId = CommPortIdentifier.getPortIdentifier(commName);
        port = portId.open("", Integer.parseInt(timeout));
        serialPort = (SerialPort) port;
        serialPort.setSerialPortParams(Integer.parseInt(baudRate), SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);

but I got exception NoSuchPortException and error

Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path
Caught java.lang.UnsatisfiedLinkError: com.sun.comm.SolarisDriver.readRegistrySerial(Ljava/util/Vector;Ljava/lang/String;)I while loading driver com.sun.comm.SolarisDriver
Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path

What is wrong with this ? Can anybody please help ?

2

There are 2 best solutions below

0
On BEST ANSWER

The implementation of this API is not available on all platforms.

0
On

you need to use rxtx libraries for windows.

http://rxtx.qbang.org/wiki/index.php/FAQ