• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

javax.comm.PortInUseException: Port currently owned by Unknown Windows Application

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
javax.comm.PortInUseException: Port currently owned by Unknown Windows Application

I am trying to do a program to send sms using a GSM modem.but i get the above error while try to run.
that com port is not using by any program as in my knowledge.

Please help me resolve the issue.

I have replicated the issue, by stopping the gateway and starting it back.

What i have identified is, even after stopGateway() is called, the connection is not released.
 
author
Posts: 23931
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ashwin Ganesh wrote:
I have replicated the issue, by stopping the gateway and starting it back.

What i have identified is, even after stopGateway() is called, the connection is not released.




If you stop the gateway, wait a few minutes, and then restart it, does it work? If so, it may be a TCP timed wait issue. Unfortunately, we can't tell if you are using TCP at all since you are providing a higher level exception here.

Henry
 
Ashwin Ganesh
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am making the thread to sleep for a minute and then starting the gateway again. Still it fails.
 
Henry Wong
author
Posts: 23931
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

BTW, I should mention that while the TCP timed wait is generally about 30 seconds, I have seen it (in some cases) set as high as five minutes.

Henry
 
Ashwin Ganesh
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ya Henry. You are right. I have even tried that. Still jumping to the same exception.

Even after calling serialPort.close(), the port is not getting released.
 
Ashwin Ganesh
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

The issue is now resolved. In place of comm.jar file, i used RXTXcomm.jar which resolved the issue.

Now am able to stop and start the gateway without getting PortInUseException.

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic