Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317728 - NPE in J2EEComponentClasspathContainer.getBaseEARLibRefs
Summary: NPE in J2EEComponentClasspathContainer.getBaseEARLibRefs
Status: RESOLVED FIXED
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows Server 2003
: P3 normal (vote)
Target Milestone: 3.2.1   Edit
Assignee: Jason Sholl CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-23 12:32 EDT by Jason Sholl CLA
Modified: 2010-06-23 13:40 EDT (History)
1 user (show)

See Also:
cbridgha: review+


Attachments
patch for 3.2.1 (4.72 KB, patch)
2010-06-23 12:39 EDT, Jason Sholl CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Sholl CLA 2010-06-23 12:32:49 EDT
The following NPE can be observed in 321 code because of a stale portion of the the dependencygraph.  This can reproduced when removing modules from an EAR that contains a deployment descriptor.

!ENTRY org.eclipse.jst.j2ee 4 2 2010-06-23 12:26:20.156
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jst.j2ee".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathContainer.getBaseEARLibRefs(J2EEComponentClasspathContainer.java:364)
	at org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathContainer.requiresUpdate(J2EEComponentClasspathContainer.java:131)
	at org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathContainer.refresh(J2EEComponentClasspathContainer.java:427)
	at org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater$ModuleUpdateJob.processModules(J2EEComponentClasspathUpdater.java:302)
	at org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater$ModuleUpdateJob.access$4(J2EEComponentClasspathUpdater.java:286)
	at org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater$ModuleUpdateJob$1.run(J2EEComponentClasspathUpdater.java:327)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater$ModuleUpdateJob.run(J2EEComponentClasspathUpdater.java:312)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 1 Jason Sholl CLA 2010-06-23 12:39:11 EDT
Created attachment 172531 [details]
patch for 3.2.1

The specific problem, is that during any event that triggers a project add (this can be triggered by things other than actually a project coming into the workspace, e.g. a change to the .project file).  When an ADD event comes through, the entire graph needs to be updated; this implies that everything needs to be removed and then added again; the bug is the remove was not happening.  How this escaped notice for so long, I can't understand, but the fix is simple, and I also updated the event that is passed around so it properly resolves a remove and add of the same dependency as no change.
Comment 2 Chuck Bridgham CLA 2010-06-23 12:43:15 EDT
approved
Comment 3 Jason Sholl CLA 2010-06-23 13:40:55 EDT
code checked into head for wtp 3.2.1