| Summary: | Intermittent failure on JPA project creation when starting Eclipse | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] Dali JPA Tools | Reporter: | Neil Hauge <neil.hauge> | ||||||||
| Component: | JPA | Assignee: | Neil Hauge <neil.hauge> | ||||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||||
| Severity: | major | ||||||||||
| Priority: | P3 | CC: | brian.vosburgh, jolene.moffitt, nan.n.li, raghunathan.srinivasan | ||||||||
| Version: | 3.3 | Flags: | neil.hauge:
pmc_approved?
(david_williams) raghunathan.srinivasan: pmc_approved+ neil.hauge: pmc_approved? (naci.dai) neil.hauge: pmc_approved+ neil.hauge: pmc_approved? (cbridgha) neil.hauge: review+ brian.vosburgh: review+ |
||||||||
| Target Milestone: | 3.3 RC3 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows 7 | ||||||||||
| Whiteboard: | PMC_approved | ||||||||||
| Bug Depends on: | 408506, 419080 | ||||||||||
| Bug Blocks: | |||||||||||
| Attachments: |
|
||||||||||
More reproduction steps: -persistence.xml file is open from one of the projects to cause JPA project to be built at startup (this is key) -seems to occur with 2.0 and 2.1 Generic projects, haven't seen it with EclipseLink platform projects yet, but this may be a coincidence. -multiple projects open in the workspace, no java source or entities required to be in any of the projects, just the persistence.xml After some println debugging it appears that the resource locator is coming back null in the following call: return this.getProjectResourceLocator().locationIsValid(file.getParent()); More specifically, the following is returning null during project build: return (ProjectResourceLocator)this.project.getAdapter(ProjectResourceLocator.class); This issue is going to be addressed in the platform in Kepler SR1. As a result, we need to put in a temporary fix into RC3. Created attachment 231821 [details]
Temp patch
Attaching temporary patch to address this issue until the root bug is fixed in the platform. This fix will try to load the factory again (if null the first time) through a different mechanism, essentially creating a delay that will alleviate the race condition. It is not a perfect fix, but is employed in DTP as a way to work around the same issue, so this fix has been proven in production.
Created attachment 231822 [details]
Temp patch
Comment wasn't added in original patch...now commented.
Maybe file another bug, targeted at Kepler SR1; so we don't forget. :-) (In reply to comment #6) > Maybe file another bug, targeted at Kepler SR1; so we don't forget. :-) Good idea - bug 409608 filed for this purpose. JPA core tests pass. 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.
This bug prevents JPA projects from loading at start-up. The workbench must be restarted to correct the issue, and upon doing so, you may end up with the same result.
Is there a work-around? If so, why do you believe the work-around is insufficient?
No workaround. This is a race condition, so no way to predict how it will affect a given user.
How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added?
Manually tested and unit tests have passed.
Give a brief technical overview. Who has reviewed this fix?
See comment 4. Brian has reviewed the fix.
What is the risk associated with this fix?
Very low risk.
Fixed for RC3. . Verified in RC3 as well as regression tested in I-3.6.0-20130718045541 and M-3.5.1-20130719145056. The steps to test this bug can be found at http://wiki.eclipse.org/Dali_3.3_RC3_Release |
Created attachment 229540 [details] NPE On occasion, when opening a workspace from a run config in dev where there are multiple projects, I am hitting an exception which can prevent one or more JPA projects from being built. The exception and subsequent failure are intermittent and appear to affect projects randomly when encountered. java.lang.NullPointerException at org.eclipse.jpt.jpa.core.internal.AbstractJpaProject.fileResourceLocationIsValid(AbstractJpaProject.java:608) Full stack is attached. Cleaning the project is not successful, as the state appears to be persisted, and results in the following JPA tooling error message - "This project has the JPA facet, but no JPA project could be created. See the error log for more details." Cleans do not cause another NPE to be generated in the log. I haven't been able to get into this state in debug mode yet, but need to try more.