jenkins debugging with eclipse (Windows)

897 views
Skip to first unread message

Zhengyuan Shen

unread,
May 31, 2013, 2:09:28 PM5/31/13
to jenkin...@googlegroups.com

I have built a new "Hello World" plugin for Jenkins and I was able to upload it onto Jenkins and it works successfully. I am now trying to make change to the plugin and debug it on Jenkins. I did this according to the instructions on this tutorial https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial

I tried this command:

mvnDebug hpi:run

and then start to debug from eclipse to the port 8000 which is the port that Jenkins opens up for debugging. The eclipse was able to connect to the correct port and I got the message which seems to be correct:

[info] Jenkins is fully up and running

It seems that everything went OK. Then I go to localhost:8080 to see the plugin but I found nothing there. Can anybody help me with this, please? Thanks.

Jesse Glick

unread,
May 31, 2013, 3:00:19 PM5/31/13
to jenkin...@googlegroups.com
On 05/31/2013 02:09 PM, Zhengyuan Shen wrote:
> Then I go to localhost:8080 to see the plugin but I found nothing there.

Try using the latest version of maven-hpi-plugin.

Zhengyuan Shen

unread,
May 31, 2013, 3:45:24 PM5/31/13
to jenkin...@googlegroups.com
Can you be a little bit more specific please? I am just wondering if the mvnDebug phi:run command will upload the new plugin onto jenkins server or not. I can see from the terminal that the plugin is found and implemented while I still can not see the plugin in the browser at localhost:8080.

Thanks

Kevin Fleming (BLOOMBERG/ 731 LEXIN)

unread,
May 31, 2013, 3:57:48 PM5/31/13
to jenkin...@googlegroups.com
No, it does not upload the plugin anywhere. It launches a local Jenkins instance and loads the plugin into that instance; during the launch process it outputs the port number it is listening on, for you to connect with your browser.
--
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 jenkinsci-de...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Zhengyuan Shen

unread,
May 31, 2013, 4:07:05 PM5/31/13
to jenkin...@googlegroups.com, Kevin Fleming
Thanks!

I see the port number is 52614 and then I connect the browser to localhost:52614, is that correct thing to do?

After I tried to connect using the browser, I get warning says that connection #1 and #2 are both failed. for java.io.EOFException. Do you know why does this happen? Thanks.

Kevin Fleming (BLOOMBERG/ 731 LEXIN)

unread,
May 31, 2013, 4:14:26 PM5/31/13
to jenkin...@googlegroups.com
There are multiple port numbers emitted during the Jenkins startup (HTTP, JNLP, maybe others). You need to be sure you are connecting to the HTTP port.

Zhengyuan Shen

unread,
May 31, 2013, 4:25:07 PM5/31/13
to jenkin...@googlegroups.com, Kevin Fleming
I can see a started SSHD at port 53119 and JNLP slave agent listener started on TCP port 53120. So they are not the HTTP port that I need? I see no other ports during the startup except the 8080 and 8000. What do you think? Thanks.

Zhengyuan Shen

unread,
Jun 3, 2013, 11:50:36 AM6/3/13
to jenkin...@googlegroups.com, Kevin Fleming
Can anybody help me on this please? I still can not see the jenkins instance for debugging through a browser.

Regards,

Jesse Glick

unread,
Jun 3, 2013, 11:52:54 AM6/3/13
to jenkin...@googlegroups.com
On 05/31/2013 04:25 PM, Zhengyuan Shen wrote:
> I can see a started SSHD at port 53119 and JNLP slave agent listener started on TCP port 53120. So they are not the HTTP port that I need? I see no other ports during the
> startup except the 8080 and 8000.

Go to: http://localhost:8080/

Zhengyuan Shen

unread,
Jun 3, 2013, 11:59:03 AM6/3/13
to jenkin...@googlegroups.com
Thanks, when I got to http://localhost:8080/ I can see the Jenkins instance but I can not find my plugin that I need to debug, how can I debug my hello world plugin? Thanks.

Regards,

Jesse Glick

unread,
Jun 3, 2013, 12:43:09 PM6/3/13
to jenkin...@googlegroups.com
On 06/03/2013 11:59 AM, Zhengyuan Shen wrote:
> when I go to http://localhost:8080/ I can see the Jenkins instance but I can not find my plugin that I need to debug

Then check the console to see if the plugin failed to start for some reason. One possible reason is that the version of the maven-hpi-plugin specified in your parent POM
is too old (buggy). You need at least 1.95.

Zhengyuan Shen

unread,
Jun 3, 2013, 12:51:00 PM6/3/13
to jenkin...@googlegroups.com
Hi,

I have checked the POM.xml file and it says the version is 1.95 and I have also checked the console it says all plugins are listed and prepared and started and the Jenkins is fully up and running then I go to localhost:8080, and I click on the manage plugins and I can't find my plugin there so it is not uploaded at all. My plugin is just a hello world plugin it change "Hello" to French. It works when I simply import the hpi file manually from the Jenkins UI and I just found no way to debug it. What do you think?

Thanks,

