intellij idea的远程调试失败,错误为:调试器未能附加:握手失败-连接过早关闭

jfewjypa  于 2021-06-27  发布在  Java
关注(0)|答案(0)|浏览(550)

我正在尝试使用以下条件设置intellij远程调试:
主机:mac
在intellij idea中,我有以下配置:

现在,当我尝试在主机上调试时,我得到以下结果:

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'

虚拟机(在vmware上运行):windows 10和java 8
我在那里添加了一个环境变量:

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

然后我启动应用程序。
在我收到的虚拟机上:

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

我试过设置 addres=57205 -没用的。禁用防火墙-没有帮助。实际上,我在这一点上完全迷路了。非常感谢社区的任何帮助。
更新:以下是运行应用程序的vm计算机的server.xml:

<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-app\app.conf" type="java.lang.String"/>
        </Context>
      </Host>
    </Engine>
  </Service>
</Server>

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题