简体   繁体   中英

IntelliJ JBoss plugin - How to start in debug mode

I have a JBoss plugin running in IntelliJ. It runs fine, however when I try start it in DEBUG mode, I get the following error:

Application Server was not connected before run configuration stop, reason: Unable to ping server at localhost:8080

I run my application on:

https://localhost:8443/

So I think I need to change the Detected server https port to 8443 . Or do I need to connect the debug somehow?

Logs:

Detected server admin port: 9999 Detected server http port: 8080

/Users/richardmarais/Development/ClubTravel/jboss-as-7.0.2.Final/bin/standalone.sh
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /Users/richardmarais/Development/ClubTravel/jboss-as-7.0.2.Final

  JAVA: /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/java

  JAVA_OPTS:
-agentlib:jdwp=transport=dt_socket,address=127.0.0.1:50204,suspend=y,server=n
-javaagent:/Users/richardmarais/Library/Caches/JetBrains/IntelliJIdea2020.1/captureAgent/debugger-agent.jar
-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n    
=========================================================================    
Error occurred during initialization of VM agent library failed to init: jdwp /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/java
-Dfile.encoding=UTF-8 -classpath "/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar" com.intellij.rt.execution.CommandLineWrapper /private/var/folders/47/11vw2x9x65z6pyvfrl3d9w1c0000gn/T/idea_classpath1206838148 com.intellij.javaee.oss.process.JavaeeProcess 56071 com.intellij.javaee.oss.jboss.agent.JBoss7Agent Disconnected from server Picked up JAVA_TOOL_OPTIONS: -Dhttps.protocols=TLSv1.2
-Xmx4096m -Xms128m objc[77083]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/java (0x10b0144c0) and /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x10b0fb4e0). One of the two will be used. Which one is undefined. ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options. Picked up JAVA_TOOL_OPTIONS:
-Dhttps.protocols=TLSv1.2 -Xmx4096m -Xms128m [2020-04-15 08:32:44,998] Artifact corporateInterface:war exploded: Waiting for server connection to start artifact deployment... Detected server admin port: 9999 Detected server http port: 8080

在此处输入图像描述

It looks like you append JAVA_OPTS somewhere in the environment or the server startup scripts so that the debugger is initialized twice which fails. Only options supplied by IntelliJ IDEA should be used, this one should not be in the options:

-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n

Notice that in Run/Debug configuration IntelliJ IDEA is supplying this instead:

-agentlib:jdwp=transport=dt_socket,address=127.0.0.1:50204,suspend=y,server=n

Inspect the .sh startup scripts for your JBoss, they are likely customized to add the old debug options which is causing the issue. Also it's a bad idea to use global environment variables like _JAVA_OPTIONS and JAVA_TOOL_OPTIONS , I would unset them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM