• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.net.BindException: Address already in use

 
Suresh Khant
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am working in example for the NIO socket , i have found anexample from the net and i included it in my web application ,
in the first deploy of the war file , it works fine but whenever i redeploy the war file

i will get the error : java.net.BindException: Address already in use

it seems that port will be still opened even so if I undeploy the war file


any one tell me how to fix the issue
 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suresh Khant wrote:Hi All,

I am working in example for the NIO socket , i have found anexample from the net and i included it in my web application ,
in the first deploy of the war file , it works fine but whenever i redeploy the war file

i will get the error : java.net.BindException: Address already in use

it seems that port will be still opened even so if I undeploy the war file


any one tell me how to fix the issue


please share what example you found.
 
Suresh Khant
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim , Thanks alot for the reply ,

The example i have found is Rox java nio tutorial you can get the code and examples from the link :
http://rox-xmlrpc.sourceforge.net/niotut/
 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks,

How about the code to your web app? Can you show how you call this NIO stuff inside your web app?
 
Suresh Khant
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Time,

Here is the code ,

I am calling the servlet from the web.xml

TCPServlet.java









TCPServer.java



off course the other classes and code are in the rox examples , i did not include them . I hope that you could help me to fix this issue.

Thanking you.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic