This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Caught java.lang.UnsatisfiedLinkError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Caught java.lang.UnsatisfiedLinkError" Watch "Caught java.lang.UnsatisfiedLinkError" New topic
Author

Caught java.lang.UnsatisfiedLinkError

Dhananjay Padalkar
Greenhorn

Joined: Feb 12, 2010
Posts: 13
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.CommPortEnumerator@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);
}
}
}
}
}
}
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

There are some *.so files that come with the javax.comm distribution; they need to be installed properly. Check the documentation that came with your javax.comm product.


[Jess in Action][AskingGoodQuestions]
Dhananjay Padalkar
Greenhorn

Joined: Feb 12, 2010
Posts: 13
thanks
but i an not getting exactly

i will go through the documentation
if possible give exactly file name

Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19656
    
  18

Please Use Code Tags the next time.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Java is looking for a native library, which should have the name SolarisSerialParallel.so (you're running this on Solaris, right?).


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Dhananjay Padalkar
Greenhorn

Joined: Feb 12, 2010
Posts: 13
no
i am using Microsoft platforms
Windows Xp SP2
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

... ummm, OK. Then the problem is that you're trying to use a Solaris javax.comm implementation on Windows!
Dhananjay Padalkar
Greenhorn

Joined: Feb 12, 2010
Posts: 13
thanks

but what should i do now

help me out
it's very urgent,
i had to submit my project work
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19656
    
  18

Dhananjay Padalkar wrote:it's very urgent,

EaseUp.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

The download page for javax.comm at Sun's web site very clearly says:


Note: Sun no longer offer's the Windows platform binaries of javax.comm, however javax.comm 2.0.3 can be used for the Windows platform, by using it in conjunction with the Win32 implementation layer provided by the RxTx project. To use that, download javax.comm for the 'generic' platform (which provides the front-end javax.comm API only, without platform specific back-end implementations bundled). Then acquire the Windows binary implementation rxtx-2.0.7pre1 from http://www.rxtx.org.


So did you follow these instructions?
Dhananjay Padalkar
Greenhorn

Joined: Feb 12, 2010
Posts: 13
Dear sir
i had allready followed the setting of java home like this


comm.jar --- be placed in:
%JAVA_HOME%/lib
%JAVA_HOME%/jre/lib/ext

win32com.dll should be placed in:
%JAVA_HOME%/bin
%JAVA_HOME%/jre/bin
%windir%System32


RXTXcomm.jar --- placed in:
%JAVA_HOME%/jre/lib/ext
%JAVA_HOME%/bin

javax.comm.properties ---- placed in:
%JAVA_HOME%/lib
%JAVA_HOME%/jre/lib


rxtxSerial.dll ---- placed in:
%JAVA_HOME%/jdk/jre/bin
%JAVA_HOME%/jre/bin


even though the exception remains same



Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Dhananjay Padalkar wrote:even though the exception remains same

Is the error message exactly the same, i.e. is it still complaining about the Solaris native library? If yes, then you are still using the wrong version of the library. Make sure you use the right version, remove the wrong one from your system.
Dhananjay Padalkar
Greenhorn

Joined: Feb 12, 2010
Posts: 13
i had completely uninstalled java & relative path setting
& copied the files attached with in ZIP to the paths

comm.jar --- be placed in:
%JAVA_HOME%/lib
%JAVA_HOME%/jdk/jre/lib
%JAVA_HOME%/jre/lib/ext

win32com.dll should be placed in:
%JAVA_HOME%/jdk/bin
%JAVA_HOME%/jdk/jre/bin
%JAVA_HOME%/jre/bin
%windir%System32


RXTXcomm.jar --- placed in:
%JAVA_HOME%/jre/lib/ext
%JAVA_HOME%/bin

javax.comm.properties ---- placed in:
%JAVA_HOME%/jdk/lib
%JAVA_HOME%/jdk/jre/lib
%JAVA_HOME%/jre/lib


rxtxSerial.dll ---- placed in:
%JAVA_HOME%/jdk/jre/bin
%JAVA_HOME%/jre/bin
%JAVA_HOME%/jdk/bin


even though the same exception is there

"Caught java.lang.ClassNotFoundException: com.sun.comm.Win32Driver while loading driver com.sun.comm.Win32Driver
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"

what should i do now





Dhananjay Padalkar
Greenhorn

Joined: Feb 12, 2010
Posts: 13
i had jsut now again downloaded
RXTXcomm.jar from
http://www.rxtx.org/

& trying

for solution
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Dhananjay Padalkar wrote:even though the same exception is there

"Caught java.lang.ClassNotFoundException: com.sun.comm.Win32Driver while loading driver com.sun.comm.Win32Driver
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"

It looks like you are still mixing parts of the Windows and the Solaris drivers. It looks like you don't have the Windows driver in your classpath, and you do have the Solaris driver in your classpath, which tries to load a native library for Solaris, which is obviously not what you want when you're running on Windows.

Are you sure you are not still using any of the JAR files from the Solaris version of the javax.comm package? What does the javax.comm.properties file contain?

Don't completely re-install Java, that won't help. Instead, concentrate on the problem that you're trying to solve.
Dhananjay Padalkar
Greenhorn

Joined: Feb 12, 2010
Posts: 13

the javax.comm.properties file contains -

#
# Drivers loaded by the Java Communications API standard extension
# at initialization time
#
# Format:
# Each line must contain ONE driver definition only
# Each line must be of the form:
# driver=<ClassName>
# No spaces or tabs in the line.
# ClassName must implement the interface javax.comm.CommDriver
# example: driver=Win32Serial
#
#
# The hash(#) character indicates comment till end of line.
#
# Windows Serial Driver
Driver=com.sun.comm.Win32Driver

Dhananjay Padalkar
Greenhorn

Joined: Feb 12, 2010
Posts: 13
is the property file can be used under Windows enviroment
Dhananjay Padalkar
Greenhorn

Joined: Feb 12, 2010
Posts: 13
is any answer to the exception
what should i d now
it's very URGENT
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19656
    
  18

Dhananjay Padalkar wrote:it's very URGENT

Please EaseUp.
Dhananjay Padalkar
Greenhorn

Joined: Feb 12, 2010
Posts: 13
Sorry Friend
my intension is not heart any one
but due to sumbmission work i am in hurry
Dhananjay Padalkar
Greenhorn

Joined: Feb 12, 2010
Posts: 13
Dear Friend
still i am getting the exception

Caught java.lang.ClassNotFoundException: com.sun.comm.Win32Driver while loading driver com.sun.comm.Win32Driver
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 : javax.comm.CommPortEnumerator@1a758cb
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

What should i do
can Uyou help me to get new versions of Comm.jar, win32com.dll, & javax.comm.properties

Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19656
    
  18

Dhananjay Padalkar wrote:com.sun.comm.Win32Driver ... win32com.dll

Why are you using the Windows driver for a Solaris environment? That will 100% guaranteed not work.
Dhananjay Padalkar
Greenhorn

Joined: Feb 12, 2010
Posts: 13
i am working in Windows Enviroment
OS : Windows Xp SP 2
JSDK 1.2.6

or if any new version of win32com.dll is available juts tell me i will download from the site

any think do you want to know so that i can clear them for easier to understand
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Caught java.lang.UnsatisfiedLinkError
 
Similar Threads
"CommPortIdentifier" ERROR
Please fix this code..............urgent......some minor errors in compiling
Getting available ports using Javax.comm
Getting available ports using Javax.comm
problem in javax.comm