This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 228748 - NPE in Web Page Editor when validating a page
Summary: NPE in Web Page Editor when validating a page
Status: RESOLVED FIXED
Alias: None
Product: Java Server Faces
Classification: WebTools
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 RC1   Edit
Assignee: Cameron Bateman CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-24 15:25 EDT by Raghunathan Srinivasan CLA
Modified: 2010-04-16 03:48 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Raghunathan Srinivasan CLA 2008-04-24 15:25:01 EDT
Create a JSPX page
Open using the Web Page Editor
Add a commandButton
Set its Value and action attribute:
<h:commandButton value="Login" action="login"></h:commandButton>
Save
Right-mouse on the JSPX file and select 'Validate'

In the Error view, you get the following exception:

Error validating attribute: action on element h:commandButton
java.lang.NullPointerException
at org.eclipse.emf.ecore.util.EContentAdapter.addAdapter(EContentAdapter.java:352)
at org.eclipse.emf.ecore.util.EContentAdapter.setTarget(EContentAdapter.java:225)
at org.eclipse.emf.ecore.util.EContentAdapter.setTarget(EContentAdapter.java:188)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl$EAdapterList.didAdd(BasicNotifierImpl.java:77)
at org.eclipse.emf.common.util.BasicEList.addUnique(BasicEList.java:646)
at org.eclipse.emf.common.util.BasicEList.add(BasicEList.java:626)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl$EAdapterList.add(BasicNotifierImpl.java:129)
at org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager.addFacesConfigChangeAdapter(JSFAppConfigManager.java:769)
at org.eclipse.jst.jsf.core.jsfappconfig.ImplicitRuntimeJSFAppConfigProvider.getFacesConfigModel(ImplicitRuntimeJSFAppConfigProvider.java:49)
at org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager.getFacesConfigModels(JSFAppConfigManager.java:409)
at org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager.getNavigationRules(JSFAppConfigManager.java:557)
at org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager.getNavigationRulesForPage(JSFAppConfigManager.java:591)
at org.eclipse.jst.jsf.taglibprocessing.attributevalues.ActionType.isValidValue(ActionType.java:73)
at org.eclipse.jst.jsf.validation.internal.strategy.AttributeValidatingStrategy.validateNonELAttributeValue(AttributeValidatingStrategy.java:388)
at org.eclipse.jst.jsf.validation.internal.strategy.AttributeValidatingStrategy.access$1(AttributeValidatingStrategy.java:357)
at org.eclipse.jst.jsf.validation.internal.strategy.AttributeValidatingStrategy$1.run(AttributeValidatingStrategy.java:135)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.jst.jsf.validation.internal.strategy.AttributeValidatingStrategy.validateAttributeValue(AttributeValidatingStrategy.java:119)
at org.eclipse.jst.jsf.validation.internal.strategy.AttributeValidatingStrategy.validate(AttributeValidatingStrategy.java:101)
at org.eclipse.jst.jsf.validation.internal.XMLViewDefnValidator.validateTag(XMLViewDefnValidator.java:89)
at org.eclipse.jst.jsf.validation.internal.XMLViewDefnValidator.validateRegions(XMLViewDefnValidator.java:167)
at org.eclipse.jst.jsf.validation.internal.XMLViewDefnValidator.validateView(XMLViewDefnValidator.java:155)
at org.eclipse.jst.jsf.ui.internal.validation.JSFValidator.validate(JSFValidator.java:94)
at org.eclipse.wst.sse.ui.internal.reconcile.validator.ReconcileStepForValidator.validate(ReconcileStepForValidator.java:340)
at org.eclipse.wst.sse.ui.internal.reconcile.validator.ReconcileStepForValidator.reconcileModel(ReconcileStepForValidator.java:247)
at org.eclipse.jface.text.reconciler.AbstractReconcileStep.reconcile(AbstractReconcileStep.java:96)
at org.eclipse.wst.sse.ui.internal.reconcile.validator.ValidatorStrategy.reconcile(ValidatorStrategy.java:228)
at org.eclipse.wst.sse.ui.internal.reconcile.DocumentRegionProcessor.process(DocumentRegionProcessor.java:175)
at org.eclipse.wst.sse.ui.internal.reconcile.StructuredRegionProcessor.process(StructuredRegionProcessor.java:252)
at org.eclipse.wst.sse.ui.internal.reconcile.DirtyRegionProcessor.run(DirtyRegionProcessor.java:633)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 1 Raghunathan Srinivasan CLA 2008-04-24 16:59:45 EDT
Re-targeting it to Rc1 since this is not a show-stopper for M7
Comment 2 Raghunathan Srinivasan CLA 2008-05-15 15:53:27 EDT
Don't see this error when testing the RC1 source.
Comment 3 Nobody - feel free to take it CLA 2010-04-16 03:47:50 EDT
Changing the resolution to fixed as I believe the issue still existed. The root cause was a race condition with multiple concurrent threads trying to access/initialize underlying EMF models for the JSF configuration models.

This thread safety problem is also the same issue for bug 237350 and bug 237355.

Over the period since this bug was logged, there has been refactoring work to allow adopters to extend and improve the JSFAppConfigManager. Callers now get a JSFAppConfigManager instance by calling the JSFAppConfigManagerFactory.

Additional code changes were made to JSFAppConfigManagerFactory to help ensure
thread safety for initialization of underlying EMF models in providers (from
the locators).
Comment 4 Nobody - feel free to take it CLA 2010-04-16 03:48:49 EDT
Fix applied to HEAD (3.2M7).