javaintellij-ideapayara

debug two separate java server app with intellij and payara


I want to debug two separate java server app with intellij IDEA and payara. first project run correctly but when I run second one nothing happen.

Error:

Error running 'glassfish': Unable to open debugger port (127.0.0.1:9009): java.net.SocketException "socket closed

Is there any way to do this without using two instance of payara with different port?


Solution

  • The Glassfish Server runs as single JVM process in standalone mode. Thus, only one remote debugger can be attached at the same time.

    That is why the Debugging on one JVM process is only possible from single IDEA's project. It is important to note that IDEA limits debugging scope of the source code to modules are deployed with run/debug configurations.

    Also, if you try simultaneous debugging of the several applications from different projects, you should run them on different Glassfish instances with different ports as well.