Results 1 to 8 of 8
  1. #1
    bbq
    bbq is offline Senior Member
    Join Date
    Jun 2007
    Posts
    132
    Rep Power
    0

    Default javax.comm:Error instantiating class com.sun.comm.Win32Driver

    I use winXP and JDeveloper as IDE
    I have to communicate comm port from my computer with other port comm from the same computer.
    The thing that I write with comm4, it has to be read by comm5.
    I've downloaded javacomm20-win32 api and I've followed the instructions:
    1.- C:\>copy c:\commapi\win32com.dll to c:\jdk1.1.6\bin
    2.- C:\>copy c:\commapi\comm.jar c:\jdk1.1.6\lib
    3.- C:\>copy c:\commapi\javax.comm.properties c:\jdk1.1.6\lib
    4.- C:\>set CLASSPATH=c:\jdk1.1.6\lib\comm.jar

    When I execute this program:


    Java Code:
    package Olentzero;
    
    import java.util.Enumeration;
    
    import javax.comm.CommPortIdentifier;
    
    public class CoMBilaketa {
    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);
    }
    }
    }
    this error appears:
    Java Code:
    java.io.IOException: Error instantiating class com.sun.comm.Win32Driver
    com.sun.comm.Win32Driver
    at javax.comm.CommPortIdentifier.loadDriver(CommPortI dentifier.java:239)
    at javax.comm.CommPortIdentifier.<clinit>(CommPortIde ntifier.java:109)
    at Olentzero.CoMBilaketa.main(CoMBilaketa.java:10)
    Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive
    at com.sun.comm.SunrayInfo.isSessionActive(Native Method)
    at com.sun.comm.Portmapping.registerCommPorts(Portmap ping.java:155)
    at com.sun.comm.Portmapping.refreshPortDatabase(Portm apping.java:100)
    at javax.comm.CommPortIdentifier.<clinit>(CommPortIde ntifier.java:138)
    at Olentzero.CoMBilaketa.main(CoMBilaketa.java:10)
    Process exited with exit code 1.
    any ideas?
    any suggest?

  2. #2
    Jack is offline Senior Member
    Join Date
    Jun 2007
    Posts
    130
    Rep Power
    0

    Default

    java.lang.UnsatisfiedLinkError: isSessionActive
    you don't have some library in the path

  3. #3
    bhujang09 is offline Member
    Join Date
    Feb 2008
    Posts
    1
    Rep Power
    0

    Default hai

    hello help

  4. #4
    Joe2003 is offline Member
    Join Date
    Jan 2008
    Posts
    21
    Rep Power
    0

    Default

    I spent ages trying to get it working, ended up using the rxtx class and was much better, still ended up writing tons of code to get it working

  5. #5
    Join Date
    Aug 2007
    Posts
    6
    Rep Power
    0

    Default You need to put all these files in JRE's directories...then only it will work...i tri

    You need to put all these files in JRE's directories...then only it will work...i tried ur sample it worked.

  6. #6
    Join Date
    Aug 2007
    Posts
    6
    Rep Power
    0

    Default

    Link for comm property file

    jempeg.org/javax.comm.properties

  7. #7
    Join Date
    Jul 2010
    Posts
    1
    Rep Power
    0

    Default

    http://www.cs.uml.edu/~fredm/courses...-javaxcomm.zip

    Download files from above link and try.

  8. #8
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,371
    Blog Entries
    7
    Rep Power
    20

    Default

    Sun's serial and/or parallel port communication support always has been a bit wobbly on MS Windows platforms and they have stopped the support for that platform. The alternative, the free RXTX package, works fine on that platform.

    kind regards,

    Jos

Similar Threads

  1. javax/comm/SerialPortEvent
    By musiigedeo in forum Threads and Synchronization
    Replies: 9
    Last Post: 11-24-2008, 11:07 AM
  2. Comm API Usage
    By hobbyist in forum New To Java
    Replies: 0
    Last Post: 11-16-2007, 04:59 PM
  3. javax.comm package for COM ports
    By valery in forum Advanced Java
    Replies: 1
    Last Post: 08-07-2007, 03:03 PM
  4. Error: javax.servlet.ServletException: Column not found
    By barney in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 08-07-2007, 07:20 AM
  5. Replies: 1
    Last Post: 08-01-2007, 06:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •