| Summary: | JPA persistence.xml file does not get created | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [WebTools] Dali JPA Tools | Reporter: | Kenneth Cheung <kennethc> | ||||
| Component: | General | Assignee: | Neil Hauge <neil.hauge> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | P3 | CC: | david_williams, ktsao, neil.hauge, paul.fullbright, theivend | ||||
| Version: | unspecified | ||||||
| Target Milestone: | 2.3.3 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
ClearCase Remote Client 7.1.2 and 7.1.1.4 were used. Is the clearcase step necessary to reproduce this behavior? Yes, otherwise it works fine. Thanks for looking into this. In case it's not widely known ... There are some "pessimistic file system provider examples" where you can "simulate" pessimistic SCM's ... instead of installing clearcase yourself :) I found this old note on newsgroup, if it helps: = = = In the Eclipse Help go to Platform Plug-in Developer Guide > Examples Guide > Installing the examples. Or use the repository :pserver:anonymous@xxxxxxxxxxxxxxx:/cvsroot/eclipse and get org.eclipse.team.examples.filesystem plug-in. = = = I thought we had dealt with something like this before - see bug 290061. We should try to get this into SR2. Created attachment 188555 [details]
Adding JPA facet
I just tried to reproduce this in the latest Helios SR2 code using the pessimistic file system provider and everything worked as expected. After adding the JPA facet I was presented with the attached dialog. The persistence.xml file was created.
Are you able to reproduce using base WTP? If this is unique to ClearCase, you may need to debug yourself and post information on what is happening. Everything looks good in the code from my end.
We'll definitely try that. Could you give me a link that we can get the exact build you tried with? Thanks. Sure...this is the build I am targeting. http://download.eclipse.org/webtools/downloads/drops/R3.2.3/M-3.2.3-20110203200212/ After some debugging with a CCRC myself I found that the projects are actually moved away from the workspace to the ClearCase views in the file system.
As a result in org.eclipse.jpt.core.internal.operations.AbstractJpaFileCreationOperation:
protected void createSourceFolder() throws ExecutionException {
// Get the source folder name from the data model
String folderPath = model.getStringProperty(SOURCE_FOLDER);
IProject project = getProject();
IWorkspaceRoot root = project.getWorkspace().getRoot();
IContainer container = root.getContainerForLocation(root.getLocation().append(new Path(folderPath)));
container equals null and
this.createdSourceFolder = container;
and hence NullPointerException in
protected void createFile() {
String filePath = getDataModel().getStringProperty(FILE_PATH);
IFile newFile = this.createdSourceFolder.getFile(new Path(filePath));
Does it explain the NPE and if so is it possible to make it work for source controls that move file away from the local workspace? Thanks.
That would certainly explain the problem. We just fixed a very similar issue in head (and 2.3.4 maintenance) that will likely address this issue as well. See bug 336553. Try to reproduce this with the patch attached to that bug and let me know if that fixes the problem. I agree. I think you'll find that fix will work for you, if that's what's causing the issue. Yes, that patch did the trick. Thanks. Fixed as a result of the changes for bug 336553. Is this bug, or bug 336553 a regression? Or, just happened to be discovered now? (In reply to comment #14) > Is this bug, or bug 336553 a regression? Or, just happened to be discovered > now? It looks like we almost completely avoided this bug in the Helios stream as it was introduced in WTP 3.2.2, a result of the change made for bug 309030. Almost made it for SR2. After hearing from multiple large adopters and discussing with WTP PMC, we have decided to try and respin the WTP Helios SR2 candidate to include the fix for this issue. There doesn't seem to be a workaround for the ClearCase usage, and as a result this effectively blocks the creation of a usable Dali project. |
Build Identifier: 3.6.2 1) Create a Dynamic Web Project 2) Add project to ClearCase 7.1.2 3) Add JPA 2.0 facet persistence.xml does not created and the following message is on the .log: java.lang.NullPointerException at org.eclipse.jpt.core.internal.operations.AbstractJpaFileCreationOperation.createFile(Unknown Source) at org.eclipse.jpt.core.internal.operations.AbstractJpaFileCreationOperation.execute(Unknown Source) at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl$1.run(Unknown Source) at org.eclipse.core.internal.resources.Workspace.run(Unknown Source) at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.runOperation(Unknown Source) at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.runOperation(Unknown Source) at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.doExecute(Unknown Source) at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.executeImpl(Unknown Source) at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.cacheThreadAndContinue(Unknown Source) at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.execute(Unknown Source) at org.eclipse.jpt.core.internal.facet.JpaFacetInstallDelegate.createPersistenceXml(Unknown Source) at org.eclipse.jpt.core.internal.facet.JpaFacetInstallDelegate.createProjectXml(Unknown Source) at org.eclipse.jpt.core.internal.facet.JpaFacetInstallDelegate.execute_(Unknown Source) at org.eclipse.jpt.core.internal.facet.JpaFacetActionDelegate.execute(Unknown Source) at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.callDelegate(Unknown Source) at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.modifyInternal(Unknown Source) at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.mergeChangesInternal(Unknown Source) at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.access$2(Unknown Source) at org.eclipse.wst.common.project.facet.core.internal.FacetedProject$5.run(Unknown Source) at org.eclipse.core.internal.resources.Workspace.run(Unknown Source) at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.mergeChanges(Unknown Source) at org.eclipse.wst.common.project.facet.core.internal.FacetedProjectWorkingCopy.commitChanges(Unknown Source) at org.eclipse.wst.common.project.facet.ui.internal.FacetsPropertyPage$4.run(Unknown Source) at org.eclipse.core.internal.resources.Workspace.run(Unknown Source) at org.eclipse.wst.common.project.facet.ui.internal.FacetsPropertyPage$5.run(Unknown Source) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(Unknown Source) Reproducible: Always Steps to Reproduce: 1) Create a Dynamic Web Project 3.0 2) Add project to ClearCase 7.1.2 3) Add JPA 2.0 facet