This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 220338 - Debugger fix does not work when writing a Jenkins/Hudson plugin
Summary: Debugger fix does not work when writing a Jenkins/Hudson plugin
Status: CLOSED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: Milos Kleint
URL:
Keywords: SIMPLEFIX
Depends on:
Blocks:
 
Reported: 2012-10-18 08:28 UTC by lkishalmi
Modified: 2012-11-14 12:58 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
a trivial working patch for this issue (845 bytes, patch)
2012-10-18 08:42 UTC, lkishalmi
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description lkishalmi 2012-10-18 08:28:07 UTC
If you develop a Jenkins/Hudson plugin in NetBeans IDE the debugger throws a file not found exception when you try to "Apply Code Changes". Something similar like this:

java.io.FileNotFoundException: /foo/bar/jenkins-plugin/target/classes/foo/bar/plugin/JenkinsPlugin
	at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FolderObj.getInputStream(FolderObj.java:619)
	at org.openide.filesystems.FileObject.asBytes(FileObject.java:632)
	at org.netbeans.modules.maven.debug.DebuggerChecker.reload(DebuggerChecker.java:230)
	at org.netbeans.modules.maven.debug.DebuggerChecker.executionResult(DebuggerChecker.java:173)
	at org.netbeans.modules.maven.execute.MavenCommandLineExecutor.run(MavenCommandLineExecutor.java:212)
	at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
Comment 1 lkishalmi 2012-10-18 08:33:32 UTC
The reason is the following: Jenkins/Hudson requires to store the configuration of a plugin in a folder structure which follows the fdqn java class name. The DebuggerChecker just jumps over this folder and try to load the  content as byte array.
The folder in the example above could look like:
.../target/classes/foo/bar/plugin/JenkinsPlugin/config.jelly
.../target/classes/foo/bar/plugin/JenkinsPlugin.class
.../target/classes/foo/bar/plugin/JenkinsPlugin$DescriptorImpl.class
Comment 2 lkishalmi 2012-10-18 08:42:04 UTC
Created attachment 126125 [details]
a trivial working patch for this issue

Trivial patch attached.
Comment 3 Milos Kleint 2012-10-18 11:25:29 UTC
I've gone a slightly different path in my patch: https://hg.netbeans.org/core-main/rev/dcc0db9ae386

please verify with your setup (after it propagates to a daily build), I don't have any jenkins project around to test.
Comment 4 Quality Engineering 2012-10-19 13:39:18 UTC
Integrated into 'main-golden', will be available in build *201210191216* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/dcc0db9ae386
User: Milos Kleint <mkleint@netbeans.org>
Log: #220338, skip any non .class files/folders when reloading
Comment 5 lkishalmi 2012-11-14 12:58:28 UTC
Tested. It works well!
Thank you very much!