Jesse Glick

unread,
Jun 3, 2013, 1:25:12 PM6/3/13
to jenkin...@googlegroups.com
On 06/03/2013 12:51 PM, Zhengyuan Shen wrote:
> I click on the manage plugins and I can't find my plugin there

Under /pluginManager/installed?

Maybe the problem is Eclipse. Try just ‘mvn hpi:run’ from a shell.

Or from NetBeans, if you install the Jenkins development support plugin, you can use File » New Project to create a new plugin, and Debug » Debug Project to debug it
(using hpi:run with the right debugger parameters predefined).

Zhengyuan Shen

unread,
Jun 5, 2013, 12:10:45 PM6/5/13
to jenkin...@googlegroups.com
Hi,

Here is the full log during the debugging is launching.

Listening for transport dt_socket at address: 8000
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building DeployingVC 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> maven-hpi-plugin:1.95:run (default-cli) @ DeployingVC >>>
[INFO] 
[INFO] --- maven-hpi-plugin:1.95:validate (default-validate) @ DeployingVC ---
[INFO] 
[INFO] --- maven-enforcer-plugin:1.0.1:enforce (enforce-maven) @ DeployingVC ---
[INFO] 
[INFO] --- maven-enforcer-plugin:1.0.1:display-info (display-info) @ DeployingVC ---
[INFO] Maven Version: 3.0.5
[INFO] JDK Version: 1.7.0_21 normalized as: 1.7.0-21
[INFO] OS Info: Arch: amd64 Family: windows Name: windows 7 Version: 6.1
[INFO] 
[INFO] --- maven-localizer-plugin:1.14:generate (default) @ DeployingVC ---
[INFO] 
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ DeployingVC ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 5 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.5:compile (default-compile) @ DeployingVC ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] <<< maven-hpi-plugin:1.95:run (default-cli) @ DeployingVC <<<
[INFO] 
[INFO] --- maven-hpi-plugin:1.95:run (default-cli) @ DeployingVC ---
[INFO] Generating .\work\plugins\DeployingVC.hpl
[INFO] Copying dependency Jenkins plugin C:\Users\alex\.m2\repository\org\jenkins-ci\plugins\javadoc\1.0\javadoc-1.0.jar
[INFO] Copying dependency Jenkins plugin C:\Users\alex\.m2\repository\org\jenkins-ci\plugins\subversion\1.26\subversion-1.26.jar
[INFO] Copying dependency Jenkins plugin C:\Users\alex\.m2\repository\org\jenkins-ci\plugins\mailer\1.4\mailer-1.4.jar
[INFO] Copying dependency Jenkins plugin C:\Users\alex\.m2\repository\org\jenkins-ci\main\maven-plugin\1.509.1\maven-plugin-1.509.1.jar
[INFO] Copying dependency Jenkins plugin C:\Users\alex\.m2\repository\org\jenkins-ci\main\ui-samples-plugin\1.509.1\ui-samples-plugin-1.509.1.jar
[INFO] Copying dependency Jenkins plugin C:\Users\alex\.m2\repository\org\jenkins-ci\plugins\ant\1.1\ant-1.1.jar
[INFO] Configuring Jetty for project: DeployingVC
2013-06-04 18:23:54.862::INFO:  Logging to STDERR via org.mortbay.log.StdErrLog
[INFO] Context path = /jenkins
[INFO] Tmp directory = C:\Users\alex\workspace\DeployingVC\target\work
[INFO] Web defaults =  jetty default
[INFO] Starting jetty 6.1.1 ...
2013-06-04 18:23:55.051::INFO:  jetty-6.1.1
Jenkins home directory: C:\Users\alex\workspace\DeployingVC\.\work found at: System.getProperty("HUDSON_HOME")
2013-06-04 18:23:56.409::INFO:  Started SelectChannelConnector @ 0.0.0.0:8080
[INFO] Started Jetty Server
[INFO] Console reloading is ENABLED. Hit ENTER on the console to restart the context.
Jun 04, 2013 6:23:56 PM jenkins.InitReactorRunner$1 onAttained
INFO: Started initialization
Jun 04, 2013 6:23:58 PM jenkins.InitReactorRunner$1 onAttained
INFO: Listed all plugins
Jun 04, 2013 6:23:58 PM jenkins.InitReactorRunner$1 onAttained
INFO: Prepared all plugins
Jun 04, 2013 6:23:58 PM jenkins.InitReactorRunner$1 onAttained
INFO: Started all plugins
Jun 04, 2013 6:23:58 PM jenkins.InitReactorRunner$1 onAttained
INFO: Augmented all extensions
Jun 04, 2013 6:23:58 PM jenkins.InitReactorRunner$1 onAttained
INFO: Loaded all jobs
Jun 04, 2013 6:24:02 PM org.jenkinsci.main.modules.sshd.SSHD start
INFO: Started SSHD at port 64844
Jun 04, 2013 6:24:02 PM jenkins.InitReactorRunner$1 onAttained
INFO: Completed initialization
Jun 04, 2013 6:24:02 PM hudson.TcpSlaveAgentListener <init>
INFO: JNLP slave agent listener started on TCP port 64845
Jun 04, 2013 6:24:02 PM hudson.WebAppMain$2 run
INFO: Jenkins is fully up and running
Jun 05, 2013 9:06:16 AM hudson.node_monitors.AbstractNodeMonitorDescriptor$Record <init>
WARNING: Previous Response Time monitoring activity still in progress. Interrupting
Jun 05, 2013 9:06:16 AM hudson.node_monitors.AbstractNodeMonitorDescriptor$Record <init>
WARNING: Previous Free Swap Space monitoring activity still in progress. Interrupting
Jun 05, 2013 9:06:16 AM hudson.node_monitors.AbstractNodeMonitorDescriptor$Record run
WARNING: Node monitoring master for Response Time aborted.
java.lang.InterruptedException
at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1325)
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:257)
at java.util.concurrent.FutureTask.get(FutureTask.java:119)
at hudson.remoting.LocalChannel$2.get(LocalChannel.java:81)
at hudson.node_monitors.ResponseTimeMonitor$1.monitor(ResponseTimeMonitor.java:60)
at hudson.node_monitors.ResponseTimeMonitor$1.monitor(ResponseTimeMonitor.java:52)
at hudson.node_monitors.AbstractNodeMonitorDescriptor$Record.run(AbstractNodeMonitorDescriptor.java:219)

