Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 360645

Summary: NullPointerException in wst.common.snippets when opening JSP
Product: [WebTools] WTP Common Tools Reporter: Victor Homyakov <vkhomyackov>
Component: Snippets FrameworkAssignee: Nitin Dahyabhai <thatnitind>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: major    
Priority: P3 CC: dirk.olmes, rulatir, thatnitind
Version: unspecified   
Target Milestone: 3.4 M7   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Error log details
none
Patch to avoid the NPE
thatnitind: iplog+
Somewhat different stacktrace none

Description Victor Homyakov CLA 2011-10-12 06:27:30 EDT
Build Identifier: 20110916-0149

Sometimes when opening JSP file, Eclipse shows "Problem Occurred" popup which talks about NullPointerException in org.eclipse.wst.common.snippets.internal.SnippetTransfer.nativeToJava(SnippetTransfer.java:87).

Reproducible: Sometimes

Steps to Reproduce:
1. Open JSP.
Comment 1 Victor Homyakov CLA 2011-10-12 06:29:53 EDT
Created attachment 205015 [details]
Error log details
Comment 2 Dirk Olmes CLA 2011-11-30 04:20:17 EST
I see the same stack trace when opening new .java files with the snippets view active.
Comment 3 Dirk Olmes CLA 2011-11-30 04:23:24 EST
Created attachment 207711 [details]
Patch to avoid the NPE
Comment 4 Szczepan Holyszewski CLA 2012-01-15 19:29:18 EST
I get a NPE with similar stack trace, with the flows converging at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:610). Attaching the trace.
Comment 5 Szczepan Holyszewski CLA 2012-01-15 19:37:02 EST
Created attachment 209510 [details]
Somewhat different stacktrace

Forgot to add in the original comment that I receive it most of the time when a view that is placed in a tab is activated for the first time. For example, when I launch Eclipse and it reopens files in editors, I get one NPE immediately for the active tab. Then when I switch to other tabs, I get the NPE once for each tab, but not upon any subsequent switching to the tabs that had been activated at least once. For another example, I received this NPE when I opened the error log view, because it opened in a tab and immediately activated. I copied the stack trace from the most recent entry in the log, so it may well be the trace of the NPE that I got when opening the error log view.
Comment 6 Nitin Dahyabhai CLA 2012-04-25 21:01:19 EDT
Patch released, thanks, Dirk!