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 196957 - [70cat] [guibuilder] GUIbuilder's classpath seems not to include properly external resources
Summary: [70cat] [guibuilder] GUIbuilder's classpath seems not to include properly ext...
Status: RESOLVED INVALID
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.0
Hardware: PC Windows XP
: P4 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-22 12:22 UTC by jmborer
Modified: 2011-03-22 14:57 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jmborer 2011-03-22 12:22:21 UTC
I have a new issue with the GUI builder of NB 7.0rc1: somehow it seems not to be able to locate/load resources. I use Maven projects. 

I have a Project A that has a dependency on project B. In the constructor of my panel, I use a class from project B  that loads a resource (LSZH_sectors.xml). I've checked the jar and the resource is actually contained in project B's Jar. So why is the GUI builder complaining it is not able to find it? Is there an issue with the classpath that the GUI builder uses?

java.lang.IllegalArgumentException: input resource not found : ch/skyguide/inch/position/common/map/LSZH_sectors.xml
	at ch.skyguide.inch.position.common.map.AirspaceFactory.<init>(AirspaceFactory.java:41)
[catch] at ch.skyguide.inch.position.common.wx.AstaCanvas.getUpperSectors(AstaCanvas.java:371)
	at ch.skyguide.inch.position.common.wx.AstaCanvas.drawSectors(AstaCanvas.java:360)
	at ch.skyguide.inch.position.common.wx.AstaCanvas.paintComponent(AstaCanvas.java:294)
	at javax.swing.JComponent.paint(JComponent.java:1029)
	at javax.swing.JComponent.paintChildren(JComponent.java:862)
	at javax.swing.JComponent.paint(JComponent.java:1038)
	at javax.swing.JComponent.paintChildren(JComponent.java:862)
	at javax.swing.JComponent.paint(JComponent.java:1038)
	at javax.swing.JComponent.paintChildren(JComponent.java:862)
	at javax.swing.JComponent.paint(JComponent.java:1038)
	at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21)
	at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
	at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
	at java.awt.Container.paint(Container.java:1780)
	at org.netbeans.modules.form.fakepeer.FakePeerContainer.paint(FakePeerContainer.java:89)
	at javax.swing.JComponent.paintChildren(JComponent.java:876)
	at javax.swing.JComponent.paint(JComponent.java:1038)
	at org.netbeans.modules.form.ComponentLayer$DesignerPanel.paint(ComponentLayer.java:190)
	at javax.swing.JComponent.paintChildren(JComponent.java:862)
	at javax.swing.JComponent.paint(JComponent.java:1038)
	at javax.swing.JComponent.paintChildren(JComponent.java:862)
	at javax.swing.JComponent.paint(JComponent.java:1038)
	at javax.swing.JComponent.paintChildren(JComponent.java:862)
	at org.netbeans.modules.form.FormDesigner$1.paintChildren(FormDesigner.java:240)
	at javax.swing.JComponent.paint(JComponent.java:1038)
	at javax.swing.JLayeredPane.paint(JLayeredPane.java:567)
	at javax.swing.JComponent.paintToOffscreen(JComponent.java:5124)
	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1479)
	at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1410)
	at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:294)
	at javax.swing.RepaintManager.paint(RepaintManager.java:1224)
	at javax.swing.JComponent._paintImmediately(JComponent.java:5072)
	at javax.swing.JComponent.paintImmediately(JComponent.java:4882)
	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:785)
	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:713)
	at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:693)
	at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:125)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:148)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Comment 1 Tomas Pavek 2011-03-22 14:39:27 UTC
Is LSZH_sectors.xml in the same JAR and folder as AirspaceFactory.class?
How does AirspaceFactory look for the resource?
Comment 2 jmborer 2011-03-22 14:57:23 UTC
I found out my problem: former code used ClassLoader.getSystemResourceAsStream(inputFile) to load the resource, which seems not be working anymore. Using the Class classloader resolves the problem but I had to fix all the paths to resources to be relative to that new classloader.