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.
I got this NPE while I was opening external module and NB sources were defined via symlink. The line "^Project is: " is output from command: System.out.println("Project is: " + project.toString()); entered to line 266 in org.netbeans.modules.apisupport.project. ClassPathProviderImpl The problems are causing lines: static File findNetBeansOrg(File basedir) { File f = basedir; for (int i = 0; i < DEPTH_NB_ALL; i++) { f = f.getParentFile(); if (isNetBeansOrg(f)) { return f; } } // Not here. return null; } from org.netbeans.modules.apisupport.project.ModuleList, because it maches the same locations refered by different Strings - probably use of getCanonicalPath somewhere did the job :-(. BTW: It was working for me for one project but for the other one it failed... From command line all is OK and working. Debug output: Project is: NbModuleProject[MasterFileObject@1bcfced[file:/builds/cvs/s1sme/ projecttest/f4j_me/kjava/j2meplatform/]] *********** Exception occurred ************ at 6:49 PM on May 31, 2005 java.lang.NullPointerException at org.openide.filesystems.FileUtil.normalizeFileOnUnixAlike(FileUtil. java:1108) at org.openide.filesystems.FileUtil.normalizeFile(FileUtil.java:1100) at org.netbeans.modules.apisupport.project.Util.urlForJar(Util.java:179) at org.netbeans.modules.apisupport.project.ClassPathProviderImpl. createFuncTestCompileClasspath(ClassPathProviderImpl.java:267) at org.netbeans.modules.apisupport.project.ClassPathProviderImpl. findClassPath(ClassPathProviderImpl.java:136) at org.netbeans.modules.apisupport.project.ClassPathProviderImpl. getProjectClassPaths(ClassPathProviderImpl.java:357) at org.netbeans.modules.apisupport.project.NbModuleProject$OpenedHook. projectOpened(NbModuleProject.java:782) at org.netbeans.spi.project.ui.ProjectOpenedHook$1. projectOpened(ProjectOpenedHook.java:50) [catch] at org.netbeans.modules.project.ui.OpenProjectList. notifyOpened(OpenProjectList.java:413) at org.netbeans.modules.project.ui.OpenProjectList.open(OpenProjectList. java:171) at org.netbeans.modules.project.ui.actions.OpenProject. actionPerformed(OpenProject.java:86) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java: 1849) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton. java:2169) at javax.swing.DefaultButtonModel. fireActionPerformed(DefaultButtonModel.java:420) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java: 258) at javax.swing.plaf.basic.BasicButtonListener. mouseReleased(BasicButtonListener.java:234) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java: 231) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java: 231) at java.awt.Component.processMouseEvent(Component.java:5488) at javax.swing.JComponent.processMouseEvent(JComponent.java:3093) at java.awt.Component.processEvent(Component.java:5253) at java.awt.Container.processEvent(Container.java:1966) at java.awt.Component.dispatchEventImpl(Component.java:3955) at java.awt.Container.dispatchEventImpl(Container.java:2024) at java.awt.Component.dispatchEvent(Component.java:3803) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java: 4212) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822) at java.awt.Container.dispatchEventImpl(Container.java:2010) at java.awt.Window.dispatchEventImpl(Window.java:1774) at java.awt.Component.dispatchEvent(Component.java:3803) at java.awt.EventQueue.dispatchEvent(EventQueue.java:463) at java.awt.EventDispatchThread. pumpOneEventForHierarchy(EventDispatchThread.java:242) at java.awt.EventDispatchThread. pumpEventsForHierarchy(EventDispatchThread.java:163) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149) at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
I have no idea what you're talking about re. symlinks, getCanonicalPath, etc. - if you can reproduce let me know. Anyway I already knew there is a bug in CPPI which I have a fix for on disk (did not get to commit it yet).
I should clarify: CPPI bug causes an NPE in case your external module has no working source association that would let nb_all be found.
Probably only affected modules with functional tests and no working nb_all source association. Please verify. committed Up-To-Date 1.48 apisupport/project/src/org/netbeans/modules/apisupport/project/ClassPathProviderImpl.java
IMHO this fix is only workaround to not put the test jars to classpath, but when external module has functional tests then it can't run them from IDE. However the cause of this exception wasn't that there are not associated sources, it was that the sources where associated via symlink, thus the netbeans.dest.dir is not being recognized, because on one place it is with resolved symlink and on other without it (/builds/cvs/nbtrunk/nbbuild/netbeans ! = /builds/cvs/s1sme/testproject/nb_all/nbbuild/netbeans and the /builds/cvs/ s1sme/testproject/nb_all is a symlink to /builds/cvs/nbtrunk). Please fix the cause not the exception printing! BTW lowering prioty because it at least doesn't prevent IDE to open the project
I just tried opening the suite Michal sent me in yesterday's dev build (w/ the fix to CPPI, but shouldn't matter) and it worked fine, incl. source associations on files. I did have to correct build/nbproject: it included suite.properties (which makes no sense - suite projects do not have such a file, it is ignored), and had modules=${basedir}/../kjava/j2meplatform:${basedir}/../kjava/ant-ext:${basedir}/../kjava/j2meproject which is certainly incorrect (basedir depends on the project loading the file). I just fixed build/nbproject/project.properties to read modules=${suite.dir}/../kjava/j2meplatform:${suite.dir}/../kjava/ant-ext:${suite.dir}/../kjava/j2meproject suite.dir=${basedir} and it opens fine. The functional tests seem to have a mostly empty classpath, which I can look at.
BTW I did find a problem in qa-functional classpath, but it pertains to usage of an anonymous platform generally, not to use of symlinks. Leaving this bug as it was - an NPE, which was already fixed.