Error loading SolarisSerial

Discussion in 'Java' started by quad, Mar 2, 2007.

  1. quad

    quad Guest

    Hello
    I tried running the examples on the following link on windows XP and
    2000.
    http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html
    Are those programs specific to solaris? Will they work on windows?

    I get the following errors when i tried to run the programs:

    E:\project\ckt download\Serial_port\trial2\classes>java SimpleWrite
    Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no
    SolarisSerialPar
    allel in java.library.path
    Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while
    loading driver c
    om.sun.comm.SolarisDriver
    Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no
    SolarisSerialPar
    allel in java.library.path
    Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while
    loading driver c
    om.sun.comm.SolarisDriver
    port COM1 not found.

    E:\project\ckt download\Serial_port\trial2\classes>java SimpleRead
    Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no
    SolarisSerialPar
    allel in java.library.path
    Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while
    loading driver c
    om.sun.comm.SolarisDriver
    Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no
    SolarisSerialPar
    allel in java.library.path
    Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while
    loading driver c
    om.sun.comm.SolarisDriver
    port COM1 not found.

    I get the following errors:

    comm.jar is placed in:

    %JAVA_HOME%/lib

    %JAVA_HOME%/jre/lib/ext

    win32com.dll is placed in:

    %JAVA_HOME%/bin

    %JAVA_HOME%/jre/bin

    %windir%System32

    javax.comm.properties is placed in:

    %JAVA_HOME%/lib

    %JAVA_HOME%/jre/lib

    Environment variable PATH also points to comm.jar file. Please guide
    me as to how I can correct the above errors.
    Regards
    Quad
     
    quad, Mar 2, 2007
    #1
    1. Advertising

  2. quad wrote:
    > Hello
    > I tried running the examples on the following link on windows XP and
    > 2000.
    > http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html
    > Are those programs specific to solaris? Will they work on windows?
    >
    > I get the following errors when i tried to run the programs:
    >
    > E:\project\ckt download\Serial_port\trial2\classes>java SimpleWrite
    > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no
    > SolarisSerialPar
    > allel in java.library.path
    > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while
    > loading driver c
    > om.sun.comm.SolarisDriver
    > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no
    > SolarisSerialPar
    > allel in java.library.path
    > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while
    > loading driver c
    > om.sun.comm.SolarisDriver
    > port COM1 not found.
    >
    > E:\project\ckt download\Serial_port\trial2\classes>java SimpleRead
    > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no
    > SolarisSerialPar
    > allel in java.library.path
    > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while
    > loading driver c
    > om.sun.comm.SolarisDriver
    > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no
    > SolarisSerialPar
    > allel in java.library.path
    > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while
    > loading driver c
    > om.sun.comm.SolarisDriver
    > port COM1 not found.
    >
    > I get the following errors:
    >
    > comm.jar is placed in:
    >
    > %JAVA_HOME%/lib
    >
    > %JAVA_HOME%/jre/lib/ext
    >
    > win32com.dll is placed in:
    >
    > %JAVA_HOME%/bin
    >
    > %JAVA_HOME%/jre/bin
    >
    > %windir%System32
    >
    > javax.comm.properties is placed in:
    >
    > %JAVA_HOME%/lib
    >
    > %JAVA_HOME%/jre/lib
    >
    > Environment variable PATH also points to comm.jar file. Please guide
    > me as to how I can correct the above errors.
    > Regards
    > Quad
    >


    It looks like you are using the Solaris API on a Windows machine?

    Get a Windows copy of JavaComm API and put the comm.jar file in:

    JDK?.?.?/bin/jre/lib/ext

    JRE?.?.?/lib/ext

    The win32com.dll goes in:

    JRE?.?.?/bin

    and the javax.comm.properties file goes in:

    JRE?.?.?/lib

    --

    Knute Johnson
    email s/nospam/knute/
     
    Knute Johnson, Mar 2, 2007
    #2
    1. Advertising

  3. quad

    Guest

    On Mar 2, 6:38 pm, Knute Johnson <>
    wrote:
    > Get a Windows copy of JavaComm API and put the comm.jar file in:


    Sun no longer distributes the Windows version. Get RxTx.
     
    , Mar 2, 2007
    #3
  4. wrote:
    > On Mar 2, 6:38 pm, Knute Johnson <>
    > wrote:
    >> Get a Windows copy of JavaComm API and put the comm.jar file in:

    >
    > Sun no longer distributes the Windows version. Get RxTx.
    >


    You can still get it and RXTX has a bunch of bugs under Windows. I
    don't recommend it. Google around and you can find Sun's version.

    --

    Knute Johnson
    email s/nospam/knute/
     
    Knute Johnson, Mar 3, 2007
    #4
  5. quad

    Guest

    On Mar 3, 1:34 am, Knute Johnson <>
    wrote:
    > You can still get it and RXTX has a bunch of bugs under Windows. I
    > don't recommend it. Google around and you can find Sun's version.


    Such finds are likely illegal. Sun never approved redistribution. And
    it is not a clever idea to download software for Windows from
    untrusted sources.
     
    , Mar 3, 2007
    #5
  6. wrote:
    > On Mar 3, 1:34 am, Knute Johnson <>
    > wrote:
    >> You can still get it and RXTX has a bunch of bugs under Windows. I
    >> don't recommend it. Google around and you can find Sun's version.

    >
    > Such finds are likely illegal. Sun never approved redistribution. And
    > it is not a clever idea to download software for Windows from
    > untrusted sources.
    >


    It is on Sun's site.

    https://sdlc2e.sun.com/ECom/EComActionServlet;jsessionid=A2EF022FE18F2C218AAAA1B87D00B6D5

    And you really don't have a choice if you want it to work.

    --

    Knute Johnson
    email s/nospam/knute/
     
    Knute Johnson, Mar 3, 2007
    #6
  7. quad

    quad Guest

    > It is on Sun's site.
    >
    > https://sdlc2e.sun.com/ECom/EComActionServlet;jsessionid=A2EF022FE18F...
    >


    Sorry I tried accessing that link, but it leads me to a login page. So
    couldn't find which download you were actually referring to.

    I downloaded the generic com api from
    https://sdlc3a.sun.com:443/ECom/EComActionServlet;jsessionid=FFE02C11D1406DB4570B3DFF7EEC945A

    Generic Platform - Java(tm) Communication API
    comm.jar, 2.0.3, generic, English (3rd party backward compatibility,
    only), English comm2.0.3.zip 31.84 KB

    And tried the examples from this link:
    http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html.
    But i've been getting the same error again n again. Is it a prob with
    API or with the program?

    > And you really don't have a choice if you want it to work.
    >

    I desperately want it to work. Please guide me!

    Regards
    Quad
     
    quad, Mar 6, 2007
    #7
  8. quad wrote:
    >> It is on Sun's site.
    >>
    >> https://sdlc2e.sun.com/ECom/EComActionServlet;jsessionid=A2EF022FE18F...
    >>

    >
    > Sorry I tried accessing that link, but it leads me to a login page. So
    > couldn't find which download you were actually referring to.
    >
    > I downloaded the generic com api from
    > https://sdlc3a.sun.com:443/ECom/EComActionServlet;jsessionid=FFE02C11D1406DB4570B3DFF7EEC945A
    >
    > Generic Platform - Java(tm) Communication API
    > comm.jar, 2.0.3, generic, English (3rd party backward compatibility,
    > only), English comm2.0.3.zip 31.84 KB
    >
    > And tried the examples from this link:
    > http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html.
    > But i've been getting the same error again n again. Is it a prob with
    > API or with the program?
    >
    >> And you really don't have a choice if you want it to work.
    >>

    > I desperately want it to work. Please guide me!
    >
    > Regards
    > Quad
    >
    >


    The one you downloaded won't work. I don't know what happened with the
    other link but try this one.

    http://javashoplm.sun.com/ECom/docs...spec-oth-JSpec&SiteId=JSC&TransactionId=noreg

    --

    Knute Johnson
    email s/nospam/knute/
     
    Knute Johnson, Mar 6, 2007
    #8
  9. quad

    quad Guest


    > The one you downloaded won't work. I don't know what happened with the
    > other link but try this one.
    >
    > http://javashoplm.sun.com/ECom/docs/Welcome.jsp?StoreId=22&PartDetail...
    >


    Thanks Mr.Johnson! I downloaded the windows version from that link,
    and copied the files in their appropriate locations:

    win32com.dll in <JDK>\bin directory.

    comm.jar in <JDK>\lib directory.

    javax.comm.properties in <JDK>\lib directory. (as per instructions
    given in the Java(tm) Communications API Win32 Installation
    Instructions html page that is included in the zip file.

    I tried executing the SimpleRead and SimpleWrite programs with serial
    port name as COM1 or COM2. It compiled without errors. But it does not
    give any output.

    I also tried executing the program below, which you had posted
    sometime back in this group.

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

    public class CheckPort {
    public CheckPort() {
    CommPortIdentifier cpi = null;

    Enumeration e = CommPortIdentifier.getPortIdentifiers();

    while (e.hasMoreElements()) {
    try {
    cpi = (CommPortIdentifier) e.nextElement();
    } catch (NoSuchElementException n) {}
    System.out.println(cpi.getName());
    }
    }
    public static void main(String[] args) { new CheckPort(); }

    }

    The program does not return any results. I'd placed the files as per
    the instructions page, and as per your post on mar2. But still I get
    the same display: "port COM1 not found".

    The installation instructions page says: "The javax.comm.properties
    file must be installed. If it is not, no ports will be found by the
    system." Does this simply mean copying java.comm.properties file to
    <JDK>\lib directory or something more??
    Please help me resolve this issue.
    Thanks a lot
    Quad
     
    quad, Mar 7, 2007
    #9
  10. quad wrote:
    >> The one you downloaded won't work. I don't know what happened with the
    >> other link but try this one.
    >>
    >> http://javashoplm.sun.com/ECom/docs/Welcome.jsp?StoreId=22&PartDetail...
    >>

    >
    > Thanks Mr.Johnson! I downloaded the windows version from that link,
    > and copied the files in their appropriate locations:
    >
    > win32com.dll in <JDK>\bin directory.
    >
    > comm.jar in <JDK>\lib directory.
    >
    > javax.comm.properties in <JDK>\lib directory. (as per instructions
    > given in the Java(tm) Communications API Win32 Installation
    > Instructions html page that is included in the zip file.
    >
    > I tried executing the SimpleRead and SimpleWrite programs with serial
    > port name as COM1 or COM2. It compiled without errors. But it does not
    > give any output.
    >
    > I also tried executing the program below, which you had posted
    > sometime back in this group.
    >
    > import java.io.*;
    > import java.util.*;
    > import javax.comm.*;
    >
    > public class CheckPort {
    > public CheckPort() {
    > CommPortIdentifier cpi = null;
    >
    > Enumeration e = CommPortIdentifier.getPortIdentifiers();
    >
    > while (e.hasMoreElements()) {
    > try {
    > cpi = (CommPortIdentifier) e.nextElement();
    > } catch (NoSuchElementException n) {}
    > System.out.println(cpi.getName());
    > }
    > }
    > public static void main(String[] args) { new CheckPort(); }
    >
    > }
    >
    > The program does not return any results. I'd placed the files as per
    > the instructions page, and as per your post on mar2. But still I get
    > the same display: "port COM1 not found".
    >
    > The installation instructions page says: "The javax.comm.properties
    > file must be installed. If it is not, no ports will be found by the
    > system." Does this simply mean copying java.comm.properties file to
    > <JDK>\lib directory or something more??
    > Please help me resolve this issue.
    > Thanks a lot
    > Quad


    comm.jar goes in JDK/jre/lib/ext and JRE/lib/ext
    javax.comm.properties goes in JRE/lib
    win32com.dll goes in JRE/bin

    JDK is the base directory of your JDK installation. On my system that
    is C:\Program Files\Java\jdk1.6.0\

    JRE is the base directory of your JRE installation. On my system that
    is C:\Program Files\Java\jre1.6.0\

    If any of the files are in the wrong directories it won't work even
    though it may compile. All that is required for it to compile is to
    have the comm.jar file in your path or the extension directory (where it
    belongs). This should work for any real serial port. I don't know if
    it will work with the USB->serial devices.

    Let us know if you get it going.

    --

    Knute Johnson
    email s/nospam/knute/
     
    Knute Johnson, Mar 7, 2007
    #10
  11. quad

    quad Guest


    > comm.jar goes in JDK/jre/lib/ext and JRE/lib/ext
    > javax.comm.properties goes in JRE/lib
    > win32com.dll goes in JRE/bin
    >

    I have set the above paths.

    > JDK is the base directory of your JDK installation. On my system that
    > is C:\Program Files\Java\jdk1.6.0\
    >
    > JRE is the base directory of your JRE installation. On my system that
    > is C:\Program Files\Java\jre1.6.0\


    I'm using j2sdk1.4.2_05 and windows 2000. Hope that shouldn't be the
    problem.
    > If any of the files are in the wrong directories it won't work even
    > though it may compile. All that is required for it to compile is to
    > have the comm.jar file in your path or the extension directory (where it
    > belongs).


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

    public class CheckPort {
    public CheckPort() {
    CommPortIdentifier cpi = null;

    Enumeration e = CommPortIdentifier.getPortIdentifiers();

    while (e.hasMoreElements()) {
    try {
    cpi = (CommPortIdentifier) e.nextElement();
    } catch (NoSuchElementException n) {}
    System.out.println(cpi.getName());
    }
    System.out.println("done");
    }
    public static void main(String[] args) { new CheckPort(); }

    }

    The above program compiles, and prints only "done" when run.(that
    means it does run properly?!) It doesn't ennumerate any serial ports,
    even though COM1 port is connected to serial port of 8051
    microcontroller.

    >This should work for any real serial port. I don't know if
    > it will work with the USB->serial devices.


    Its not a USB serial device. Here's a snapshot of my setup. It has the
    virtex board on the left, and the 8051 microcontroller on the right,
    whose serial port I'm trying to connect to the PC:

    http://www.esnips.com/doc/e646fd74-9672-4b29-94c0-d9741e9475c0/board_setup

    I'm using the serial cable supplied along with the kit and it does
    give me the right output on a hyperterminal. I read somewhere that
    these serial devices work on java and C till win98, and for later
    versions, I'd have to write my own device drivers. Is that true?

    > Let us know if you get it going.
    >

    Waiting for your response.
    Thanks
    Quad
     
    quad, Mar 14, 2007
    #11
  12. quad wrote:
    >> comm.jar goes in JDK/jre/lib/ext and JRE/lib/ext
    >> javax.comm.properties goes in JRE/lib
    >> win32com.dll goes in JRE/bin
    >>

    > I have set the above paths.
    >
    >> JDK is the base directory of your JDK installation. On my system that
    >> is C:\Program Files\Java\jdk1.6.0\
    >>
    >> JRE is the base directory of your JRE installation. On my system that
    >> is C:\Program Files\Java\jre1.6.0\

    >
    > I'm using j2sdk1.4.2_05 and windows 2000. Hope that shouldn't be the
    > problem.
    >> If any of the files are in the wrong directories it won't work even
    >> though it may compile. All that is required for it to compile is to
    >> have the comm.jar file in your path or the extension directory (where it
    >> belongs).

    >
    > import java.io.*;
    > import java.util.*;
    > import javax.comm.*;
    >
    > public class CheckPort {
    > public CheckPort() {
    > CommPortIdentifier cpi = null;
    >
    > Enumeration e = CommPortIdentifier.getPortIdentifiers();
    >
    > while (e.hasMoreElements()) {
    > try {
    > cpi = (CommPortIdentifier) e.nextElement();
    > } catch (NoSuchElementException n) {}
    > System.out.println(cpi.getName());
    > }
    > System.out.println("done");
    > }
    > public static void main(String[] args) { new CheckPort(); }
    >
    > }
    >
    > The above program compiles, and prints only "done" when run.(that
    > means it does run properly?!) It doesn't ennumerate any serial ports,
    > even though COM1 port is connected to serial port of 8051
    > microcontroller.
    >
    >> This should work for any real serial port. I don't know if
    >> it will work with the USB->serial devices.

    >
    > Its not a USB serial device. Here's a snapshot of my setup. It has the
    > virtex board on the left, and the 8051 microcontroller on the right,
    > whose serial port I'm trying to connect to the PC:
    >
    > http://www.esnips.com/doc/e646fd74-9672-4b29-94c0-d9741e9475c0/board_setup
    >
    > I'm using the serial cable supplied along with the kit and it does
    > give me the right output on a hyperterminal. I read somewhere that
    > these serial devices work on java and C till win98, and for later
    > versions, I'd have to write my own device drivers. Is that true?
    >
    >> Let us know if you get it going.
    >>

    > Waiting for your response.
    > Thanks
    > Quad
    >
    >


    I've used the Java Comm API with 1.4.2 so that shouldn't be a problem.
    I have never used Windows 2000 however. All of my current work is with
    XP and the Comm API works fine with XP.

    The test program should enumerate ports whether or not they are
    connected to a cable and other port. So the only thing I can suggest
    now is to double check that the files are in the right places,
    especially the javax.comm.properties file. If you can get a hold of a
    Windows 98 or XP computer, try and see if you can list the ports on that
    computer.

    --

    Knute Johnson
    email s/nospam/knute/
     
    Knute Johnson, Mar 14, 2007
    #12
  13. quad

    quad Guest

    Will you be able to mail me a copy of java.comm.properties file, jus
    in case mine was corrupt?
     
    quad, Mar 15, 2007
    #13
  14. quad

    quad Guest

    I reinstalled java and jre on my system, made the path changes, and
    the serial port finally did work. Thanks a lot for your support!
    Regards
    Quad
     
    quad, Mar 15, 2007
    #14
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Erwan
    Replies:
    0
    Views:
    2,296
    Erwan
    Apr 2, 2004
  2. David Segall
    Replies:
    2
    Views:
    457
    Thomas Kellerer
    Jan 2, 2007
  3. Replies:
    4
    Views:
    331
  4. edfialk
    Replies:
    0
    Views:
    205
    edfialk
    May 10, 2007
  5. ofir
    Replies:
    0
    Views:
    195
Loading...

Share This Page