Occasional Java Comm PortInUseException

Discussion in 'Java' started by fred, Aug 28, 2011.

  1. fred

    fred Guest

    Hi All,

    I am seeing an occasional PortInUseException being thrown by some
    driver code that uses the Java serial library. When thrown the
    message displays that the port is in use by an unknown Windows
    application. The port is definitely not being used by any other
    application however. The problem occurs on about 1 out of every 3
    reboots. Does anyone have any suggestions on how to solve this?

    Thank you,
    Fred
    fred, Aug 28, 2011
    #1
    1. Advertising

  2. fred

    Lew Guest

    On Sunday, August 28, 2011 12:55:18 PM UTC-7, fred wrote:
    > Hi All,
    >
    > I am seeing an occasional PortInUseException being thrown by some
    > driver code that uses the Java serial library. When thrown the
    > message displays that the port is in use by an unknown Windows
    > application. The port is definitely not being used by any other
    > application however. The problem occurs on about 1 out of every 3
    > reboots. Does anyone have any suggestions on how to solve this?


    Your assertion that "the port is definitely not being used by any other application" is suspect on the face of it. What makes you so damn certain, especially in the face of that error message?

    You also don't quote the error message, which makes it harder to give you advice.

    You might have a port in a TIME_WAIT state, or some other hidden problem that looks like the port is in use to your code

    Speaking of which, what is your code?
    http://sscce.org/

    What does netstat tell you at the time of the error?

    --
    Lew
    Lew, Aug 28, 2011
    #2
    1. Advertising

  3. fred

    fred Guest

    On Aug 28, 1:24 pm, Lew <> wrote:
    > On Sunday, August 28, 2011 12:55:18 PM UTC-7, fred wrote:
    > > Hi All,

    >
    > > I am seeing an occasional PortInUseException being thrown by some
    > > driver code that uses the Java serial library.  When thrown the
    > > message displays that the port is in use by an unknown Windows
    > > application.  The port is definitely not being used by any other
    > > application however.  The problem occurs on about 1 out of every 3
    > > reboots.  Does anyone have any suggestions on how to solve this?

    >
    > Your assertion that "the port is definitely not being used by any other application" is suspect on the face of it.  What makes you so damn certain, especially in the face of that error message?
    >
    > You also don't quote the error message, which makes it harder to give youadvice.
    >
    > You might have a port in a TIME_WAIT state, or some other hidden problem that looks like the port is in use to your code
    >
    > Speaking of which, what is your code?http://sscce.org/
    >
    > What does netstat tell you at the time of the error?
    >
    > --
    > Lew


    Note that it is a serial port I am talking about, not a network port.
    fred, Aug 29, 2011
    #3
  4. fred

    Lew Guest

    fred wrote:
    >Lew wrote:
    >> fred wrote:
    >>> I am seeing an occasional PortInUseException being thrown by some
    >>> driver code that uses the Java serial library.  When thrown the
    >>> message displays that the port is in use by an unknown Windows
    >>> application.  The port is definitely not being used by any other
    >>> application however.  The problem occurs on about 1 out of every 3
    >>> reboots.  Does anyone have any suggestions on how to solve this?

    >>
    >> Your assertion that "the port is definitely not being used by any other application" is suspect on the face of it.  What makes you so damn certain, especially in the face of that error message?
    >>
    >> You also don't quote the error message, which makes it harder to give you advice.
    >>
    >> You might have a port in a TIME_WAIT state, or some other hidden problemthat looks like the port is in use to your code
    >>
    >> Speaking of which, what is your code?
    >> http://sscce.org/
    >> What does netstat tell you at the time of the error?

    >
    > Note that it is a serial port I am talking about, not a network port.


    Well, that's an important point.

    What about that SSCCE?

    You have to give enough information for someone to help you. It helps if you spell things out in explicit detail and don't ignore requests for further information, like for an
    http://sscce.org/

    --
    Lew
    Lew, Aug 29, 2011
    #4
    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. Sven Schimmel
    Replies:
    1
    Views:
    498
  2. Mike Labosh

    Inconsistent occasional error

    Mike Labosh, Jun 18, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    384
    Mike Labosh
    Jun 18, 2004
  3. Replies:
    0
    Views:
    471
  4. Thomas Lindgaard

    Catch occasional exceptions - curses

    Thomas Lindgaard, Jul 28, 2004, in forum: Python
    Replies:
    3
    Views:
    296
    Josh Close
    Jul 29, 2004
  5. Alec Wysoker
    Replies:
    11
    Views:
    15,449
    Alec Wysoker
    Jan 12, 2006
Loading...

Share This Page