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

Bug 323083

Summary: [WPE] NPE and failure opening WPE using unknown file type
Product: [WebTools] Java Server Faces Reporter: Gerry Kessler <gerry.kessler>
Component: JSF ToolsAssignee: Gerry Kessler <gerry.kessler>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: raghunathan.srinivasan
Version: 3.2Flags: raghunathan.srinivasan: pmc_approved? (david_williams)
raghunathan.srinivasan: pmc_approved? (naci.dai)
raghunathan.srinivasan: pmc_approved? (deboer)
raghunathan.srinivasan: pmc_approved? (neil.hauge)
raghunathan.srinivasan: pmc_approved? (kaloyan)
raghunathan.srinivasan: pmc_approved+
raghunathan.srinivasan: review+
Target Milestone: 3.2.2   
Hardware: PC   
OS: Windows XP   
Whiteboard: PMC_approved ORACLE_P2

Description Gerry Kessler CLA 2010-08-18 16:00:47 EDT
If a file has no known content type (by file extension), the WPE will open to an exception shown below.  Internally no TagRegistryIdentifier is located.

Steps:
1) Create DWP
2) Create JSP file... (it can be any kind of a file for that matter)
3) Rename to have .random file extension
4) Open in WPE

Result:
 NPE and editor with stack trace

java.lang.NullPointerException 
at 
org.eclipse.jst.pagedesigner.editors.palette.impl.PaletteHelper.getOrCreateTag 
libPaletteDrawer(PaletteHelper.java:130) 
at 
org.eclipse.jst.pagedesigner.editors.palette.impl.PaletteItemManager.registerH 
TMLCategory(PaletteItemManager.java:343) 
at 
org.eclipse.jst.pagedesigner.editors.palette.impl.PaletteItemManager.initTagRe 
gistry(PaletteItemManager.java:307) 
at 
org.eclipse.jst.pagedesigner.editors.palette.impl.PaletteItemManager.init(Pale 
tteItemManager.java:272) 
at 
org.eclipse.jst.pagedesigner.editors.palette.impl.PaletteItemManager.reset(Pal 
etteItemManager.java:302) 
at 
oracle.eclipse.tools.webtier.ui.internal.palette.model.taglibs.TagLibPaletteCo 
ntributor.getContributions(TagLibPaletteContributor.java:74) 
at 
oracle.eclipse.tools.webtier.ui.palette.internal.OEPEPaletteRoot.addDrawers(OE 
PEPaletteRoot.java:138) 
at 
oracle.eclipse.tools.webtier.ui.palette.internal.OEPEPaletteRoot.resetPaletteR 
oot(OEPEPaletteRoot.java:110) 
at 
oracle.eclipse.tools.webtier.ui.palette.internal.OEPEPaletteRoot.<init>(OEPEPa 
letteRoot.java:51) 
at 
oracle.eclipse.tools.webtier.ui.palette.internal.PaletteFactory.createPaletteR 
oot(PaletteFactory.java:61) 
at 
org.eclipse.jst.pagedesigner.editors.SimpleGraphicalEditor.getPaletteRoot(Simp 
leGraphicalEditor.java:479) 
at 
org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette.setEditDomain(Graphi 
calEditorWithFlyoutPalette.java:145) 
at 
org.eclipse.jst.pagedesigner.editors.SimpleGraphicalEditor.<init>(SimpleGraphi 
calEditor.java:164) 
at 
org.eclipse.jst.pagedesigner.editors.HTMLEditor.sash_createAndAddDesignSourceP 
age(HTMLEditor.java:259) 
at 
org.eclipse.jst.pagedesigner.editors.HTMLEditor.createPages(HTMLEditor.java:43 
9)
Comment 1 Gerry Kessler CLA 2010-08-24 19:38:47 EDT
Checked into HEAD (3.2.2 and 3.3).

When a file is opened without a content type, a dialog will prompt the user to set it.  If the user chooses not to, the WPE will still open to an error.   If the ocntent type is set, the WPE will open correctly...

except that the palette will not be initialized.   This will require the user to close and reopen the editor.  Bug 323545 has been created to track.
Comment 2 Raghunathan Srinivasan CLA 2010-08-27 14:36:36 EDT
* Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug"
(requested by an adopter) please document it as such. 
See description
* Is there a work-around? If so, why do you believe the work-around is
insufficient? 
None
* How has the fix been tested? Is there a test case attached to the bugzilla
record? Has a JUnit Test been added? 
Manual
* Give a brief technical overview. Who has reviewed this fix? 
See comment 1
* What is the risk associated with this fix? 
none-low
Comment 3 Raghunathan Srinivasan CLA 2010-08-27 14:36:54 EDT
This failed to make this week's build because of spurious junit failures in
local testing.