Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 342469 - NPE during build (J2EEDeployableFactory.clearCache())
Summary: NPE during build (J2EEDeployableFactory.clearCache())
Status: RESOLVED FIXED
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: 3.2.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2.4   Edit
Assignee: Roberto Sanchez Herrera CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard:
Keywords:
Depends on: 261914
Blocks:
  Show dependency tree
 
Reported: 2011-04-11 12:49 EDT by Patric Rufflar CLA
Modified: 2011-04-14 10:17 EDT (History)
2 users (show)

See Also:
cbridgha: review+


Attachments
Check for null (1.06 KB, patch)
2011-04-12 10:24 EDT, Roberto Sanchez Herrera CLA
ccc: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Patric Rufflar CLA 2011-04-11 12:49:30 EDT
Build Identifier: 3.2.3

java.lang.NullPointerException
at org.eclipse.jst.j2ee.internal.deployables.J2EEDeployableFactory.clearCache(J2EEDeployableFactory.java:238)
at org.eclipse.wst.server.core.util.ProjectModuleFactoryDelegate.handleGlobalProjectChange(ProjectModuleFactoryDelegate.java:146)
at org.eclipse.wst.server.core.internal.ResourceManager.publishHandleProjectChange(ResourceManager.java:974)
at org.eclipse.wst.server.core.internal.ResourceManager$ServerResourceChangeListener$1.visit(ResourceManager.java:123)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:68)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:48)
at org.eclipse.wst.server.core.internal.ResourceManager$ServerResourceChangeListener.resourceChanged(ResourceManager.java:117)
at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:291)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285)
at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149)
at org.eclipse.core.internal.resources.Workspace.broadcastBuildEvent(Workspace.java:311)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:147)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:242)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Reproducible: Didn't try
Comment 1 Carl Anderson CLA 2011-04-11 21:57:46 EDT
The code to clear the cache was added as part of bug 261914
Comment 2 Carl Anderson CLA 2011-04-11 22:00:13 EDT
Line 238 is:

if (module.getProject().equals(project)) {

My assumption would be that module.getProject() returns null.
This code should check for null, since the IModule interface specifically states that null will be returned if the project is outside of the workspace.
Comment 3 Roberto Sanchez Herrera CLA 2011-04-12 10:24:28 EDT
Created attachment 193049 [details]
Check for null
Comment 4 Chuck Bridgham CLA 2011-04-14 09:51:56 EDT
approve
Comment 5 Carl Anderson CLA 2011-04-14 10:12:40 EDT
Committed to R3_2_maintenance and HEAD for WTP 3.2.4 and WTP 3.3 M7