Jun 05, 2013 9:06:16 AM hudson.node_monitors.AbstractNodeMonitorDescriptor$Record <init>
WARNING: Previous Free Temp Space monitoring activity still in progress. Interrupting
Jun 05, 2013 9:06:16 AM hudson.model.AsyncPeriodicWork$1 run
INFO: Started Fingerprint cleanup
Jun 05, 2013 9:06:16 AM hudson.model.FingerprintCleanupThread execute
INFO: Cleaned up 0 records
Jun 05, 2013 9:06:16 AM hudson.model.AsyncPeriodicWork$1 run
INFO: Finished Fingerprint cleanup. 1 ms
Jun 05, 2013 9:06:16 AM hudson.node_monitors.AbstractNodeMonitorDescriptor$Record <init>
WARNING: Previous Free Temp Space monitoring activity still in progress. Interrupting
Jun 05, 2013 9:06:16 AM hudson.node_monitors.AbstractNodeMonitorDescriptor$Record <init>
WARNING: Previous Free Swap Space monitoring activity still in progress. Interrupting
Jun 05, 2013 9:06:16 AM hudson.model.AsyncPeriodicWork$1 run
INFO: Started Workspace clean-up
Jun 05, 2013 9:06:16 AM hudson.model.AsyncPeriodicWork$1 run
INFO: Finished Workspace clean-up. 2 ms


When I go to http://localhost:8080 and under plugins/installed, the plugin is not found there. Any help?

I use mvn hpi:run to do this and the MAVEN_OPTS is set to be -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y.

Thanks.

Vincent Latombe

unread,
Jun 5, 2013, 12:43:47 PM6/5/13
to Jenkins Dev
Hi,

try with mvn clean hpi:run, see if it works better.
This is a common problem when working with Eclipse; the eclipse compiler doesn't generate the metadata required by Jenkins framework to load your plugin, and since the .class files already exist, javac is not called, so the metadata cannot be generated.

Cheers,

Vincent


2013/6/5 Zhengyuan Shen <esdo...@gmail.com>

--

Zhengyuan Shen

unread,
Jun 5, 2013, 12:48:26 PM6/5/13
to jenkin...@googlegroups.com
Hi,

I have tried mvn clean hpi:run and I got the following errors.


Listening for transport dt_socket at address: 8000
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building DeployingVC 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ DeployingVC ---
[INFO] Deleting C:\Users\alex\workspace\DeployingVC\target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.894s
[INFO] Finished at: Wed Jun 05 09:46:38 PDT 2013
[INFO] Final Memory: 8M/112M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean) on project DeployingVC: Failed to clean project: Failed to delete C:\Users\alex\workspace\DeployingVC\target\work\webapp\WEB-INF\lib\xstream-1.4.4-jenkins-3.jar -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:



What do you think?

Thanks

Zhengyuan Shen

unread,
Jun 5, 2013, 12:54:36 PM6/5/13
to jenkin...@googlegroups.com
It is because the jar file maven is going to delete is used by eclipse. I run the mvn clean hpi:run from the terminal and it works. However, the plugin is still not shown up in the plugin/installed. What do you think?

Thanks

On Wednesday, June 5, 2013 9:43:47 AM UTC-7, Vincent Latombe wrote:

Zhengyuan Shen

unread,
Jun 5, 2013, 2:03:49 PM6/5/13
to jenkin...@googlegroups.com
Hi everyone,

Thanks for all the help. The reason why I can't get the plugin shown in the Jenkins UI is because I went to the wrong URL.

The I just changed the URL to http://localhost/8080/jenkins, then everything works fine and I can see my plugin in there.

Thanks.
Reply all
Reply to author
Forward
0 new messages