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 181108 - NullPointerException at org.netbeans.modules.maven.graph.ArtifactWidget.<init>
Summary: NullPointerException at org.netbeans.modules.maven.graph.ArtifactWidget.<init>
Status: VERIFIED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 6.x
Hardware: All All
: P2 normal (vote)
Assignee: David Simonek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-23 16:50 UTC by malfunction84
Modified: 2010-06-10 13:42 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 165622


Attachments
stacktrace (861 bytes, text/plain)
2010-02-23 16:50 UTC, malfunction84
Details

Note You need to log in before you can comment on or make changes to this bug.
Description malfunction84 2010-02-23 16:50:03 UTC
This bug was originally marked as duplicate of bug 166808, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE 6.8 (Build 200912041610)
VM: Java HotSpot(TM) 64-Bit Server VM, 14.3-b01, Java(TM) SE Runtime Environment, 1.6.0_17-b04
OS: Windows Vista

User Comments:
GUEST: show dependency graph for one maven project (which is a module of another parent project)

GUEST: Generating the Maven dependency graph from the NetBeans menu command.

GUEST: After "Downloading libraries" in status bar when trying to construct maven dependency graph

GUEST: Opening Dependency graph ("Indexing Repo :Local Repository" was in progress)

GUEST: Displaying Dependency Graph

GUEST: showing maven dependency graph

GUEST: Displaying Dependency Graph Viewer

GUEST: trying to view a dependency graph. (Didn't load sucessfully, is stuck on the loading page)

GUEST: Can't build maven project graph. Happened after netbeans restart. Previously built all graphs successfully.

GUEST: Right clicked "Libraries" and tried to make dependency graph.

smsmithee: Tried to view maven dependency graph

GUEST: Displaying dependency graph for maven project.

malfunction84: Attempting to view dependency graph

GUEST: Selected view dependency graph on a maven project.  Project was not indicating any problems, just wanted to see the graph.

summersb: viewing a pom dependency graph




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.maven.graph.ArtifactWidget.<init>(ArtifactWidget.java:124)
   at org.netbeans.modules.maven.graph.DependencyGraphScene.attachNodeWidget(DependencyGraphScene.java:185)
   at org.netbeans.modules.maven.graph.DependencyGraphScene.attachNodeWidget(DependencyGraphScene.java:96)
   at org.netbeans.api.visual.graph.GraphScene.addNode(GraphScene.java:97)
   at org.netbeans.modules.maven.graph.GraphConstructor.endVisit(GraphConstructor.java:129)
   at org.apache.maven.shared.dependency.tree.DependencyNode.accept(DependencyNode.java:317)
Comment 1 malfunction84 2010-02-23 16:50:08 UTC
Created attachment 94439 [details]
stacktrace
Comment 2 Exceptions Reporter 2010-02-23 16:50:15 UTC
This bug already has 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=165622
Comment 3 malfunction84 2010-02-23 18:08:33 UTC
Not realizing this exception had been refiled as a new bug, I attached my pom to the original (bug 166808).
Comment 4 Antonin Nebuzelsky 2010-04-01 08:43:51 UTC
This fixes the symptoms. DependencyNode passed to ArtifactGraphNode should not be null.

Tested with pom.xml snippets with excludes provided in the issue 166808. Artifacts which are not completely excluded, only some of dependency paths to them are excluded, are now correctly created in the graph and only the remaining dependency paths are correctly shown.

http://hg.netbeans.org/core-main/rev/508a0b6d5a62

Dafe, review the fix.
Comment 5 David Simonek 2010-04-01 13:28:24 UTC
Well, I was working on this as well - please add some note or take the bug next time so that we are not working on one issue twice, thanks.

The fix is actually a working workaround, but it's probably the best what we can do for now. Real bug is in Maven model and dependency tree builder.

Let me explain - bug appears on poms with following dependencies structure:

    <dependencies>
	A (which depends on C)
	B excludes C
    </dependencies>

So it's case of "unsuccessful exclusion" where both A and B depends on C, but dependency is excluded only halfway. Note that order is important here, A must go before B in pom, otherwise bug is not present.

Actual bug is that in Maven dependency tree model, there is entry of C with wrong state - DependencyNode.OMITTED_FOR_DUPLICATE, but should be DependencyNode.INCLUDED.

Anyway thanks for fixing, fix works OK.
Comment 6 Antonin Nebuzelsky 2010-04-01 13:45:19 UTC
Good!
Comment 7 Quality Engineering 2010-04-02 05:10:42 UTC
Integrated into 'main-golden', will be available in build *201004020200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/508a0b6d5a62
User: Antonin Nebuzelsky <anebuzelsky@netbeans.org>
Log: #181108: NullPointerException at org.netbeans.modules.maven.graph.ArtifactWidget.<init>
Comment 8 Jaroslav Pospisil 2010-06-10 13:42:21 UTC
v.