Unable to open debugger port in IntelliJ IDEA

后端 未结 29 1385
误落风尘
误落风尘 2021-01-30 08:21

I have a problem that I can not set up my application in debug mode with IntelliJ IDE, but run mode is OK.

My OS is Windows 7, IDE is IntelliJ IDEA, web container is Tom

相关标签:
29条回答
  • 2021-01-30 08:45

    My assumption that this exception usually occurs when Tomcat is improperly closed and still holding the ports. Usually it is enough to kill any process listening to 1099 port. For Window 10:

    netstat -aon | find "1099"
    
    
    taskkill /F /PID $processId
    
    0 讨论(0)
  • 2021-01-30 08:45

    Just restart the Android studio before try these all. I face same right now and i fix it by this way.

    Happy coding :)

    0 讨论(0)
  • 2021-01-30 08:47

    None of above methods worked in my case i.e. changing port number in run configuration, machine restart, invalidate cache in IntelliJ, killing process shown in netstat (nestat -anob | findstr <port-number> and then tskill <pid>). The only thing that finally helped was starting and shutting down tomcat manually via startup.bat and shutdown.bat (you should use correspondig .sh files on linux and macOS).

    0 讨论(0)
  • 2021-01-30 08:48

    For anyone who comes here with the similar message:

    Unable to open debugger port (127.0.0.1:50470):
        java.net.SocketException "Interrupted function call: accept failed"
    

    This may be caused by something completely independent, i.e. it's not a port configuration. If you're running Tomcat, for instance, it may be that you have an invalid web.xml. Check your Event Log for any previous errors:

    Cannot load C:\...\conf\web.xml: ParseError at [row,col]:[480,29]
                Message: The element type "param-value" must be terminated by the matching end-tag "</param-value>".
    

    IntellIj error log screenshot

    0 讨论(0)
  • 2021-01-30 08:52

    I solved the issue by this way.

    1. I tried to kill all the java.exe processes but it was useless.
    2. Then I tried deleting the Tomcat server
    3. I re-deployed the project and restarted the project and it worked.

    See these links for more information:

    Delete Tomcat Delete Tomcat

    Add a new Tomcat Add a new Tomcat

    0 讨论(0)
提交回复
热议问题