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 176983 - Debugger cannot set breakpoints in library wrapper modules
Summary: Debugger cannot set breakpoints in library wrapper modules
Status: RESOLVED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: PC Windows Vista
: P3 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-17 04:30 UTC by ecerulm
Modified: 2010-05-04 21:35 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
suite containing core-renderer.jar and core-renderer-src.zip (4.99 MB, application/x-zip)
2009-11-17 04:30 UTC, ecerulm
Details
javaapplication project containing the same library and source zip (1.58 MB, application/x-zip)
2009-11-17 04:32 UTC, ecerulm
Details
screenshot (186.48 KB, image/png)
2009-11-19 02:31 UTC, ecerulm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ecerulm 2009-11-17 04:30:30 UTC
Created attachment 91160 [details]
suite containing core-renderer.jar and core-renderer-src.zip

I have a library wrapper module with source attachment. 
C:\Users\ecerulm\Documents\NetBeansProjects\test\suite9\core-renderer\release\modules\ext\core-renderer.jar
C:\Users\ecerulm\Documents\NetBeansProjects\test\suite9\core-renderer\release\modules\ext\core-renderer-src.jar

I have set a breakpoint in org/xhtmlrender/swing/SwingReplacedElementFactory.java in C:\Users\ecerulm\Documents\NetBeansProjects\test\suite9\core-renderer\release\modules\ext\core-renderer-src.jar

When I debug the netbeans application I get the following error in the 

Not able to submit breakpoint LineBreakpoint SwingReplacedElementFactory.java : 60, reason: No source root found for URL 'jar:file:/C:/Users/ecerulm/Documents/NetBeansProjects/test/suite9/core-renderer/release/modules/ext/core-renderer-src.zip!/org/xhtmlrenderer/swing/SwingReplacedElementFactory.java'. Verify the setup of project sources.
Invalid LineBreakpoint SwingReplacedElementFactory.java : 60

The sources are properly attached as I can navigate from src/NewClass.java to SwingReplacedElementFactory.java by Ctrl-clicking the class name. 

The same core-renderer.jar / core-renderer-src.jar seems to work fine (can set breakpoints properly) on a regular Java Application project.

I'm attaching both a netbeans application suite and a regular java project with the jars. 



Related to my Issue #176800 (but it's not a duplicate I think).
Comment 1 ecerulm 2009-11-17 04:32:02 UTC
Created attachment 91161 [details]
javaapplication project containing the same library and source zip
Comment 2 ecerulm 2009-11-17 04:55:53 UTC
Forgot to mention that this only occurs when the source attachment is done by name convention (<jarfilename>-src.zip in the same directory as the jar)

If the sources are attached via a Library (Tools->libraries) with 

C:\Users\ecerulm\Documents\NetBeansProjects\test\suite9\core-renderer\release\modules\ext\core-renderer.jar 
C:\Users\ecerulm\Documents\NetBeansProjects\test\suite9\core-renderer\release\modules\ext\core-renderer-src.jar 


Then the breakpoints work as expected in the suite project.
Comment 3 Martin Entlicher 2009-11-18 08:11:54 UTC
And which project did you debug? Was it JavaApplication1?
If yes, then you have to submit the breakpoint to org/xhtmlrenderer/swing/SwingReplacedElementFactory.java in JavaApplication1/lib/core-renderer-src.zip
and not in org/xhtmlrenderer/swing/SwingReplacedElementFactory.java in suite9/core-renderer/release/modules/ext/core-renderer-src.zip

It depends on where you open the SwingReplacedElementFactory from. If you open it from suite9/core-renderer/src/suite9/flyingsaucer/NewClass.java you get a different file location than when opened from JavaApplication1/src/javaapplication1/Main.java
Comment 4 ecerulm 2009-11-19 02:31:36 UTC
Created attachment 91316 [details]
screenshot
Comment 5 ecerulm 2009-11-19 02:37:00 UTC
I was debugging suite9  (see screenshot) and the source file open is 

SwingReplacedElementFactory.java in C:/Users/ecerulm/Documents/NetBeansProjects/test/suite9/core-renderer/release/modules/ext/core-renderer-src.zip


I just tried again with NB 6.8 200911161401 and I got the same result. 

Make sure that you don't define a library for core-renderer.jar in Tools->Libraries. This only happens if the source attachment is done by name convention jarfile.jar <jarfile>-src.jar.
Comment 6 ecerulm 2009-11-21 12:56:24 UTC
I'm REOPENING this one this additional information 

I traced it down to ClassPath.getClassPath (or at least that what I think)

in 
LineBreakpointImpl.setRequests:155
SourcePath.getRelativePath:121
SourcePathProviderImpl.getRelativePath:678
ClassPath.getClassPath:545

when the source is attached as a library ClassPath.getClassPath(fo, ClassPath.SOURCE)  uses  J2SELibraryClassPathProvider to provide a ClassPath but when there is no library ClassPath.getClassPath return null. I guess that ProjectClassPathProvider should provide a ClassPath when using the -src.zip source attachment.

Otherwise, SourcePath.getRelativePath fallbacks to get a ClassPath.getClassPath(fo, ClassPath.COMPILE) that returns a ClassPath provided by DefaultClassPathProvider which is not able to  getResourceName(fo,...).


It seems that in Issue 66275 http://hg.netbeans.org/main-golden/rev/612151d66b5f they forgot to add special logic to  org/netbeans/modules/apisupport/project/queries/ClassPathProviderImpl to handle this case. But I'm no expert on netbeans internals so I can be wrong. 

They thing is that the breakpoints don't work if the source are provided through a -src.zip file instead of a library.
Comment 7 Martin Entlicher 2010-02-12 11:15:45 UTC
Thanks for your comments, moving to apisupport/projects to evaluate the behavior of org/netbeans/modules/apisupport/project/queries/ClassPathProviderImpl
Comment 8 Jesse Glick 2010-05-04 21:35:39 UTC
core-main #ee9744e6ecf9