Hello Boyka You're currently not attaching a debugger to the agent VM. Currently you have one debugger attached to the master JVM, but none to the agent JVM.
I'm not familiar with Eclipse itself but basically you want to create a Remote configuration that will attach to the agent VM (on port 8765 according to the configuration you sent). Look into the launch configuration in Eclipse, you should find something like Remote or Remote Java Application. One way to quickly check the attaching works is to change suspend=n by suspend=y when launching your agent. This way the JVM will wait for the debugger to attach to proceed and you'll know that you attached properly. Hope this helps. Le mer. 17 juil. 2019 à 08:17, Boyka Zhu <[email protected]> a écrit : > Hi Ullrich, > > In the remote host, I use below command to start the agent. > java -jar > -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8765 > agent.jar -jnlpUrl > http://myjenkinshost:8080/jenkins/computer/hostname123.dev.com/slave-agent.jnlp > -workDir > "/home/boyka/JenkinsDev" > > From my local desktop, I use eclipse to start the debug instance of the > plugin.(eclipse debug configuration use "mvn:hpi"), then it start the Jetty > and auto deploy Jenkins on it, in the same my test TESTPLUGIN will be ready > for debug. > > Any other point views? > > > 在 2019年7月15日星期一 UTC+8下午5:11:19,Ullrich Hafner写道: >> >> How do you connect the remote debugger with the agent? >> >> Am 15.07.2019 um 07:00 schrieb Boyka Zhu <[email protected]>: >> >> Hi Martin, >> >> Thanks. Still, no works for me. What I did below: >> >> 1. Use Eclipse to start the Jenkins debug instance. Keep it running. >> 2. Add the remote slave. >> 3. Use command to start the agent on the remote slave. >> [root@hostname123 boyka]# java -jar >> -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8765 >> agent.jar -jnlpUrl >> http://myjenkinshost:8080/jenkins/computer/hostname123.dev.com/slave-agent.jnlp >> -workDir "/home/boyka/JenkinsDev" >> Listening for transport dt_socket at address: 8765 >> Jul 15, 2019 12:52:21 PM org.jenkinsci.remoting.engine.WorkDirManager >> initializeWorkDir >> INFO: Using /home/czhu/JenkinsDev/remoting as a remoting work directory >> Both error and output logs will be printed to >> /home/boyka/JenkinsDev/remoting >> Jul 15, 2019 12:52:22 PM hudson.remoting.jnlp.Main createEngine >> INFO: Setting up agent: hostname123.dev.com >> Jul 15, 2019 12:52:22 PM hudson.remoting.jnlp.Main$CuiListener <init> >> INFO: Jenkins agent is running in headless mode. >> Jul 15, 2019 12:52:22 PM hudson.remoting.Engine startEngine >> INFO: Using Remoting version: 3.29 >> Jul 15, 2019 12:52:22 PM org.jenkinsci.remoting.engine.WorkDirManager >> initializeWorkDir >> INFO: Using /home/boyka/JenkinsDev/remoting as a remoting work directory >> Jul 15, 2019 12:52:22 PM hudson.remoting.jnlp.Main$CuiListener status >> INFO: Locating server among [http://myjenkinshost:8080/jenkins/] >> Jul 15, 2019 12:52:22 PM >> org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolve >> INFO: Remoting server accepts the following protocols: [JNLP4-connect, >> Ping] >> Jul 15, 2019 12:52:22 PM hudson.remoting.jnlp.Main$CuiListener status >> INFO: Agent discovery successful >> Agent address: myjenkinshost >> Agent port: 61616 >> Identity: f7:43:32:43:aa:d1:40:26:29:f2:5d:42:13:b8:bf:ea >> Jul 15, 2019 12:52:22 PM hudson.remoting.jnlp.Main$CuiListener status >> INFO: Handshaking >> Jul 15, 2019 12:52:22 PM hudson.remoting.jnlp.Main$CuiListener status >> INFO: Connecting to dln-l-cz01:61616 >> Jul 15, 2019 12:52:22 PM hudson.remoting.jnlp.Main$CuiListener status >> INFO: Trying protocol: JNLP4-connect >> Jul 15, 2019 12:52:22 PM hudson.remoting.jnlp.Main$CuiListener status >> INFO: Remote identity confirmed: >> f7:43:32:43:aa:d1:40:26:29:f2:5d:42:13:b8:bf:ea >> Jul 15, 2019 12:52:23 PM hudson.remoting.jnlp.Main$CuiListener status >> INFO: Connected >> >> >> 2. Create one job which configured the *TESTPLUGIN*, and let the job >> running on the remote slave. >> >> 3. The breakpoints got passed directly. >> >> What other steps needed? Appreciate your help deep in this. >> >> >> 在 2019年7月10日星期三 UTC+8上午2:15:32,Martin Weber写道: >>> >>> Am Montag, 8. Juli 2019, 07:27:43 CEST schrieb Boyka Zhu: >>> > Thanks for the updates. >>> > I tried below to launch the jar. >>> > [root@hostname123 tmp]# java -jar >>> > -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8765 >>> > TESTPLUGIN.jar >>> >>> Just run agent.jar, not your plugin jar. You don't need TESTPLUGIN.jar >>> on the >>> agent class-path. >>> >>> In case you are running an ssh-node, you can just specify >>> -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8765 >>> for the JVM option on the jenkins node configuration page. >>> >>> Martin >>> >>> -- >>> There are only two hard problems in Computer Science: cache invalidation, >>> >>> naming things, and off-by-one errors. >>> >>> >>> >>> >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Jenkins Developers" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/jenkinsci-dev/799464cf-c4e3-45b5-8fb8-67f3ff7afa00%40googlegroups.com >> <https://groups.google.com/d/msgid/jenkinsci-dev/799464cf-c4e3-45b5-8fb8-67f3ff7afa00%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> >> >> -- > You received this message because you are subscribed to the Google Groups > "Jenkins Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-dev/a2e306a2-5cb1-4dcd-aed7-abfe63aa279e%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-dev/a2e306a2-5cb1-4dcd-aed7-abfe63aa279e%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAH6Pko%2BiY3Z_S5Mchz4_PuxEjqZAOBiCexTTSJOMN3SR4LyGJw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
