Error Loading Solaris Serial Java.lang.unsatisfiedlinkerror
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error in loading serial port shared library using java up vote 0 down vote favorite I have to send data to serial port, javax.comm is also included but it gives the error "Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while loading driver gnu.io.RXTXCommDriver 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" I visited all serial port data read write related question in stackoverflow but find no any solution you kindly help me the code is below: package serial; import java.io.*; import java.util.*; import javax.comm.SerialPort; import javax.comm.CommPortIdentifier; import javax.comm.UnsupportedCommOperationException; import javax.comm.PortInUseException; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!\n"; static SerialPort serialPort; static OutputStream outputStream; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM6")) { //if (portId.getName().equals("/dev/term/a")) { try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} } } } } } java serial-port serial-communication javax.comm share|improve this question edited Feb 16
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Why http://stackoverflow.com/questions/21790982/error-in-loading-serial-port-shared-library-using-java am I getting “UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path” up vote 0 down vote favorite Hi i am trying to send sms to my mobile using java.When I run the application I am getting the the follwing error. package HelloWorld; import java.io.*; import java.util.BitSet; import javax.comm.*; import java.lang.*; public class SerialToGsm { InputStream in; OutputStream out; String lastIndexRead; String senderNum; String smsMsg; SerialToGsm(String porta) { http://stackoverflow.com/questions/2851748/why-am-i-getting-unsatisfiedlinkerror-no-solarisserialparallel-in-java-library try { // CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("serial0"); CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(porta); SerialPort sp = (SerialPort)portId.open("Sms_GSM", 0); sp.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(sp.FLOWCONTROL_NONE); in = sp.getInputStream(); out = sp.getOutputStream(); // modem reset sendAndRecv("+++AT", 30); // delay for 20 sec/10 sendAndRecv("AT&F", 30); sendAndRecv("ATE0", 30); // echo off sendAndRecv("AT +CMEE=1", 30); // verbose error messages sendAndRecv("AT+CMGF=0", 70); // set pdu mode // sendAndRecv("AT V1E0S0=0&D2&C1", 1000000); } catch (Exception e) { System.out.println("Exception " + e); System.exit(1); } } private String sendAndRecv(String s, int timeout) { try { // clean serial port input buffer in.skip(in.available()); System.out.println("=> " + s); s = s + "\r"; // add CR out.write(s.getBytes()); out.flush(); String strIn = new String(); for (int i = 0; i < timeout; i++){ int numChars = in.available(); if (numChars > 0) { byte[] bb = new byte[numChars]; in.read(bb,0,numChars); strIn += new String(bb); } // start exit conditions // --------------------- if (strIn.indexOf(">\r\n") != -1) { break; } if (strIn.indexOf("OK\r\n") != -1){ break; } if (strIn.indexOf("ERROR") != -1) { // if find 'error' wait for CR+LF if (strIn.indexOf("\r\n",strIn.indexOf("ERROR") + 1) != -1) { break; } } Thread.sleep(100); // delay 1/10 sec } System.out.println("<= " + strIn); if (strIn.len
This Site Careers Other all forums Forum: Java in General problem in javax.comm priya pratheepp Ranch Hand Posts: 59 posted 8 years ago Hi friends I am doing one program to list all https://coderanch.com/t/385319/java/java/javax-comm the ports.I down loaded javax.comm-v2-win32.zip from http://www.stanford.edu/~bsuter/javax.comm-v2-win32.zip I set class path with the help of link http://www.stanford.edu/~bsuter/javax.comm-instructions-win32.txt When i run the below program i am getting the error of Error loading SolarisSerial: http://www.java-samples.com/showtutorial.php?tutorialid=1139 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 Caught java.lang.UnsatisfiedLinkError: com.sun.comm.SolarisDriver.readRegistrySerial(Ljava/util/Vector;Ljava/lang/String I while loading driver com.sun.comm.SolarisDriverVerifying Comm Build Environment error loading My Program is [code] public class VerifyCommBuild { public static void main(String args[]) { Enumeration ports; System.out.println("Verifying Comm Build Environment"); try { ports = CommPortIdentifier.getPortIdentifiers(); if (ports == null) { System.out.println("No comm ports found!"); return; } System.out.println("Some ports appear to have been found, let's try to enumerate them."); while (ports.hasMoreElements()) { System.out.println("Here is a port [" + ((CommPortIdentifier)ports.nextElement()).getName() + "]"); } } catch (Exception e) error loading solaris { System.out.println("Failed to enumerate ports [" + e.getMessage() + "]"); e.printStackTrace(); } System.out.println("Complete."); } } [\code] pls help me to sort out this.I tried in many ways using google but failed thanks priya Ulf Dittmer Rancher Posts: 42968 73 posted 8 years ago Are you trying to run the Windows implementation on Solaris? I don't think you'd get these error messages if the code was running on Windows. priya pratheepp Ranch Hand Posts: 59 posted 8 years ago i am working in pure windows XP i am getting mad with this error Jesper de Jong Java Cowboy Saloon Keeper Posts: 15543 43 I like... posted 8 years ago Are you really sure that you are using the Windows version of the library? Because the error messages look like it is trying to find libraries for Solaris (not Windows - Solaris is Sun's implementation of Unix). Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation priya pratheepp Ranch Hand Posts: 59 posted 8 years ago Thank you friends... I deleted everything and copied once again...problem is solved but i am n
ports in your system using Java By: Ashish Emailed: 1504 times Printed: 1827 times Latest comments By: rohit kumar - how this program is work By: Kirti - Hi..thx for the hadoop inBy: Spijker - I have altered the code aBy: ali mohammed - why we use the java in neBy: ali mohammed - why we use the java in neBy: mizhelle - when I exported the data By: raul - no output as well, i'm geBy: Rajesh - thanx very much...By: Suindu De - Suppose we are executing Are you getting javax.comm.NoSuchPortException error? If yes, then first check if ur COM port is really been detected by the driver. I'll give you one program that will display all the serial and parallel ports in your system. /* program*/
import javax.comm.*;
import java.util.Enumeration;
public class ListPorts {
public static void main(String args[]) {
Enumeration ports = CommPortIdentifier.getPortIdentifiers();
while (ports.hasMoreElements()) {
CommPortIdentifier port = (CommPortIdentifier)ports.nextElement();
String type;
switch (port.getPortType()) {
case CommPortIdentifier.PORT_PARALLEL:
type = "Parallel";
break;
case CommPortIdentifier.PORT_SERIAL:
type = "Serial";
break;
default: /// Shouldn't happen
type = "Unknown";
break;
}
System.out.println(port.getName() + ": " + type);
}
}
}
just check it ... this is what the output will be!!( my case) COM1: Serial
COM2: Serial
COM7: Serial
LPT1: Parallel
LPT2: Parallel
Exception details :
javax.comm.NoSuchPortException
at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:105)
at SerialConnection.openConnection(SerialConnection.java:70)
at Sender.send(Sender.java:44)
at SMSClient.run(SMSClient.java:39)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at SerialConnection.openConnection(SerialConnection.java:87)
at Sender.send(Sender.java:44)
at SMSClient.run(SMSClient.java:39)
at java.lang.Thread.run(Unknown Source) View Tutorial By: Srinivasa Rao at 2009-04-02 05:17