Any advice appreciated. I'm experiencing a "Device busy" Java RuntimeException in the complex, multi-threaded Java app I'm developing. It's running on a Sunfire X4170 with Solaris. It uses both serial ports /dev/cua/comf1a and /dev/cua/comf1b. One is active, the other for failover in case someone unplugs the active one. Every five seconds I have the code sending a heartbeat over both ports and receiving an acknowledgment message from the machine to which it is connected. In testing, I disconnect a serial cable to see whether the connection can be restored. The code repeatedly (every 30 seconds) closes the port and tries to reopen it using logic similar to the original opening of the port at app startup. The idea is that if someone reconnects the cable, the reopen logic will fire and all will be restored. But unfortunately, I get "Device busy" upon attempt to reopen the port (whether the cable is still unconnected or reconnected.) When I shut down the app and then restart it, the ports can be opened without issue. I am sure that there is nothing in the Java that I am forgetting to close in my close logic, though there may be a very subtle concurrency issue. I have no issue in Windows when running the app. I need to run on this machine with Solaris. I'm using Java Comm, by the way. It may have a bug in that it's close() method may be leaving the port not fully closed somehow, and I'm investigating that possibility. But if any Solaris expert can advise me on what may be an issue at the OS level, I'd appreciate it.
Thank you for any advice on this.
EDIT: If you are particularly interested in this issue, here is a background thread:
10007963
Edited by: user961095 on Dec 8, 2011 8:28 PM