getting exception :
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
Caught java.lang.UnsatisfiedLinkError:
com.sun.comm.SolarisDriver.readRegistrySerial(Ljava/util/Vector;Ljava/
lang/String;)I while loading driver com.sun.comm.SolarisDriver
Port List : javax.comm.commportenumera...@1a758cb



the code is
help me


import java.io.*;
import java.util.*;
import javax.comm.*;

public class SimpleWrite
{

static Enumeration portList;
static CommPortIdentifier portId;
static String dest = "+91942120071";
static String messageString = "Hello";

static String commandString = "AT+CMGF=1\r\n AT+CMGS=\"" + dest + "\"\r
\n " + messageString + "\r\n\u001A";

static SerialPort serialPort;
static OutputStream outputStream;

public static void main(String[] args)
{
System.out.println("get Bytes data : " +
commandString.getBytes().toString());
portList = CommPortIdentifier.getPortIdentifiers();
System.out.println("Port List : " + portList);
while (portList.hasMoreElements())
{
portId = (CommPortIdentifier) portList.nextElement();
System.out.println("Port ID : " + portId + " ----- " +
CommPortIdentifier.PORT_SERIAL);
if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL)
{
if (portId.getName().equals("COM3"))
{
try
{
serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000);
}
catch (PortInUseException e)
{
System.out.println("Port In Use " +e);
}
try
{
outputStream = serialPort.getOutputStream();
}
catch (IOException e)
{
System.out.println("Error writing to output stream " + e);
}
try
{
serialPort.setSerialPortParams(9600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);
}
catch (UnsupportedCommOperationException e) { }
try
{
outputStream.write(commandString.getBytes());
outputStream.flush();
// System.out.println(Byte.toString(commandString.getBytes()));
}
catch (IOException e)
{
System.out.println("Error writing message " + e);
}
}
}
}
}
}

-- 
You received this message because you are subscribed to the Google Groups 
"SMSLib User Group" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/smslib?hl=en.

Reply via email to