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 just downloaded Netbeans 4.1 today and the first Java file I clicked on caused NetBeans to throw the Exception below. Other java files work fine. The 'problem' java file compiles fine and has been used in production for years. Annotation: Exception occurred in Request Processor java.lang.NullPointerException at org.netbeans.modules.javacore.parser.ClassFileInfoUtil.getJavadocFile(ClassFileInfoUtil.java:705) at org.netbeans.modules.javacore.parser.ClassFileInfoUtil.getHtmlReader(ClassFileInfoUtil.java:633) at org.netbeans.modules.javacore.parser.ClassFileInfoUtil.createParamsInfo(ClassFileInfoUtil.java:582) at org.netbeans.modules.javacore.parser.ClassFileInfoUtil.createMethodInfo(ClassFileInfoUtil.java:213) at org.netbeans.modules.javacore.parser.ClassFileInfoUtil.createClassInfo(ClassFileInfoUtil.java:153) at org.netbeans.modules.javacore.parser.ClassFileInfoUtil.createClassInfo(ClassFileInfoUtil.java:66) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.getResInfoFromClassFile(ResourceImpl.java:413) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.directClassFileUpdate(ResourceImpl.java:670) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.checkUpToDate(ResourceImpl.java:644) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.checkUpToDate(ResourceImpl.java:582) at org.netbeans.modules.javacore.jmiimpl.javamodel.SemiPersistentElement.checkUpToDate(SemiPersistentElement.java:263) at org.netbeans.modules.javacore.jmiimpl.javamodel.SemiPersistentElement.checkUpToDate(SemiPersistentElement.java:267) at org.netbeans.modules.javacore.jmiimpl.javamodel.JavaClassImpl.getSuperClass(JavaClassImpl.java:321) at org.netbeans.jmi.javamodel.JavaClass$Impl.getSuperClass(Unknown Source) at org.netbeans.modules.javacore.parser.MDRParser.getSuperClass(MDRParser.java:1453) at org.netbeans.modules.javacore.parser.Scope.constructMemberTypeScope(Scope.java:130) at org.netbeans.modules.javacore.parser.Scope.createMemberTypeScope(Scope.java:118) at org.netbeans.modules.javacore.parser.Scope.constructMemberTypeScope(Scope.java:140) at org.netbeans.modules.javacore.parser.Scope.createMemberTypeScope(Scope.java:118) at org.netbeans.modules.javacore.parser.MDRParser.processAST(MDRParser.java:474) at org.netbeans.modules.javacore.parser.MDRParser.processAST(MDRParser.java:364) at org.netbeans.modules.javacore.parser.MDRParser.processAST(MDRParser.java:326) at org.netbeans.modules.javacore.parser.MDRParser.processAST(MDRParser.java:304) at org.netbeans.modules.javacore.parser.MDRParser.enterMembers(MDRParser.java:234) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.directUpdate(ResourceImpl.java:732) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.checkUpToDate(ResourceImpl.java:640) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.checkUpToDate(ResourceImpl.java:582) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.initResource(ResourceImpl.java:422) at org.netbeans.modules.javacore.jmiimpl.javamodel.MetadataElement.initCheck(MetadataElement.java:133) at org.netbeans.modules.javacore.jmiimpl.javamodel.SemiPersistentElement.getElementInfo(SemiPersistentElement.java:185) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.initChildren(ResourceImpl.java:323) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.initChildren(ResourceImpl.java:317) at org.netbeans.modules.javacore.jmiimpl.javamodel.MetadataElement.initCheck(MetadataElement.java:139) at org.netbeans.modules.javacore.jmiimpl.javamodel.SemiPersistentElement.checkUpToDate(SemiPersistentElement.java:269) at org.netbeans.modules.javacore.jmiimpl.javamodel.JavaClassImpl.getContents(JavaClassImpl.java:407) at org.netbeans.jmi.javamodel.JavaClass$Impl.getContents(Unknown Source) at org.netbeans.modules.javacore.jmiimpl.javamodel.FeaturesList.toArray(FeaturesList.java:101) at java.util.LinkedList.addAll(LinkedList.java:265) at java.util.LinkedList.addAll(LinkedList.java:242) at java.util.LinkedList.<init>(LinkedList.java:98) at org.netbeans.modules.javanavigation.JUtils.addInnerClassMembers(JUtils.java:1382) at org.netbeans.modules.javanavigation.JUtils.getClassMembers(JUtils.java:1339) at org.netbeans.modules.javanavigation.ClassMemberModel.loadContents(ClassMemberModel.java:247) at org.netbeans.modules.navigator.spi.ListModelSupport$Loader.run(ListModelSupport.java:945) at org.openide.util.Task.run(Task.java:189) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:330) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:721)
Btw, this is running NetBeans-4.1 with the new mustang b36.
Also note: the error also happens with java 1.5.0_02 (i586, Linux). I just re-installed netbeans-4.1 from scratch with the new jdk to confirm. here is the 1.5.2_02/nb 4.1 stack trace: (btw, there is a bug in the error dialog. It ends with: "The messages.log file is located in your". In my where? The dialog doesn't say) java.lang.NullPointerException at org.netbeans.modules.javacore.parser.ClassFileInfoUtil.getJavadocFile(ClassFileInfoUtil.java:705) at org.netbeans.modules.javacore.parser.ClassFileInfoUtil.getHtmlReader(ClassFileInfoUtil.java:633) at org.netbeans.modules.javacore.parser.ClassFileInfoUtil.createParamsInfo(ClassFileInfoUtil.java:582) at org.netbeans.modules.javacore.parser.ClassFileInfoUtil.createMethodInfo(ClassFileInfoUtil.java:213) at org.netbeans.modules.javacore.parser.ClassFileInfoUtil.createClassInfo(ClassFileInfoUtil.java:153) at org.netbeans.modules.javacore.parser.ClassFileInfoUtil.createClassInfo(ClassFileInfoUtil.java:66) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.getResInfoFromClassFile(ResourceImpl.java:413) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.directClassFileUpdate(ResourceImpl.java:670) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.checkUpToDate(ResourceImpl.java:644) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.checkUpToDate(ResourceImpl.java:582) at org.netbeans.modules.javacore.jmiimpl.javamodel.SemiPersistentElement.checkUpToDate(SemiPersistentElement.java:263) at org.netbeans.modules.javacore.jmiimpl.javamodel.SemiPersistentElement.checkUpToDate(SemiPersistentElement.java:267) at org.netbeans.modules.javacore.jmiimpl.javamodel.JavaClassImpl.getSuperClass(JavaClassImpl.java:321) at org.netbeans.jmi.javamodel.JavaClass$Impl.getSuperClass(Unknown Source) at org.netbeans.modules.javacore.parser.MDRParser.getSuperClass(MDRParser.java:1453) at org.netbeans.modules.javacore.parser.Scope.constructMemberTypeScope(Scope.java:130) at org.netbeans.modules.javacore.parser.Scope.createMemberTypeScope(Scope.java:118) at org.netbeans.modules.javacore.parser.Scope.constructMemberTypeScope(Scope.java:140) at org.netbeans.modules.javacore.parser.Scope.createMemberTypeScope(Scope.java:118) at org.netbeans.modules.javacore.parser.MDRParser.processAST(MDRParser.java:474) at org.netbeans.modules.javacore.parser.MDRParser.processAST(MDRParser.java:364) at org.netbeans.modules.javacore.parser.MDRParser.processAST(MDRParser.java:326) at org.netbeans.modules.javacore.parser.MDRParser.processAST(MDRParser.java:304) at org.netbeans.modules.javacore.parser.MDRParser.enterMembers(MDRParser.java:234) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.directUpdate(ResourceImpl.java:732) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.checkUpToDate(ResourceImpl.java:640) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.checkUpToDate(ResourceImpl.java:582) at org.netbeans.modules.javacore.jmiimpl.javamodel.SemiPersistentElement.checkUpToDate(SemiPersistentElement.java:263) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.getImports(ResourceImpl.java:270) at org.netbeans.jmi.javamodel.Resource$Impl.getImports(Unknown Source) at org.netbeans.modules.editor.java.NbJavaFoldManager.collectFoldUpdates(NbJavaFoldManager.java:306) at org.netbeans.modules.editor.java.NbJavaFoldManager.updateFolds(NbJavaFoldManager.java:210) at org.netbeans.modules.editor.java.NbJavaFoldManager.run(NbJavaFoldManager.java:193) at org.openide.util.Task.run(Task.java:189) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:330) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:721)
Hello, is your project a freeform project? If yes, could you please attach your nbproject/project.xml to this bug? Also the fully-qualified name (package+name) of the problematic class and its location in the project (path from the project folder) would be helpfull. Thank you.
Created attachment 22188 [details] project.xml - requested by jlahoda
As requested: freeform: yes 1. class: com.wss.calendar.client.jws.JWSHelper.java 2. location: src/com/wss/calendar/client/jws Cheers
Hello, thanks for the info. I was able to reproduce the problem, I am attaching a testing J2SE project. Unpack it, open javaapplication5.Main in the editor, and switch the "show inherited members" in the navigator - the exception is thrown. It seems to be caused by a classfile under the source roots. If the EXECUTE classpath is taken for this classfile, it does not contain the classfile (which is OK in my opinion), and so the NullPointerException is thrown. (Note: more conditions need to be fullfilled: the classfile has to be without the variable debug info, the Main class has to extend the class defined in the classfile.)
Created attachment 22190 [details] Example project.
Possible workarounds (hopefully some of them will help): 1. do not have ".class" files in the source directories. 2. make the ".class" files in the source directories contain full debug info (in particular variable debug info). 3. other?
*** Issue 59075 has been marked as a duplicate of this issue. ***
Note: The JWSHelper.class has _all_ debug info - so the workaround to enable debug info wouldn't help.
Pavel, please look at it.
Mark is right. Debug information is not enough. The code throwing NPE is used, when reading classfile parameters and there is missing parameter's name. When you have class file compiled with -g, names are present, but name doesn't present for parameters in abstract classes and interfaces, so if you have such classes, workaround 2) does not help. I have prepared simple fix.
Checking in src/org/netbeans/modules/javacore/parser/ClassFileInfoUtil.java; /cvs/java/javacore/src/org/netbeans/modules/javacore/parser/ClassFileInfoUtil.java,v <-- ClassFileInfoUtil.java new revision: 1.26; previous revision: 1.25 done
*** Issue 59643 has been marked as a duplicate of this issue. ***
*** Issue 60444 has been marked as a duplicate of this issue. ***
Verified in 4.2 (200507110943)
*** Issue 60952 has been marked as a duplicate of this issue. ***
Reorganization of java component