aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes Java Communication API (URGENT) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Java Communication API (URGENT)" Watch "Java Communication API (URGENT)" New topic
Author

Java Communication API (URGENT)

Prabahar Kuppuswamy
Greenhorn

Joined: Sep 09, 2003
Posts: 2
I am facing a problem with the code below
System.out.println("Found port: "+portId.getName());
System.out.println("Currently Owned : " + portId.isCurrentlyOwned() + "\nOwned By : " + portId.getCurrentOwner());
try {
serialPort = (SerialPort) portId.open("SimpleReadApp", 2000);
} catch (PortInUseException e) { System.out.println(e + "\n Port Owner is : " + e.currentOwner);}
the output is as follows:
Found port: /dev/cua/a
Currently Owned : false
Owned By : Port currently not owned
javax.comm.PortInUseException: Port currently owned by another application, or cannot be accessed
Port Owner is : another application, or cannot be accessed
As you can see in the output when I check the port with isCurrentlyOwned() method it returns false which means that the port is not used. But when i try to open the port with open() method. It throws an exception. What could be the reason. I am running this code in Sun Solaris 9 and JDK 1.4.1_04
It is very urgent. Please help me.
Thanks in advance,
Prabahar
[ September 09, 2003: Message edited by: Prabahar Kuppuswamy ]
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Let's try moving this to the "Other API" forum.


"JavaRanch, where the deer and the Certified play" - David O'Meara
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Java Communication API (URGENT)