Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
744 views
in Technique[技术] by (71.8m points)

java - Remote debugging from Intellij Idea fails with the error: Debugger failed to attach: handshake failed - connection prematurally closed

I am trying to set up Intellij remote debugging with the following conditions:

Host machine: Mac

There, in Intellij Idea I have the following configuration: enter image description here

Now when I try to debug on the host machine, I get this:

Connected to the target VM, address: '172.16.253.130:57205', transport: 'socket'
Disconnected from the target VM, address: '172.16.253.130:57205', transport: 'socket'

Virtual machine (running on VMware): Windows 10 & Java 8

I add an environment variable there:

set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=172.16.253.130:57205

And then I launch the application.

And on the virtual machine I receive:

Listening for transport dt_socket at address: 57205
Debugger failed to attach: handshake failed - connection prematurally closed

I have tried setting up addres=57205 - it didn't help. Disabled firewalls - didn't help. I am quite lost at this point actually. Would really appreciate any kind of help from the community.

UPDATE: Here is server.xml for the VM machine that is running the app:

<Server port="8055" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
  <Service name="Catalina">
    <Connector port="8080" maxThreads="150" minSpareThreads="25" enableLookups="false" redirectPort="8443" acceptCount="100"
               connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="UTF-8"/>
    <Connector port="8081" maxThreads="200" minSpareThreads="25" enableLookups="false" redirectPort="8443" acceptCount="100"
      connectionTimeout="-1" disableUploadTimeout="true" URIEncoding="UTF-8" scheme="https" secure="true"/>
    <Connector port="8009" enableLookups="false" redirectPort="8443" protocol="AJP/1.3" URIEncoding="UTF-8" secure="true"/>
    <Engine name="Catalina" defaultHost="localhost">
      <Host name="localhost" appBase="../app" unpackWARs="true" autoDeploy="true">
        <Valve className="org.apache.catalina.valves.RemoteIpValve" remoteIpHeader="x-forwarded-for" proxiesHeader="x-forwarded-by" />
        <Manager className="org.apache.catalina.session.PersistentManager" saveOnRestart="false">
          <Store className="org.apache.catalina.session.FileStore"/>
        </Manager>
        <Context path="/app" useHttpOnly="false">
          <Environment name="configuration/app" value="file:C:demo-appapp.conf" type="java.lang.String"/>
        </Context>
      </Host>
    </Engine>
  </Service>
</Server>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...