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.
Build: NetBeans IDE Dev (Build 20090115032805) VM: Java HotSpot(TM) Client VM, 11.0-b16, Java(TM) SE Runtime Environment, 1.6.0_11-b03 OS: Linux, 2.6.24-23-generic, i386 User Comments: jiriprox: NPE whne pressing Step Into during debugging Netbeams test Stacktrace: java.lang.NullPointerException at org.netbeans.modules.j2ee.ejbverification.EJBProblemFinder.run(EJBProblemFinder.java:106) at org.netbeans.modules.j2ee.ejbverification.EJBProblemFinder$ProblemFinderCompInfo.run(EJBProblemFinder.java:192) at org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper.run(JavaSourceAccessor.java:288) at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:690) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
Created attachment 75857 [details] stacktrace
Build: NetBeans IDE Dev (Build 200901190201) VM: Java HotSpot(TM) Client VM, 1.5.0_16-133, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_16-b06-284 OS: Mac OS X, 10.5.5, i386 User Comments: NPE while opening file from Favorites view. Stacktrace: java.lang.NullPointerException at org.netbeans.modules.j2ee.ejbverification.EJBProblemFinder.run(EJBProblemFinder.java:106) at org.netbeans.modules.j2ee.ejbverification.EJBProblemFinder$ProblemFinderCompInfo.run(EJBProblemFinder.java:192) at org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper.run(JavaSourceAccessor.java:288) at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:690) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
Created attachment 76041 [details] stacktrace
Build: NetBeans IDE Dev (Build 200901210201) VM: Java HotSpot(TM) Client VM, 11.0-b13, Java(TM) SE Runtime Environment, 1.6.0_10-rc-b26 OS: Linux, 2.6.27-11-generic, i386 User Comments: I pressed Ctrl+Space above the "ExecutorService", suddenly I navigated to source of file ExecutorService and this exception was thrown. Stacktrace: java.lang.NullPointerException at org.netbeans.modules.j2ee.ejbverification.EJBProblemFinder.run(EJBProblemFinder.java:106) at org.netbeans.modules.j2ee.ejbverification.EJBProblemFinder$ProblemFinderCompInfo.run(EJBProblemFinder.java:192) at org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper.run(JavaSourceAccessor.java:288) at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:690) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
Created attachment 76118 [details] stacktrace
This issue has already 20 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=145225
Build: NetBeans IDE Dev (Build 200901250201) VM: Java HotSpot(TM) Client VM, 11.0-b16, Java(TM) SE Runtime Environment, 1.6.0_11-b03 OS: Linux, 2.6.27-11-generic, i386 User Comments: switched to a project group containing maven2 ejb artifacts Stacktrace: java.lang.NullPointerException at org.netbeans.modules.j2ee.ejbverification.EJBProblemFinder.run(EJBProblemFinder.java:106) at org.netbeans.modules.j2ee.ejbverification.EJBProblemFinder$ProblemFinderCompInfo.run(EJBProblemFinder.java:192) at org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper.run(JavaSourceAccessor.java:288) at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:690) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
Created attachment 76259 [details] stacktrace
Build: NetBeans IDE Dev (Build 090123) VM: Java HotSpot(TM) Client VM, 11.0-b16, Java(TM) SE Runtime Environment, 1.6.0_11-b03 OS: Linux, 2.6.24-19-generic, i386 User Comments: Opening j.u.Map from the src.zip. Stacktrace: java.lang.NullPointerException at org.netbeans.modules.j2ee.ejbverification.EJBProblemFinder.run(EJBProblemFinder.java:106) at org.netbeans.modules.j2ee.ejbverification.EJBProblemFinder$ProblemFinderCompInfo.run(EJBProblemFinder.java:192) at org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper.run(JavaSourceAccessor.java:288) at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:690) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
Created attachment 76261 [details] stacktrace
Build: NetBeans IDE Dev (Build 20090126095307) VM: Java HotSpot(TM) Client VM, 11.0-b16, Java(TM) SE Runtime Environment, 1.6.0_11-b03 OS: Linux, 2.6.24-23-generic, i386 User Comments: Stacktrace: java.lang.NullPointerException at org.netbeans.modules.j2ee.ejbverification.EJBProblemFinder.run(EJBProblemFinder.java:106) at org.netbeans.modules.j2ee.ejbverification.EJBProblemFinder$ProblemFinderCompInfo.run(EJBProblemFinder.java:192) at org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper.run(JavaSourceAccessor.java:288) at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:690) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
Created attachment 76303 [details] stacktrace
Build: NetBeans IDE Dev (Build 200901280348) VM: Java HotSpot(TM) Client VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-b33 OS: Linux, 2.6.27-11-generic, i386 User Comments: opening the source for a jar in the editor Stacktrace: java.lang.NullPointerException at org.netbeans.modules.j2ee.ejbverification.EJBProblemFinder.run(EJBProblemFinder.java:106) at org.netbeans.modules.j2ee.ejbverification.EJBProblemFinder$ProblemFinderCompInfo.run(EJBProblemFinder.java:192) at org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper.run(JavaSourceAccessor.java:288) at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:690) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
Created attachment 76320 [details] stacktrace
Build: NetBeans IDE Dev (Build 200901280348) VM: Java HotSpot(TM) Client VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-b33 OS: Linux, 2.6.27-11-generic, i386 User Comments: setting formatting options Stacktrace: java.lang.NullPointerException at org.netbeans.modules.j2ee.ejbverification.EJBProblemFinder.run(EJBProblemFinder.java:106) at org.netbeans.modules.j2ee.ejbverification.EJBProblemFinder$ProblemFinderCompInfo.run(EJBProblemFinder.java:192) at org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper.run(JavaSourceAccessor.java:288) at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:690) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
Created attachment 76321 [details] stacktrace
Build: NetBeans IDE Dev (Build 20090201144329) VM: Java HotSpot(TM) Server VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-b33 OS: Windows Vista, 6.0, x86 User Comments: selecting text by mouse in Base part of Diff view on a mercurial versioned file Stacktrace: java.lang.NullPointerException at org.netbeans.modules.j2ee.ejbverification.EJBProblemFinder.run(EJBProblemFinder.java:106) at org.netbeans.modules.j2ee.ejbverification.EJBProblemFinder$ProblemFinderCompInfo.run(EJBProblemFinder.java:192) at org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper.run(JavaSourceAccessor.java:288) at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:690) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
Created attachment 76432 [details] stacktrace
It looks it happens when there is compile error in java file which is not in any project.
core-main #6dbb6add70c8
Integrated into 'main-golden', will be available in build *200902050256* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/6dbb6add70c8 User: Marek Slama <mslama@netbeans.org> Log: #156889: Add check for null.
I think this is still broken. Testing autoproject on ant-dev using enterprise cluster from fc4e5962809d, I get: java.lang.NullPointerException at org.netbeans.modules.j2ee.ejbverification.EJBProblemFinder.run(EJBProblemFinder.java:111) at org.netbeans.modules.j2ee.ejbverification.EJBProblemFinder$ProblemFinderCompInfo.run(EJBProblemFinder.java:196) [catch] at org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper.run(JavaSourceAccessor.java:288) at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:679) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269) at java.util.concurrent.FutureTask.run(FutureTask.java:123) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) at java.lang.Thread.run(Thread.java:595)
Ok, reopening.
Hopefully fixed now, plus some more logging added: http://hg.netbeans.org/web-main/rev/a82ac40101bc
Integrated into 'main-golden', will be available in build *200903191401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/a82ac40101bc User: pjiricka@netbeans.org Log: Trying to fix issue #156889 plus more diagnostic logging.
*** Issue 161273 has been marked as a duplicate of this issue. ***
It is not fixed, just changed form: java.lang.NullPointerException: null J2eeModule from org.netbeans.modules.autoproject.web.WebModuleProviderImpl@6abc19 at org.netbeans.modules.j2ee.ejbverification.EJBProblemFinder.run(EJBProblemFinder.java:115) (Still being reported in 6.7 RC1 so not sure why exception reporter did not automatically reopen it?) Still thrown when using autoproject, on a non-Java EE-related project. The problem is that autoproject.web.WebModuleProviderImpl must return null from getJ2eeModule, the way it does from findWebModule, when it cannot in fact find any information about Java EE modules. WebModuleProvider.findWebModule is already documented to permit a null return value; J2eeModuleProvider.getJ2eeModule should be changed to explicitly permit a null return as well (there is no reasonable non-null value to return), and callers should be reviewed to make sure they react gracefully. I presume EJBProblemFinder could simply delete the throw of the NPE, so that !isEjb and the task would be skipped. Suggest at least this be put into a 6.7 update: diff --git a/j2ee.ejbverification/src/org/netbeans/modules/j2ee/ejbverification/EJBProblemFinder.java b/j2ee.ejbverification/src/org/netbeans/modules/j2ee/ejbverification/EJBProblemFinder.java --- a/j2ee.ejbverification/src/org/netbeans/modules/j2ee/ejbverification/EJBProblemFinder.java +++ b/j2ee.ejbverification/src/org/netbeans/modules/j2ee/ejbverification/EJBProblemFinder.java @@ -109,12 +109,8 @@ } J2eeModuleProvider provider = (J2eeModuleProvider) prj.getLookup().lookup(J2eeModuleProvider.class); if (provider != null) { - // logging for #156889 J2eeModule module = provider.getJ2eeModule(); - if (module == null) { - NullPointerException npe = new NullPointerException("null J2eeModule from " + provider); - LOG.log(Level.WARNING, npe.getMessage(), npe); - } else { + if (module != null) { if (J2eeModule.Type.EJB.equals(module.getType())) { isEjb = true; }
Simplified as Jesse suggested: 2f360a8cb797.
v.
Integrated into 'main-golden', will be available in build *200907021400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/2f360a8cb797 User: David Konecny <dkonecny@netbeans.org> Log: #156889 - avoid NPE from EJBProblemFinder.run
The fix has been ported into the release67_fixes repository. http://hg.netbeans.org/release67_fixes/rev/043a2641a623
Javadoc of getJ2eeModule should still be updated, and existing callers still need to be reviewed for null handling. David do you plan to do these things, or do I need to reopen or file a blocking issue?
Re. "Javadoc of getJ2eeModule should still be updated" - thanks for reminder Jesse. I looked at the usages of J2eeModuleProvider.getJ2eeModule() and out of 76 occurrences at least half assumes that value cannot be null. Hard to say what original intentions of J2eeModuleProvider.getJ2eeModule were as there is no Javadoc. I wonder whether it actually would be better to say in Javadoc that non-null value has to be returned. And looking at autoproject.web.WebModuleProviderImpl I wonder why I wrote it that way. :-) I don't see any reason why J2eeModule could not be created for null docRoot. If you agree that's what I would do.
It seems to me that the J2eeModule object implies that there is actually a Java EE module, which there may not be. As mentioned before, findWebModule returns null when there is no Java EE web module, so it is getJ2eeModule which is inconsistent. Another option would be to dynamically insert or remove J2eeModuleProvider from project lookup, though I generally do not recommend changing project lookups dynamically in this way.
Re. "WebModule" - or we could fix AutoProject to always return an instance of WebModule. Looking at WM API most of the methods are documented they can return null which would work well in AutoProject case. I think in order to get something working in AP you must have J2eeModule and WebModule for project, but these impls can return null for most of the methods.
OK, you would know best. I have always found it odd that these services do not return List<WebModule> etc. (what if you have a big project with multiple Java EE components in it?), but perhaps there is some reason for this.
Re. "you would know best" - I wish I did. The code is old, not very well documented, during the time it got less strict and more flexible then originally designed (to cater for various edge cases and configuration scenarios) and because there were no changes required in last two years I've just let it sit around and more or less ignored it. Do you want me to fix AutoProjs the way I suggested? That should be quick. I cannot guarantee there will not be new issues though.
If you think you can change autoproject.web to create a no-op J2eeModule then go ahead.
*** Issue 168235 has been marked as a duplicate of this issue. ***
verified in 6.7.1 build NetBeans IDE 6.7.1 RC (Build 200907162301)