Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting a PortInUseException trying to open USB Serial Port.



Hi,

I have connected a Serial Device to my Mac's USB Port,
and its getting recognized (Could see the entries in
/dev/ folder).

However, when I try to open the port by doing a 

serialPort = (SerialPort) portId.open("TestApp",
2000);
(portId is a CommPortIdentifier object)

I am getting a PortInUseException. Following is the
stacktrace of the error:

javax.comm.PortInUseException: Could not open
usbserial-3B13 
usbserial-3B13: SerOpenPort failed: : 16
         at 
javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:180)
         at
ScannerFunctionality.main(ScannerFunctionality.java:47)
Exception in thread "main"
java.lang.NullPointerException
         at
ScannerFunctionality.main(ScannerFunctionality.java:56)

Also, I tried to get the port owner, by doing a
PortInUseException.currentOwner, and this gives as
'Unknown'. 

Any idea of what could be causing this error, and how
to avoid this issue ?

Thanks,
Rafi SM




		
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - What will yours do?
http://my.yahoo.com 
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/usb/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.