Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 168543 - NullPointerException at org.netbeans.modules.maven.MavenProjectPropsImpl.get
NullPointerException at org.netbeans.modules.maven.MavenProjectPropsImpl.get
Status: VERIFIED FIXED
Product: projects
Classification: Unclassified
Component: Maven
6.x
All All
: P2 (vote)
: 6.x
Assigned To: Milos Kleint
issues@platform
http://statistics.netbeans.org/except...
EXCEPTIONS_REPORT 67patch1-verified
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-14 13:32 UTC by kawazu428
Modified: 2009-07-20 13:46 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
stacktrace (1.73 KB, text/plain)
2009-07-14 13:32 UTC, kawazu428
Details
stacktrace (1.73 KB, text/plain)
2009-07-14 13:42 UTC, kawazu428
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kawazu428 2009-07-14 13:32:27 UTC
Build: NetBeans IDE Dev (Build 200907140201)
VM: Java HotSpot(TM) Server VM, 14.0-b16, Java(TM) SE Runtime Environment, 1.6.0_14-b08
OS: Linux, 2.6.28-13-generic, i386

User Comments:
GUEST: when trying to open maven just checked out



Stacktrace: 
java.lang.NullPointerException<br/>
        at org.netbeans.modules.maven.MavenProjectPropsImpl.get(MavenProjectPropsImpl.java:105)<br/>
        at org.netbeans.modules.maven.MavenProjectPropsImpl.get(MavenProjectPropsImpl.java:85)<br/>
        at org.netbeans.modules.maven.api.NbMavenProject.getPackagingType(NbMavenProject.java:290)<br/>
        at org.netbeans.modules.maven.apisupport.MavenApisupportLookupProvider$Provider.checkNbm(MavenApisupportLookupProvider.java:93)<br/>
        at org.netbeans.modules.maven.apisupport.MavenApisupportLookupProvider$Provider.<init>(MavenApisupportLookupProvider.java:81)<br/>
        at org.netbeans.modules.maven.apisupport.MavenApisupportLookupProvider.createAdditionalLookup(MavenApisupportLookupProvider.java:68)<br/>
Comment 1 kawazu428 2009-07-14 13:32:32 UTC
Created attachment 84708 [details]
stacktrace
Comment 2 kawazu428 2009-07-14 13:41:43 UTC
Build: NetBeans IDE Dev (Build 200907140201)
VM: Java HotSpot(TM) Server VM, 14.0-b16, Java(TM) SE Runtime Environment, 1.6.0_14-b08
OS: Linux, 2.6.28-13-generic, i386

User Comments: 
starting the IDE

Stacktrace: 
java.lang.NullPointerException<br/>
        at org.netbeans.modules.maven.MavenProjectPropsImpl.get(MavenProjectPropsImpl.java:105)<br/>
        at org.netbeans.modules.maven.MavenProjectPropsImpl.get(MavenProjectPropsImpl.java:85)<br/>
        at org.netbeans.modules.maven.api.NbMavenProject.getPackagingType(NbMavenProject.java:290)<br/>
        at org.netbeans.modules.maven.apisupport.MavenApisupportLookupProvider$Provider.checkNbm(MavenApisupportLookupProvider.java:93)<br/>
        at org.netbeans.modules.maven.apisupport.MavenApisupportLookupProvider$Provider.<init>(MavenApisupportLookupProvider.java:81)<br/>
        at org.netbeans.modules.maven.apisupport.MavenApisupportLookupProvider.createAdditionalLookup(MavenApisupportLookupProvider.java:68)<br/>
Comment 3 kawazu428 2009-07-14 13:42:05 UTC
Created attachment 84709 [details]
stacktrace
Comment 4 kawazu428 2009-07-14 13:45:28 UTC
Increasing priority a little as it seems maven2 projects aren't correctly opened anymore due to that.
Comment 5 Milos Kleint 2009-07-15 09:42:00 UTC
The null pointer exception is very strange, it appears on this line:

String val = nbprj.getMavenProject().getProperties().getProperty(key);

nbprj can never be null
getMavenProject() cannot be null unless you have somehow broken netbeans installation. If your own project cannot be
loaded we fallback to a pom from netbeans installation and that one should *always* load.
getProperties() cannot be null as it fallbacks to MavenModel and that one creates a new instance if not defined.

So the only getMavenProject can be the cause. Indeed, in your report there's one additional exception reported.
it seems to be a result of issue 168251 fix.

java.lang.NullPointerException
	at org.netbeans.modules.maven.embedder.NbMavenWorkspaceStore.clear(NbMavenWorkspaceStore.java:30)
	at org.apache.maven.monitor.event.AbstractWorkspaceMonitor.clearCache(AbstractWorkspaceMonitor.java:22)
	at org.apache.maven.monitor.event.PerCallWorkspaceMonitor.embedderMethodEnded(PerCallWorkspaceMonitor.java:12)
	at org.apache.maven.monitor.event.AbstractEmbedderLifecycleMonitor.doEndEvent(AbstractEmbedderLifecycleMonitor.java:44)
	at org.apache.maven.monitor.event.AbstractSelectiveEventMonitor.endEvent(AbstractSelectiveEventMonitor.java:61)
	at org.apache.maven.monitor.event.DefaultEventDispatcher.dispatchEnd(DefaultEventDispatcher.java:67)
	at
org.apache.maven.embedder.event.EmbedderEventDispatcherAspect.ajc$after$org_apache_maven_embedder_event_EmbedderEventDispatcherAspect$4$9a8a5484(EmbedderEventDispatcherAspect.aj:57)
	at org.apache.maven.embedder.MavenEmbedder.readProjectWithDependencies_aroundBody0(MavenEmbedder.java:485)
	at org.apache.maven.embedder.MavenEmbedder.readProjectWithDependencies_aroundBody1$advice(MavenEmbedder.java:304)
	at org.apache.maven.embedder.MavenEmbedder.readProjectWithDependencies(MavenEmbedder.java:1)
[catch] at org.netbeans.modules.maven.NbMavenProjectImpl.getOriginalMavenProject(NbMavenProjectImpl.java:356)
	at org.netbeans.modules.maven.api.NbMavenProject.getMavenProject(NbMavenProject.java:232)
	at org.netbeans.modules.maven.MavenProjectPropsImpl.get(MavenProjectPropsImpl.java:105)



Comment 6 Milos Kleint 2009-07-15 09:48:54 UTC
http://hg.netbeans.org/main/rev/b05c8a2432c8

as issue 168251 was backported to 6.7 branch, this one shall be as well.
Comment 7 Petr Blaha 2009-07-15 16:06:23 UTC
verified in continual build
Comment 8 Quality Engineering 2009-07-16 06:03:27 UTC
Integrated into 'main-golden', will be available in build *200907160201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/b05c8a2432c8
User: Milos Kleint <mkleint@netbeans.org>
Log: #168543 check the map entries for empty values
Comment 9 pgebauer 2009-07-16 10:43:29 UTC
The fix has been ported into the release67_fixes repository.
http://hg.netbeans.org/release67_fixes/rev/ccde0461350d


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo