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

Bug 340175

Summary: JPA facet no longer exposes jpaPlatform to library provider enablement condition
Product: [WebTools] Dali JPA Tools Reporter: Konstantin Komissarchik <konstantin>
Component: GeneralAssignee: Neil Hauge <neil.hauge>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P1 CC: neil.hauge, raj.alagumalai, ram.venkataswamy
Version: 3.0   
Target Milestone: 3.0 M7   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
proposed patch
none
Patch for M5
none
proposed patch v2
none
Patch v2 for M5
none
proposed patch v3
none
Patch v3a for M5
none
proposed patch v3a for Head none

Description Konstantin Komissarchik CLA 2011-03-16 11:35:49 EDT
There were some changes made to the JPA facet for Indigo, the upshot of which the jpaPlatform variable is no longer being made available during library provider enablement condition evaluation.

This breaks adopters such as OEPE that depend on this variable to filter out inappropriate library providers and there doesn't appear to be a suitable replacement. 

Using validation to block the use of inappropriate library provider would have a significant impact on usability as the user would be presented with a number of library providers (many of which are invalid for the config) and it is possible that the library provider with highest priority (the one that gets selected by default) ends up not validating.

Here is how OEPE defines JPA library providers:

  <extension point="org.eclipse.jst.common.project.facet.core.libraryProviders">
  
    <provider id="wls-system-library-provider-eclipselink" extends="wls-system-library-provider">
      <label>WebLogic System Library (Oracle TopLink 11gR1)</label>
      <enablement>
        <or>
          <and>
            <with variable="requestingProjectFacet">
              <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa:1.0" forcePluginActivation="true"/>
            </with>
            <or>
              <and>
                <!-- 10.3.1 ships with JPA Spec 1.0 + EclipseLink 1.1 -->
                <with variable="targetedRuntimes">
                  <test property="oracle.eclipse.tools.common.wtp.core.fproj.containsRuntimeComponentType" value="com.bea.weblogic:10.3.1" forcePluginActivation="true"/>
                </with>
                <with variable="jpaPlatform">
                  <or>
                    <equals value="generic"/>
                    <equals value="org.eclipse.eclipselink.platform" />
                    <equals value="eclipselink1_1" />
                  </or>    
                </with>
              </and>
              <and>
                <!-- 10.3.2 ships with JPA Spec 1.0 + EclipseLink 1.2 -->
                <with variable="targetedRuntimes">
                  <test property="oracle.eclipse.tools.common.wtp.core.fproj.containsRuntimeComponentType" value="com.bea.weblogic:10.3.2" forcePluginActivation="true"/>
                </with>
                <with variable="jpaPlatform">
                  <or>
                    <equals value="generic"/>
                    <equals value="org.eclipse.eclipselink.platform" />
                    <equals value="eclipselink1_1" />
                    <equals value="eclipselink1_2" />
                  </or>    
                </with>
              </and>
              <and>
                <!-- 10.3.3 ships with JPA Spec 1.0 + EclipseLink 2.0 (no support for JPA 2.0 apps) -->
                <with variable="targetedRuntimes">
                  <test property="oracle.eclipse.tools.common.wtp.core.fproj.containsRuntimeComponentType" value="com.bea.weblogic:10.3.3" forcePluginActivation="true"/>
                </with>
                <with variable="jpaPlatform">
                  <or>
                    <equals value="generic"/>
                    <equals value="org.eclipse.eclipselink.platform" />
                    <equals value="eclipselink1_1" />
                    <equals value="eclipselink1_2" />
                  </or>    
                </with>
              </and>
              <and>
                <!-- 10.3.4 ships with JPA Spec 1.0 + EclipseLink 2.1 -->
                <with variable="targetedRuntimes">
                  <test property="oracle.eclipse.tools.common.wtp.core.fproj.containsRuntimeComponentType" value="com.bea.weblogic:10.3.4" forcePluginActivation="true"/>
                </with>
                <with variable="jpaPlatform">
                  <or>
                    <equals value="generic"/>
                    <equals value="org.eclipse.eclipselink.platform" />
                    <equals value="eclipselink1_1" />
                    <equals value="eclipselink1_2" />
                  </or>    
                </with>
              </and>

              <and>
                <!-- 10.3.5 ships with JPA Spec 1.0 + EclipseLink 2.1 -->
                <with variable="targetedRuntimes">
                  <test property="oracle.eclipse.tools.common.wtp.core.fproj.containsRuntimeComponentType" value="com.bea.weblogic:10.3.5" forcePluginActivation="true"/>
                </with>
                <with variable="jpaPlatform">
                  <or>
                    <equals value="generic"/>
                    <equals value="org.eclipse.eclipselink.platform" />
                    <equals value="eclipselink1_1" />
                    <equals value="eclipselink1_2" />
                  </or>    
                </with>
              </and>

            </or>
          </and>
          <and>
            <with variable="requestingProjectFacet">
              <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa:2.0" forcePluginActivation="true"/>
            </with>
            <or>
              <and>
                <!-- 10.3.4 ships with JPA Spec 1.0 (possible to patch to 2.0) + EclipseLink 2.1 -->
                <with variable="targetedRuntimes">
                  <test property="oracle.eclipse.tools.common.wtp.core.fproj.containsRuntimeComponentType" value="com.bea.weblogic:10.3.4" forcePluginActivation="true"/>
                </with>
                <with variable="jpaPlatform">
                  <or>
                    <equals value="generic"/>
                    <equals value="generic2_0"/>
                    <equals value="org.eclipse.eclipselink.platform" />
                    <equals value="eclipselink1_1" />
                    <equals value="eclipselink1_2" />
                    <equals value="eclipselink2_0" />
                    <equals value="eclipselink2_1" />
                  </or>    
                </with>
              </and>
              <and>
                <!-- 10.3.5 ships with JPA Spec 1.0 (possible to patch to 2.0) + EclipseLink 2.1 -->
                <with variable="targetedRuntimes">
                  <test property="oracle.eclipse.tools.common.wtp.core.fproj.containsRuntimeComponentType" value="com.bea.weblogic:10.3.5" forcePluginActivation="true"/>
                </with>
                <with variable="jpaPlatform">
                  <or>
                    <equals value="generic"/>
                    <equals value="generic2_0"/>
                    <equals value="org.eclipse.eclipselink.platform" />
                    <equals value="eclipselink1_1" />
                    <equals value="eclipselink1_2" />
                    <equals value="eclipselink2_0" />
                    <equals value="eclipselink2_1" />
                  </or>    
                </with>
              </and>
            </or>
          </and>
        </or>
      </enablement>
      <param name="definition">
        <![CDATA[
          <system-libraries>
            <module id="org.eclipse.persistence" />
          </system-libraries>
        ]]>
        </param>
      <priority>
        1100
      </priority>
    </provider>

    <provider id="wls-system-library-provider-kodo-4.2" extends="wls-system-library-provider">
      <label>WebLogic System Library (Oracle Kodo 4.2)</label>
      <enablement>
        <with variable="requestingProjectFacet">
          <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa" forcePluginActivation="true"/>
        </with>
        <with variable="targetedRuntimes">
          <count value="+"/>
          <iterate operator="and">
            <or>
              <test property="oracle.eclipse.tools.common.wtp.core.fproj.containsRuntimeComponentType" value="com.bea.weblogic:10.3.0" forcePluginActivation="true"/>
              <test property="oracle.eclipse.tools.common.wtp.core.fproj.containsRuntimeComponentType" value="com.bea.weblogic:10.3.1" forcePluginActivation="true"/>
              <test property="oracle.eclipse.tools.common.wtp.core.fproj.containsRuntimeComponentType" value="com.bea.weblogic:10.3.2" forcePluginActivation="true"/>
              <test property="oracle.eclipse.tools.common.wtp.core.fproj.containsRuntimeComponentType" value="com.bea.weblogic:10.3.3" forcePluginActivation="true"/>
              <test property="oracle.eclipse.tools.common.wtp.core.fproj.containsRuntimeComponentType" value="com.bea.weblogic:10.3.4" forcePluginActivation="true"/>
              <test property="oracle.eclipse.tools.common.wtp.core.fproj.containsRuntimeComponentType" value="com.bea.weblogic:10.3.5" forcePluginActivation="true"/>
            </or>
          </iterate>
        </with>     
        <with variable="jpaPlatform">
            <equals value="generic"/>
        </with>      
      </enablement>
      <param name="definition">
        <![CDATA[
          <system-libraries>
            <module id="com.bea.core.kodo"/>
            <module id="org.apache.openjpa"/>
          </system-libraries>
        ]]>
      </param>
      <priority>
        1000
      </priority>
    </provider>

    <provider id="wls-system-library-provider-kodo-4.1" extends="wls-system-library-provider">
      <label>WebLogic System Library (Oracle Kodo 4.1)</label>
      <enablement>
        <with variable="requestingProjectFacet">
          <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa" forcePluginActivation="true"/>
        </with>
        <with variable="targetedRuntimes">
          <count value="+"/>
          <iterate operator="and">
            <test property="oracle.eclipse.tools.common.wtp.core.fproj.containsRuntimeComponentType" value="com.bea.weblogic:10.0" forcePluginActivation="true"/>
          </iterate>
        </with>  
        <with variable="jpaPlatform">
            <equals value="generic"/>
        </with>      
      </enablement>
      <param name="definition">
        <![CDATA[
          <system-libraries>
            <module id="com.bea.core.kodo"/>
            <module id="org.apache.openjpa"/>
          </system-libraries>
        ]]>
      </param>
      <priority>
        1000
      </priority>
    </provider>
    
  </extension>
Comment 1 Konstantin Komissarchik CLA 2011-03-16 11:49:54 EDT
Forgot to mention that we'd like to see this resolved for M7. We are in the process of evaluating feasibility of planned OEPE Indigo tech previews on M5 and M6. Once the fix is available, could you attach the patch here? We may want to use it to patch OEPE distros on M5 and M6.
Comment 2 Paul Fullbright CLA 2011-03-16 16:40:41 EDT
Created attachment 191356 [details]
proposed patch

Here's a patch that should work in theory, but can't test because of bug 340221.

Tested (limited) with the following test library provider:

		<provider
			id="test"
			extends="no-op-library-provider">
			<param name="message" value="test message"/>
			<param name="warning" value="test warning"/>
			<enablement>
				<or>
					<with variable="jpaPlatform">
						<equals value="generic"/>
					</with>
					<with variable="jpaPlatformDescription">
						<test property="org.eclipse.jpt.jpa.core.jpaPlatform" value="generic2_0"/>
					</with>
				</or>
			</enablement>
		</provider>


Let me know if this works for you.
Comment 3 Konstantin Komissarchik CLA 2011-03-16 19:19:57 EDT
Created attachment 191366 [details]
Patch for M5

I've back ported the patch to M5 as the original one would not apply due to refactoring that happened in M6. Would appreciate a code review of the backport in case I messed something up.
Comment 4 Konstantin Komissarchik CLA 2011-03-16 19:45:57 EDT
I have tested the combination of this "Patch for M5", patch for Bug 340221 and OEPE 1.7.1 Indigo Tech Preview. The issue appears to be resolved. Exhaustive verification will have to wait for QA, but things look promising.
Comment 5 Konstantin Komissarchik CLA 2011-03-16 23:06:44 EDT
I have released the fix for Bug 340221 into M7 build. You should be able to proceed with this fix at this point. OEPE QA will report on detailed testing of the two fixes in conjunction with OEPE.
Comment 6 Konstantin Komissarchik CLA 2011-03-16 23:25:09 EDT
Ok. Not out of the woods yet. The patch does resolve the primary issue, but I just ran into the following related exception. This time, the failure is during build rather than project creation.

org.eclipse.core.runtime.CoreException: The variable jpaPlatform is not defined
	at org.eclipse.core.internal.expressions.WithExpression.evaluate(WithExpression.java:65)
	at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
	at org.eclipse.core.internal.expressions.AndExpression.evaluate(AndExpression.java:29)
	at org.eclipse.core.internal.expressions.CompositeExpression.evaluateOr(CompositeExpression.java:68)
	at org.eclipse.core.internal.expressions.OrExpression.evaluate(OrExpression.java:21)
	at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
	at org.eclipse.core.internal.expressions.AndExpression.evaluate(AndExpression.java:29)
	at org.eclipse.core.internal.expressions.CompositeExpression.evaluateOr(CompositeExpression.java:68)
	at org.eclipse.core.internal.expressions.OrExpression.evaluate(OrExpression.java:21)
	at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
	at org.eclipse.core.internal.expressions.EnablementExpression.evaluate(EnablementExpression.java:53)
	at org.eclipse.jst.common.project.facet.core.libprov.internal.LibraryProvider.isEnabledFor(LibraryProvider.java:287)
	at org.eclipse.jst.common.project.facet.core.libprov.internal.LibraryProvider.isEnabledFor(LibraryProvider.java:258)
	at org.eclipse.jpt.core.internal.AbstractJpaProject.validateLibraryProvider_(AbstractJpaProject.java:1430)
	at org.eclipse.jpt.core.internal.AbstractJpaProject.validateLibraryProvider(AbstractJpaProject.java:1420)
	at org.eclipse.jpt.core.internal.AbstractJpaProject.validate(AbstractJpaProject.java:1413)
	at org.eclipse.jpt.core.internal.AbstractJpaProject.validationMessages(AbstractJpaProject.java:1405)
	at org.eclipse.jpt.core.internal.validation.JpaValidator.getValidationMessages(JpaValidator.java:103)
	at org.eclipse.jpt.core.internal.validation.JpaValidator.validate(JpaValidator.java:88)
	at org.eclipse.jpt.core.internal.validation.JpaValidator.validate(JpaValidator.java:65)
	at org.eclipse.wst.validation.Validator$V2.validate(Validator.java:1159)
	at org.eclipse.wst.validation.internal.ValManager.validate(ValManager.java:704)
	at org.eclipse.wst.validation.internal.ValManager$1.visit(ValManager.java:665)
	at org.eclipse.wst.validation.internal.ValManager.accept(ValManager.java:810)
	at org.eclipse.wst.validation.internal.ValManager.validate(ValManager.java:669)
	at org.eclipse.wst.validation.internal.ValBuilderJob$Visitor.visit(ValBuilderJob.java:299)
	at org.eclipse.core.internal.resources.Resource$2.visit(Resource.java:112)
	at org.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:64)
	at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
	at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
	at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
	at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
	at org.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:127)
	at org.eclipse.core.internal.resources.Resource.accept(Resource.java:74)
	at org.eclipse.core.internal.resources.Resource.accept(Resource.java:110)
	at org.eclipse.core.internal.resources.Resource.accept(Resource.java:94)
	at org.eclipse.wst.validation.internal.ValBuilderJob.fullBuild(ValBuilderJob.java:219)
	at org.eclipse.wst.validation.internal.ValBuilderJob.run(ValBuilderJob.java:178)
	at org.eclipse.wst.validation.internal.ValBuilderJob.runInWorkspace(ValBuilderJob.java:126)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 7 Neil Hauge CLA 2011-03-17 19:04:21 EDT
Created attachment 191477 [details]
proposed patch v2

The previous patch wasn't passing the customVariables to the LibraryProvider.isEnabledFor() method during validation, which was causing the exception during build.  This patch should solve the remaining issues.  

Obsoleted both patches as new patch will be needed for M5 to pick up changes to AstractJpaProject.  Let me know if you run into any issues.
Comment 8 Konstantin Komissarchik CLA 2011-03-17 23:40:12 EDT
Ok. Patch v2 resolves the issue during the build. Testing further, I found a similar problem on the JPA project properties page....

org.eclipse.core.runtime.CoreException: The variable jpaPlatform is not defined
	at org.eclipse.core.internal.expressions.WithExpression.evaluate(WithExpression.java:65)
	at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
	at org.eclipse.core.internal.expressions.EnablementExpression.evaluate(EnablementExpression.java:53)
	at org.eclipse.jst.common.project.facet.core.libprov.internal.LibraryProvider.isEnabledFor(LibraryProvider.java:287)
	at org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate.refresh(LibraryInstallDelegate.java:364)
	at org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate.reset(LibraryInstallDelegate.java:450)
	at org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate.<init>(LibraryInstallDelegate.java:138)
	at org.eclipse.jpt.ui.internal.properties.JptProjectPropertiesPage.createLibraryInstallDelegate(JptProjectPropertiesPage.java:92)
	at org.eclipse.jst.common.project.facet.ui.libprov.LibraryFacetPropertyPage.updateContents(LibraryFacetPropertyPage.java:261)
	at org.eclipse.jst.common.project.facet.ui.libprov.LibraryFacetPropertyPage.createContents(LibraryFacetPropertyPage.java:192)
	at org.eclipse.jface.preference.PreferencePage.createControl(PreferencePage.java:232)
	at org.eclipse.jst.common.project.facet.ui.libprov.LibraryFacetPropertyPage.createControl(LibraryFacetPropertyPage.java:131)
	at org.eclipse.jface.preference.PreferenceDialog.createPageControl(PreferenceDialog.java:1501)
	at org.eclipse.jface.preference.PreferenceDialog$14.run(PreferenceDialog.java:1258)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
	at org.eclipse.jface.preference.PreferenceDialog.showPage(PreferenceDialog.java:1252)
	at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.showPage(FilteredPreferenceDialog.java:674)
	at org.eclipse.jface.preference.PreferenceDialog$10.run(PreferenceDialog.java:708)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.jface.preference.PreferenceDialog$9.selectionChanged(PreferenceDialog.java:704)
	at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:867)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
	at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:865)
	at org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(StructuredViewer.java:1205)
	at org.eclipse.jface.viewers.StructuredViewer$5.widgetSelected(StructuredViewer.java:1230)
	at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrategy.java:252)
	at org.eclipse.jface.util.OpenStrategy.access$5(OpenStrategy.java:246)
	at org.eclipse.jface.util.OpenStrategy$3.run(OpenStrategy.java:423)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4101)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3718)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at org.eclipse.ui.dialogs.PropertyDialogAction.run(PropertyDialogAction.java:158)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4126)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3715)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2697)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2661)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2495)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Comment 9 Konstantin Komissarchik CLA 2011-03-17 23:41:57 EDT
Created attachment 191485 [details]
Patch v2 for M5

The m5 version of v2 patch for posterity.
Comment 10 Neil Hauge CLA 2011-03-18 13:26:59 EDT
Created attachment 191528 [details]
proposed patch v3

Okay...have done a thorough review of the Helios code to ensure that Dali should behave in a similar manner regarding custom variables with this latest patch.  Hopefully this will be the last one.  Let me know if you hit any issues.
Comment 11 Konstantin Komissarchik CLA 2011-03-18 15:26:19 EDT
Created attachment 191543 [details]
Patch v3a for M5

All of my smoke tests pass now. I did run into another issue with the patch that I was able to fix. Hence v3a. 

Problematic scenario that I fixed:

1. Create web project with jpa facet and some runtime.
2. Open project properties page.
3. Open JPA page. Don't change anything.
4. Go to Targeted Runtimes page in the same dialog session. Uncheck the runtime.

The fix is in JpaProjectPropertiesPage.validateLibraryProvider() method.

java.lang.NullPointerException
	at org.eclipse.jpt.ui.internal.properties.JpaProjectPropertiesPage.validateLibraryProvider(JpaProjectPropertiesPage.java:864)
	at org.eclipse.jpt.ui.internal.properties.JpaProjectPropertiesPage.performValidation(JpaProjectPropertiesPage.java:806)
	at org.eclipse.jpt.ui.internal.properties.JptProjectPropertiesPage.performValidation(JptProjectPropertiesPage.java:394)
	at org.eclipse.jst.common.project.facet.ui.libprov.LibraryFacetPropertyPage.updateValidation(LibraryFacetPropertyPage.java:346)
	at org.eclipse.jst.common.project.facet.ui.libprov.LibraryFacetPropertyPage.updateContents(LibraryFacetPropertyPage.java:291)
	at org.eclipse.jst.common.project.facet.ui.libprov.LibraryFacetPropertyPage.access$0(LibraryFacetPropertyPage.java:210)
	at org.eclipse.jst.common.project.facet.ui.libprov.LibraryFacetPropertyPage$1.handleEvent(LibraryFacetPropertyPage.java:184)
	at org.eclipse.wst.common.project.facet.core.internal.FacetedProjectWorkingCopy.notifyListeners(FacetedProjectWorkingCopy.java:1752)
	at org.eclipse.wst.common.project.facet.core.internal.FacetedProjectWorkingCopy.resumeEventNotification(FacetedProjectWorkingCopy.java:1797)
	at org.eclipse.wst.common.project.facet.core.internal.FacetedProjectWorkingCopy.removeTargetedRuntime(FacetedProjectWorkingCopy.java:1315)
	at org.eclipse.wst.common.project.facet.ui.internal.RuntimesPanel.handleCheckStateChanged(RuntimesPanel.java:446)
	at org.eclipse.wst.common.project.facet.ui.internal.RuntimesPanel.access$15(RuntimesPanel.java:429)
	at org.eclipse.wst.common.project.facet.ui.internal.RuntimesPanel$7.checkStateChanged(RuntimesPanel.java:227)
	at org.eclipse.jface.viewers.CheckboxTableViewer$1.run(CheckboxTableViewer.java:212)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
	at org.eclipse.jface.viewers.CheckboxTableViewer.fireCheckStateChanged(CheckboxTableViewer.java:210)
	at org.eclipse.jface.viewers.CheckboxTableViewer.handleSelect(CheckboxTableViewer.java:306)
	at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1220)
	at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:229)
	at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.java:223)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:393)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4126)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3715)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at org.eclipse.ui.dialogs.PropertyDialogAction.run(PropertyDialogAction.java:158)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4126)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3715)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2697)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2661)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2495)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Comment 12 Neil Hauge CLA 2011-03-18 16:07:40 EDT
Created attachment 191552 [details]
proposed patch v3a for Head

Thanks...I've added the same null check and attached a new patch for Head.  Will go ahead and commit this after some additional testing.
Comment 13 Konstantin Komissarchik CLA 2011-03-27 02:00:38 EDT
FYI... The patch for Head has Java 6 specific usage of @Override annotation.

     [java]     [javac] Compiling 470 source files to D:\Oracle\OEPE\Depot\guadalupe\indigo\patches\340175A-M6\plugins\o
rg.eclipse.jpt.jpa.ui\@dot
     [java]     [javac] ----------
     [java]     [javac] 1. ERROR in D:\Oracle\OEPE\Depot\guadalupe\indigo\patches\340175A-M6\plugins\org.eclipse.jpt.jpa
.ui\src\org\eclipse\jpt\jpa\ui\internal\properties\JpaProjectPropertiesPage.java (at line 390)
     [java]     [javac]         public boolean supportsJpaFacetVersion(IProjectFacetVersion jpaFacetVersion) {
     [java]     [javac]                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     [java]     [javac] The method supportsJpaFacetVersion(IProjectFacetVersion) of type new JpaPlatformDescription(){}
must override a superclass method
     [java]     [javac] ----------
     [java]     [javac] 2. ERROR in D:\Oracle\OEPE\Depot\guadalupe\indigo\patches\340175A-M6\plugins\org.eclipse.jpt.jpa
.ui\src\org\eclipse\jpt\jpa\ui\internal\properties\JpaProjectPropertiesPage.java (at line 395)
     [java]     [javac]         public boolean isDefault() {
     [java]     [javac]                        ^^^^^^^^^^^
     [java]     [javac] The method isDefault() of type new JpaPlatformDescription(){} must override a superclass method
     [java]     [javac] ----------
     [java]     [javac] 3. ERROR in D:\Oracle\OEPE\Depot\guadalupe\indigo\patches\340175A-M6\plugins\org.eclipse.jpt.jpa
.ui\src\org\eclipse\jpt\jpa\ui\internal\properties\JpaProjectPropertiesPage.java (at line 400)
     [java]     [javac]         public String getPluginId() {
     [java]     [javac]                       ^^^^^^^^^^^^^
     [java]     [javac] The method getPluginId() of type new JpaPlatformDescription(){} must override a superclass metho
d
     [java]     [javac] ----------
     [java]     [javac] 4. ERROR in D:\Oracle\OEPE\Depot\guadalupe\indigo\patches\340175A-M6\plugins\org.eclipse.jpt.jpa
.ui\src\org\eclipse\jpt\jpa\ui\internal\properties\JpaProjectPropertiesPage.java (at line 405)
     [java]     [javac]         public String getLabel() {
     [java]     [javac]                       ^^^^^^^^^^
     [java]     [javac] The method getLabel() of type new JpaPlatformDescription(){} must override a superclass method
     [java]     [javac] ----------
     [java]     [javac] 5. ERROR in D:\Oracle\OEPE\Depot\guadalupe\indigo\patches\340175A-M6\plugins\org.eclipse.jpt.jpa
.ui\src\org\eclipse\jpt\jpa\ui\internal\properties\JpaProjectPropertiesPage.java (at line 410)
     [java]     [javac]         public String getId() {
     [java]     [javac]                       ^^^^^^^
     [java]     [javac] The method getId() of type new JpaPlatformDescription(){} must override a superclass method
     [java]     [javac] ----------
     [java]     [javac] 6. ERROR in D:\Oracle\OEPE\Depot\guadalupe\indigo\patches\340175A-M6\plugins\org.eclipse.jpt.jpa
.ui\src\org\eclipse\jpt\jpa\ui\internal\properties\JpaProjectPropertiesPage.java (at line 415)
     [java]     [javac]         public JpaPlatformGroupDescription getGroup() {
     [java]     [javac]                                            ^^^^^^^^^^
     [java]     [javac] The method getGroup() of type new JpaPlatformDescription(){} must override a superclass method
     [java]     [javac] ----------
     [java]     [javac] 7. ERROR in D:\Oracle\OEPE\Depot\guadalupe\indigo\patches\340175A-M6\plugins\org.eclipse.jpt.jpa
.ui\src\org\eclipse\jpt\jpa\ui\internal\properties\JpaProjectPropertiesPage.java (at line 420)
     [java]     [javac]         public String getFactoryClassName() {
     [java]     [javac]                       ^^^^^^^^^^^^^^^^^^^^^
     [java]     [javac] The method getFactoryClassName() of type new JpaPlatformDescription(){} must override a supercla
ss method
     [java]     [javac] ----------
     [java]     [javac] 7 problems (7 errors)
     [java]     [javac] Compilation failed. Compiler errors are available in D:\Oracle\OEPE\Depot\guadalupe\indigo\patch
es\340175A-M6\plugins\org.eclipse.jpt.jpa.ui/@dot.log
Comment 14 Neil Hauge CLA 2011-03-31 10:22:28 EDT
Checked patch into head last night for this week's I-Build after removing the 1.6 specific code.