Problems closing and reopening DALI projectshttps://www.eclipse.org/forums/index.php/mv/msg/137734/434454/#msg_434454
If you close a JPA project, you see an error dialog saying:
An internal error occurred during: "Resynching JPA model ...". (Stack
trace A)

If you now reopen this project, you get a few errors logged saying "An error
occurred while traversing resources". (Stack trace B). At this time, if you
attempt to open your persistence.xml file, it opens in the XML editor; but
the file is marked dirty and only the XML header is present in the file
(<?xml verison ....), the rest of the file seems to be deleted. If I restart
eclipse without saving the file or check the file on the file system, it
seems to be intact. However, if you subsequently open an Entity and click on
any of the @Column annotations, you will only see the "Map As" combo in the
JPA Details view, with nothing selected and the rest of the view empty. So
it seems like the models are not entirely setup on reopen.

Occasionaly, after reopening the JPA project, you might get a stack overflow
error dialog - the log fills up failed assertions (related to Ranges, I
assume this has something to do with the dorked persistence.xml file) and
also several logs of Stack Trace B.

Any ideas?
Brian.

STACK TRACE A

java.lang.NullPointerException
at org.eclipse.core.runtime.Path.append(Path.java:260)
at
org.eclipse.core.internal.resources.Container.getFile(Contai ner.java:116)
at
org.eclipse.jpt.core.internal.content.persistence.MappingFil eRef.getMappingFile(MappingFileRef.java:204)
at
org.eclipse.jpt.core.internal.platform.PersistenceUnitContex t.xmlRootContentNodeFor(PersistenceUnitContext.java:99)
at
org.eclipse.jpt.core.internal.platform.PersistenceUnitContex t.buildPersistenceUnitMetadatas(PersistenceUnitContext.java: 78)
at
org.eclipse.jpt.core.internal.platform.PersistenceUnitContex t. <init>(PersistenceUnitContext.java:64)
at
org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext .buildPersistenceUnitContexts(BaseJpaProjectContext.java:131 )
at
org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext .buildPersistenceUnitContexts(BaseJpaProjectContext.java:123 )
at
org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext .initialize(BaseJpaProjectContext.java:73)
at
org.eclipse.jpt.core.internal.platform.BaseContext.refreshDe faults(BaseContext.java:50)
at
org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext .refreshDefaults(BaseJpaProjectContext.java:155)
at
org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext .refreshDefaults(BaseJpaProjectContext.java:151)
at
org.eclipse.jpt.core.internal.platform.BaseJpaPlatform.resyn ch(BaseJpaPlatform.java:201)
at org.eclipse.jpt.core.internal.JpaProject$1.run(JpaProject.ja va:176)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

STACK TRACE B

at
org.eclipse.wst.common.internal.emf.resource.IDTranslator.se tMOFValue(IDTranslator.java:45)
at
org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.primUpdateMOFFeature(EMF2DOMAdapterImpl.java:1399)
at
org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.updateMOFFeature(EMF2DOMAdapterImpl.java:1755)
at
org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.primUpdateMOF(EMF2DOMAdapterImpl.java:929)
at
org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.updateMOF(EMF2DOMAdapterImpl.java:909)
at
org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.primUpdateMOFMultiFeature(EMF2DOMAdapterImpl.java:457)
at
org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.updateMOFRootFeature(EMF2DOMAdapterImpl.java:950)
at
org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.primUpdateMOF(EMF2DOMAdapterImpl.java:925)
at
org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.updateMOF(EMF2DOMAdapterImpl.java:909)
at
org.eclipse.wst.common.internal.emf.resource.EMF2DOMRenderer .doLoad(EMF2DOMRenderer.java:62)
at
org.eclipse.wst.common.internal.emf.resource.TranslatorResou rceImpl.basicDoLoad(TranslatorResourceImpl.java:142)
at
org.eclipse.wst.common.internal.emf.resource.CompatibilityXM IResourceImpl.doLoad(CompatibilityXMIResourceImpl.java:173)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1354)
at
org.eclipse.wst.common.internal.emf.resource.TranslatorResou rceImpl.load(TranslatorResourceImpl.java:391)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:256)
at
org.eclipse.jem.internal.util.emf.workbench.ProjectResourceS etImpl.demandLoad(ProjectResourceSetImpl.java:83)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:271)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:398)
at
org.eclipse.jem.internal.util.emf.workbench.ProjectResourceS etImpl.getResource(ProjectResourceSetImpl.java:262)
at
org.eclipse.jpt.core.internal.content.persistence.Persistenc eXmlJpaFileContentProvider.buildRootContent(PersistenceXmlJp aFileContentProvider.java:43)
at
org.eclipse.jpt.core.internal.JpaFileContentRegistry.buildCo ntent(JpaFileContentRegistry.java:60)
at
org.eclipse.jpt.core.internal.JpaFileContentRegistry.getFile (JpaFileContentRegistry.java:44)
at
org.eclipse.jpt.core.internal.JpaProject.createJpaFile(JpaPr oject.java:613)
at org.eclipse.jpt.core.internal.JpaProject$3.visit(JpaProject. java:480)
at
org.eclipse.core.internal.resources.Resource$1.visitElement( Resource.java:57)
at
org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:81)
at
org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:85)
at
org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:85)
at
org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:85)
at
org.eclipse.core.internal.watson.ElementTreeIterator.iterate (ElementTreeIterator.java:126)
at org.eclipse.core.internal.resources.Resource.accept(Resource .java:67)
at org.eclipse.jpt.core.internal.JpaProject.fill(JpaProject.jav a:487)
at
org.eclipse.jpt.core.internal.JpaModelManager.createFilledJp aProject(JpaModelManager.java:208)
at
org.eclipse.jpt.core.internal.JpaModelManager$ResourceChange Processor.checkForProjectsBeingAddedOrRemoved(JpaModelManage r.java:411)
at
org.eclipse.jpt.core.internal.JpaModelManager$ResourceChange Processor.checkForProjectsBeingAddedOrRemoved(JpaModelManage r.java:434)
at
org.eclipse.jpt.core.internal.JpaModelManager$ResourceChange Processor.resourceChanged(JpaModelManager.java:327)
at
org.eclipse.jpt.core.internal.JpaModelManager$ResourceChange Listener.resourceChanged(JpaModelManager.java:284)
at
org.eclipse.core.internal.events.NotificationManager$2.run(N otificationManager.java:282)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at
org.eclipse.core.internal.events.NotificationManager.notify( NotificationManager.java:276)
at
org.eclipse.core.internal.events.NotificationManager.broadca stChanges(NotificationManager.java:148)
at
org.eclipse.core.internal.resources.Workspace.broadcastPostC hange(Workspace.java:311)
at
org.eclipse.core.internal.resources.Workspace.endOperation(W orkspace.java:1018)
at
org.eclipse.core.internal.resources.InternalWorkspaceJob.run (InternalWorkspaceJob.java:45)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)]]>Brian Fernandes2007-06-09T00:23:58-00:00Re: Problems closing and reopening DALI projectshttps://www.eclipse.org/forums/index.php/mv/msg/137734/434458/#msg_434458
I wonder if this issue has anything to do with the occasionally seen bug
187370 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=187370).

If you could open a bug for this issue and provide steps on reproducing,
that would be very helpful. We have seen resync's cause errors on project
close when resources are left open, but nothing that causes changes in the
persistence.xml or any other file.

There was also this bug that was just recently fixed that has the stack
trace of A, but I'm not sure it describes your situation. In any case,
this NPE may no longer occur in RC3.

> If you now reopen this project, you get a few errors logged saying "An error
> occurred while traversing resources". (Stack trace B). At this time, if you
> attempt to open your persistence.xml file, it opens in the XML editor; but
> the file is marked dirty and only the XML header is present in the file
> (<?xml verison ....), the rest of the file seems to be deleted. If I restart
> eclipse without saving the file or check the file on the file system, it
> seems to be intact. However, if you subsequently open an Entity and click on
> any of the @Column annotations, you will only see the "Map As" combo in the
> JPA Details view, with nothing selected and the rest of the view empty. So
> it seems like the models are not entirely setup on reopen.

> Occasionaly, after reopening the JPA project, you might get a stack overflow
> error dialog - the log fills up failed assertions (related to Ranges, I
> assume this has something to do with the dorked persistence.xml file) and
> also several logs of Stack Trace B.

If you could open a bug for this issue and provide steps on reproducing,
that would be very helpful. We have seen resync's cause errors on project
close when resources are left open, but nothing that causes changes in the
persistence.xml or any other file.

There was also this bug that was just recently fixed that has the stack
trace of A, but I'm not sure it describes your situation. In any case,
this NPE may no longer occur in RC3.

> If you now reopen this project, you get a few errors logged saying "An error
> occurred while traversing resources". (Stack trace B). At this time, if you
> attempt to open your persistence.xml file, it opens in the XML editor; but
> the file is marked dirty and only the XML header is present in the file
> (<?xml verison ....), the rest of the file seems to be deleted. If I restart
> eclipse without saving the file or check the file on the file system, it
> seems to be intact. However, if you subsequently open an Entity and click on
> any of the @Column annotations, you will only see the "Map As" combo in the
> JPA Details view, with nothing selected and the rest of the view empty. So
> it seems like the models are not entirely setup on reopen.

> Occasionaly, after reopening the JPA project, you might get a stack overflow
> error dialog - the log fills up failed assertions (related to Ranges, I
> assume this has something to do with the dorked persistence.xml file) and
> also several logs of Stack Trace B.

It seems like the errors on open are causing this issue, not the error on
close; I'll test further.

> There was also this bug that was just recently fixed that has the stack
> trace of A, but I'm not sure it describes your situation. In any case,
> this NPE may no longer occur in RC3.

That is good news. I'd like to re-test both the above scenarios in RC3, but
RC3 has not been released yet (any ETA?). Still, if the DALI team already
has versioned off all the DALI plugins for RC3, I'd like to try
retesting against those versions - can you send me the version numbers if
this is the case? (or do I just try the latest versions in each plugin?)

Brian.]]>Brian Fernandes2007-06-12T15:03:38-00:00Re: Problems closing and reopening DALI projectshttps://www.eclipse.org/forums/index.php/mv/msg/137734/600057/#msg_600057
> I wonder if this issue has anything to do with the occasionally seen bug
> 187370 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=187370).
> If you could open a bug for this issue and provide steps on reproducing,
> that would be very helpful. We have seen resync's cause errors on project
> close when resources are left open, but nothing that causes changes in the
> persistence.xml or any other file.
>

It seems like the errors on open are causing this issue, not the error on
close; I'll test further.

> There was also this bug that was just recently fixed that has the stack
> trace of A, but I'm not sure it describes your situation. In any case,
> this NPE may no longer occur in RC3.

That is good news. I'd like to re-test both the above scenarios in RC3, but
RC3 has not been released yet (any ETA?). Still, if the DALI team already
has versioned off all the DALI plugins for RC3, I'd like to try
retesting against those versions - can you send me the version numbers if
this is the case? (or do I just try the latest versions in each plugin?)

Brian.]]>Brian Fernandes2007-06-12T15:03:38-00:00Re: Problems closing and reopening DALI projectshttps://www.eclipse.org/forums/index.php/mv/msg/137734/600064/#msg_600064
These observations were made from a DALI version I checked out on 12th June,
2330 hrs UTC (around an hour ago) - this includes the fix for #192282 (for
your reference).

I'm testing in workspace with only 1 project. This project is a standard JPA
project (no web facet) and has the persistence.xml file in the META-INF
folder under the source folder. There is a single Entity, listed in the
persistence.xml file.

When I close the project I see an error dialog and a log with Stack Trace C,
seems similar to trace A reported earlier. When this project is reopened, I
see two log entries (NPEs) with Stack Trace B. So this issue does not appear
to be fixed yet.

If I open persistence.xml in the XML editor at this time, only the following
line is present in it.
<?xml version="1.0" encoding="UTF-8"?>
The editor opens in a dirty state directly but if I use any external (to
eclipse) editor, the file is actually intact (I assume this is why the
editor is dirty). If I attempt to close the editor, the machine locks up for
a few seconds after which I get a stack overflow error dialog prompting me
to quite eclipse. Once I restart everything works again.

Note: If the project was closed when the workspace was started and later
opened, there are no problems.

Exact steps to reproduce:

1) Open an Entity in the Java editor and click around a bit, observe the
details view to ensure that the JPA models have been setup correctly.
2) Close project (Trace C)
3) Open Project (Trace B x 2)
4) Open persistence.xml file to observe the truncated xml file in the
editor. If you attempt to close the file, you will get the Stack Overflow
error.
5) If you opened an Entity (instead of persistence.xml), the jpa details
view seems to work fine, however JPA validation does not work - old
validation errors remain, new ones fail to show up.

The above series of steps reproduces the issues every time I've tried. The
presence of an active DB connection does not change the outcome.

Do let me know if you can reproduce this issue and whether I should file it.

"Neil Hauge" <neil.hauge@oracle.com> wrote in message
news:095c77db0006f6d53aea6937a8468624$1@www.eclipse.org...
> Brian,
>
> I wonder if this issue has anything to do with the occasionally seen bug
> 187370 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=187370).
> If you could open a bug for this issue and provide steps on reproducing,
> that would be very helpful. We have seen resync's cause errors on project
> close when resources are left open, but nothing that causes changes in the
> persistence.xml or any other file.
>
> There was also this bug that was just recently fixed that has the stack
> trace of A, but I'm not sure it describes your situation. In any case,
> this NPE may no longer occur in RC3.
>
> Neil
>
>
> Brian Fernandes wrote:
>
>> Experienced with DALI RC1.
>
>> If you close a JPA project, you see an error dialog saying:
>> An internal error occurred during: "Resynching JPA model ...".
>> (Stack trace A)
>
>> If you now reopen this project, you get a few errors logged saying "An
>> error occurred while traversing resources". (Stack trace B). At this
>> time, if you attempt to open your persistence.xml file, it opens in the
>> XML editor; but the file is marked dirty and only the XML header is
>> present in the file (<?xml verison ....), the rest of the file seems to
>> be deleted. If I restart eclipse without saving the file or check the
>> file on the file system, it seems to be intact. However, if you
>> subsequently open an Entity and click on any of the @Column annotations,
>> you will only see the "Map As" combo in the JPA Details view, with
>> nothing selected and the rest of the view empty. So it seems like the
>> models are not entirely setup on reopen.
>
>> Occasionaly, after reopening the JPA project, you might get a stack
>> overflow error dialog - the log fills up failed assertions (related to
>> Ranges, I assume this has something to do with the dorked persistence.xml
>> file) and also several logs of Stack Trace B.
>
>> Any ideas?
>> Brian.
>
>
>> STACK TRACE A
>
>> java.lang.NullPointerException
>> at org.eclipse.core.runtime.Path.append(Path.java:260)
>> at
>> org.eclipse.core.internal.resources.Container.getFile(Contai ner.java:116)
>> at
> org.eclipse.jpt.core.internal.content.persistence.MappingFil eRef.getMappingFile(MappingFileRef.java:204)
>> at
> org.eclipse.jpt.core.internal.platform.PersistenceUnitContex t.xmlRootContentNodeFor(PersistenceUnitContext.java:99)
>> at
> org.eclipse.jpt.core.internal.platform.PersistenceUnitContex t.buildPersistenceUnitMetadatas(PersistenceUnitContext.java: 78)
>> at
> org.eclipse.jpt.core.internal.platform.PersistenceUnitContex t. <init>(PersistenceUnitContext.java:64)
>> at
> org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext .buildPersistenceUnitContexts(BaseJpaProjectContext.java:131 )
>> at
> org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext .buildPersistenceUnitContexts(BaseJpaProjectContext.java:123 )
>> at
> org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext .initialize(BaseJpaProjectContext.java:73)
>> at
> org.eclipse.jpt.core.internal.platform.BaseContext.refreshDe faults(BaseContext.java:50)
>> at
> org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext .refreshDefaults(BaseJpaProjectContext.java:155)
>> at
> org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext .refreshDefaults(BaseJpaProjectContext.java:151)
>> at
> org.eclipse.jpt.core.internal.platform.BaseJpaPlatform.resyn ch(BaseJpaPlatform.java:201)
>> at org.eclipse.jpt.core.internal.JpaProject$1.run(JpaProject.ja va:176)
>> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>
>> STACK TRACE B
>
>> at
> org.eclipse.wst.common.internal.emf.resource.IDTranslator.se tMOFValue(IDTranslator.java:45)
>> at
> org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.primUpdateMOFFeature(EMF2DOMAdapterImpl.java:1399)
>> at
> org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.updateMOFFeature(EMF2DOMAdapterImpl.java:1755)
>> at
> org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.primUpdateMOF(EMF2DOMAdapterImpl.java:929)
>> at
> org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.updateMOF(EMF2DOMAdapterImpl.java:909)
>> at
> org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.primUpdateMOFMultiFeature(EMF2DOMAdapterImpl.java:457)
>> at
> org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.updateMOFRootFeature(EMF2DOMAdapterImpl.java:950)
>> at
> org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.primUpdateMOF(EMF2DOMAdapterImpl.java:925)
>> at
> org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.updateMOF(EMF2DOMAdapterImpl.java:909)
>> at
> org.eclipse.wst.common.internal.emf.resource.EMF2DOMRenderer .doLoad(EMF2DOMRenderer.java:62)
>> at
> org.eclipse.wst.common.internal.emf.resource.TranslatorResou rceImpl.basicDoLoad(TranslatorResourceImpl.java:142)
>> at
> org.eclipse.wst.common.internal.emf.resource.CompatibilityXM IResourceImpl.doLoad(CompatibilityXMIResourceImpl.java:173)
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1354)
>> at
> org.eclipse.wst.common.internal.emf.resource.TranslatorResou rceImpl.load(TranslatorResourceImpl.java:391)
>> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:256)
>> at
> org.eclipse.jem.internal.util.emf.workbench.ProjectResourceS etImpl.demandLoad(ProjectResourceSetImpl.java:83)
>> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:271)
>> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:398)
>> at
> org.eclipse.jem.internal.util.emf.workbench.ProjectResourceS etImpl.getResource(ProjectResourceSetImpl.java:262)
>> at
> org.eclipse.jpt.core.internal.content.persistence.Persistenc eXmlJpaFileContentProvider.buildRootContent(PersistenceXmlJp aFileContentProvider.java:43)
>> at
> org.eclipse.jpt.core.internal.JpaFileContentRegistry.buildCo ntent(JpaFileContentRegistry.java:60)
>> at
> org.eclipse.jpt.core.internal.JpaFileContentRegistry.getFile (JpaFileContentRegistry.java:44)
>> at
>> org.eclipse.jpt.core.internal.JpaProject.createJpaFile(JpaPr oject.java:613)
>> at org.eclipse.jpt.core.internal.JpaProject$3.visit(JpaProject. java:480)
>> at
>> org.eclipse.core.internal.resources.Resource$1.visitElement( Resource.java:57)
>> at
> org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:81)
>> at
> org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:85)
>> at
> org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:85)
>> at
> org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:85)
>> at
> org.eclipse.core.internal.watson.ElementTreeIterator.iterate (ElementTreeIterator.java:126)
>> at org.eclipse.core.internal.resources.Resource.accept(Resource .java:67)
>> at org.eclipse.jpt.core.internal.JpaProject.fill(JpaProject.jav a:487)
>> at
> org.eclipse.jpt.core.internal.JpaModelManager.createFilledJp aProject(JpaModelManager.java:208)
>> at
> org.eclipse.jpt.core.internal.JpaModelManager$ResourceChange Processor.checkForProjectsBeingAddedOrRemoved(JpaModelManage r.java:411)
>> at
> org.eclipse.jpt.core.internal.JpaModelManager$ResourceChange Processor.checkForProjectsBeingAddedOrRemoved(JpaModelManage r.java:434)
>> at
> org.eclipse.jpt.core.internal.JpaModelManager$ResourceChange Processor.resourceChanged(JpaModelManager.java:327)
>> at
> org.eclipse.jpt.core.internal.JpaModelManager$ResourceChange Listener.resourceChanged(JpaModelManager.java:284)
>> at
> org.eclipse.core.internal.events.NotificationManager$2.run(N otificationManager.java:282)
>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>> at
> org.eclipse.core.internal.events.NotificationManager.notify( NotificationManager.java:276)
>> at
> org.eclipse.core.internal.events.NotificationManager.broadca stChanges(NotificationManager.java:148)
>> at
> org.eclipse.core.internal.resources.Workspace.broadcastPostC hange(Workspace.java:311)
>> at
> org.eclipse.core.internal.resources.Workspace.endOperation(W orkspace.java:1018)
>> at
> org.eclipse.core.internal.resources.InternalWorkspaceJob.run (InternalWorkspaceJob.java:45)
>> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>
>]]>Brian Fernandes2007-06-13T00:39:50-00:00Re: Problems closing and reopening DALI projectshttps://www.eclipse.org/forums/index.php/mv/msg/137734/434464/#msg_434464
These observations were made from a DALI version I checked out on 12th June,
2330 hrs UTC (around an hour ago) - this includes the fix for #192282 (for
your reference).

I'm testing in workspace with only 1 project. This project is a standard JPA
project (no web facet) and has the persistence.xml file in the META-INF
folder under the source folder. There is a single Entity, listed in the
persistence.xml file.

When I close the project I see an error dialog and a log with Stack Trace C,
seems similar to trace A reported earlier. When this project is reopened, I
see two log entries (NPEs) with Stack Trace B. So this issue does not appear
to be fixed yet.

If I open persistence.xml in the XML editor at this time, only the following
line is present in it.
<?xml version="1.0" encoding="UTF-8"?>
The editor opens in a dirty state directly but if I use any external (to
eclipse) editor, the file is actually intact (I assume this is why the
editor is dirty). If I attempt to close the editor, the machine locks up for
a few seconds after which I get a stack overflow error dialog prompting me
to quite eclipse. Once I restart everything works again.

Note: If the project was closed when the workspace was started and later
opened, there are no problems.

Exact steps to reproduce:

1) Open an Entity in the Java editor and click around a bit, observe the
details view to ensure that the JPA models have been setup correctly.
2) Close project (Trace C)
3) Open Project (Trace B x 2)
4) Open persistence.xml file to observe the truncated xml file in the
editor. If you attempt to close the file, you will get the Stack Overflow
error.
5) If you opened an Entity (instead of persistence.xml), the jpa details
view seems to work fine, however JPA validation does not work - old
validation errors remain, new ones fail to show up.

The above series of steps reproduces the issues every time I've tried. The
presence of an active DB connection does not change the outcome.

Do let me know if you can reproduce this issue and whether I should file it.

"Neil Hauge" <neil.hauge@oracle.com> wrote in message
news:095c77db0006f6d53aea6937a8468624$1@www.eclipse.org...
> Brian,
>
> I wonder if this issue has anything to do with the occasionally seen bug
> 187370 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=187370).
> If you could open a bug for this issue and provide steps on reproducing,
> that would be very helpful. We have seen resync's cause errors on project
> close when resources are left open, but nothing that causes changes in the
> persistence.xml or any other file.
>
> There was also this bug that was just recently fixed that has the stack
> trace of A, but I'm not sure it describes your situation. In any case,
> this NPE may no longer occur in RC3.
>
> Neil
>
>
> Brian Fernandes wrote:
>
>> Experienced with DALI RC1.
>
>> If you close a JPA project, you see an error dialog saying:
>> An internal error occurred during: "Resynching JPA model ...".
>> (Stack trace A)
>
>> If you now reopen this project, you get a few errors logged saying "An
>> error occurred while traversing resources". (Stack trace B). At this
>> time, if you attempt to open your persistence.xml file, it opens in the
>> XML editor; but the file is marked dirty and only the XML header is
>> present in the file (<?xml verison ....), the rest of the file seems to
>> be deleted. If I restart eclipse without saving the file or check the
>> file on the file system, it seems to be intact. However, if you
>> subsequently open an Entity and click on any of the @Column annotations,
>> you will only see the "Map As" combo in the JPA Details view, with
>> nothing selected and the rest of the view empty. So it seems like the
>> models are not entirely setup on reopen.
>
>> Occasionaly, after reopening the JPA project, you might get a stack
>> overflow error dialog - the log fills up failed assertions (related to
>> Ranges, I assume this has something to do with the dorked persistence.xml
>> file) and also several logs of Stack Trace B.
>
>> Any ideas?
>> Brian.
>
>
>> STACK TRACE A
>
>> java.lang.NullPointerException
>> at org.eclipse.core.runtime.Path.append(Path.java:260)
>> at
>> org.eclipse.core.internal.resources.Container.getFile(Contai ner.java:116)
>> at
> org.eclipse.jpt.core.internal.content.persistence.MappingFil eRef.getMappingFile(MappingFileRef.java:204)
>> at
> org.eclipse.jpt.core.internal.platform.PersistenceUnitContex t.xmlRootContentNodeFor(PersistenceUnitContext.java:99)
>> at
> org.eclipse.jpt.core.internal.platform.PersistenceUnitContex t.buildPersistenceUnitMetadatas(PersistenceUnitContext.java: 78)
>> at
> org.eclipse.jpt.core.internal.platform.PersistenceUnitContex t. <init>(PersistenceUnitContext.java:64)
>> at
> org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext .buildPersistenceUnitContexts(BaseJpaProjectContext.java:131 )
>> at
> org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext .buildPersistenceUnitContexts(BaseJpaProjectContext.java:123 )
>> at
> org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext .initialize(BaseJpaProjectContext.java:73)
>> at
> org.eclipse.jpt.core.internal.platform.BaseContext.refreshDe faults(BaseContext.java:50)
>> at
> org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext .refreshDefaults(BaseJpaProjectContext.java:155)
>> at
> org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext .refreshDefaults(BaseJpaProjectContext.java:151)
>> at
> org.eclipse.jpt.core.internal.platform.BaseJpaPlatform.resyn ch(BaseJpaPlatform.java:201)
>> at org.eclipse.jpt.core.internal.JpaProject$1.run(JpaProject.ja va:176)
>> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>
>> STACK TRACE B
>
>> at
> org.eclipse.wst.common.internal.emf.resource.IDTranslator.se tMOFValue(IDTranslator.java:45)
>> at
> org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.primUpdateMOFFeature(EMF2DOMAdapterImpl.java:1399)
>> at
> org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.updateMOFFeature(EMF2DOMAdapterImpl.java:1755)
>> at
> org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.primUpdateMOF(EMF2DOMAdapterImpl.java:929)
>> at
> org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.updateMOF(EMF2DOMAdapterImpl.java:909)
>> at
> org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.primUpdateMOFMultiFeature(EMF2DOMAdapterImpl.java:457)
>> at
> org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.updateMOFRootFeature(EMF2DOMAdapterImpl.java:950)
>> at
> org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.primUpdateMOF(EMF2DOMAdapterImpl.java:925)
>> at
> org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.updateMOF(EMF2DOMAdapterImpl.java:909)
>> at
> org.eclipse.wst.common.internal.emf.resource.EMF2DOMRenderer .doLoad(EMF2DOMRenderer.java:62)
>> at
> org.eclipse.wst.common.internal.emf.resource.TranslatorResou rceImpl.basicDoLoad(TranslatorResourceImpl.java:142)
>> at
> org.eclipse.wst.common.internal.emf.resource.CompatibilityXM IResourceImpl.doLoad(CompatibilityXMIResourceImpl.java:173)
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1354)
>> at
> org.eclipse.wst.common.internal.emf.resource.TranslatorResou rceImpl.load(TranslatorResourceImpl.java:391)
>> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:256)
>> at
> org.eclipse.jem.internal.util.emf.workbench.ProjectResourceS etImpl.demandLoad(ProjectResourceSetImpl.java:83)
>> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:271)
>> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:398)
>> at
> org.eclipse.jem.internal.util.emf.workbench.ProjectResourceS etImpl.getResource(ProjectResourceSetImpl.java:262)
>> at
> org.eclipse.jpt.core.internal.content.persistence.Persistenc eXmlJpaFileContentProvider.buildRootContent(PersistenceXmlJp aFileContentProvider.java:43)
>> at
> org.eclipse.jpt.core.internal.JpaFileContentRegistry.buildCo ntent(JpaFileContentRegistry.java:60)
>> at
> org.eclipse.jpt.core.internal.JpaFileContentRegistry.getFile (JpaFileContentRegistry.java:44)
>> at
>> org.eclipse.jpt.core.internal.JpaProject.createJpaFile(JpaPr oject.java:613)
>> at org.eclipse.jpt.core.internal.JpaProject$3.visit(JpaProject. java:480)
>> at
>> org.eclipse.core.internal.resources.Resource$1.visitElement( Resource.java:57)
>> at
> org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:81)
>> at
> org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:85)
>> at
> org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:85)
>> at
> org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:85)
>> at
> org.eclipse.core.internal.watson.ElementTreeIterator.iterate (ElementTreeIterator.java:126)
>> at org.eclipse.core.internal.resources.Resource.accept(Resource .java:67)
>> at org.eclipse.jpt.core.internal.JpaProject.fill(JpaProject.jav a:487)
>> at
> org.eclipse.jpt.core.internal.JpaModelManager.createFilledJp aProject(JpaModelManager.java:208)
>> at
> org.eclipse.jpt.core.internal.JpaModelManager$ResourceChange Processor.checkForProjectsBeingAddedOrRemoved(JpaModelManage r.java:411)
>> at
> org.eclipse.jpt.core.internal.JpaModelManager$ResourceChange Processor.checkForProjectsBeingAddedOrRemoved(JpaModelManage r.java:434)
>> at
> org.eclipse.jpt.core.internal.JpaModelManager$ResourceChange Processor.resourceChanged(JpaModelManager.java:327)
>> at
> org.eclipse.jpt.core.internal.JpaModelManager$ResourceChange Listener.resourceChanged(JpaModelManager.java:284)
>> at
> org.eclipse.core.internal.events.NotificationManager$2.run(N otificationManager.java:282)
>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>> at
> org.eclipse.core.internal.events.NotificationManager.notify( NotificationManager.java:276)
>> at
> org.eclipse.core.internal.events.NotificationManager.broadca stChanges(NotificationManager.java:148)
>> at
> org.eclipse.core.internal.resources.Workspace.broadcastPostC hange(Workspace.java:311)
>> at
> org.eclipse.core.internal.resources.Workspace.endOperation(W orkspace.java:1018)
>> at
> org.eclipse.core.internal.resources.InternalWorkspaceJob.run (InternalWorkspaceJob.java:45)
>> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>
>]]>Brian Fernandes2007-06-13T00:39:50-00:00Re: Problems closing and reopening DALI projectshttps://www.eclipse.org/forums/index.php/mv/msg/137734/600089/#msg_600089
I am able to reproduce this issue fully. Please do enter a bug for this
with the steps to reproduce that you have provided.

Thanks,
Neil

Brian Fernandes wrote:

> Neil,

> These observations were made from a DALI version I checked out on 12th June,
> 2330 hrs UTC (around an hour ago) - this includes the fix for #192282 (for
> your reference).

> I'm testing in workspace with only 1 project. This project is a standard JPA
> project (no web facet) and has the persistence.xml file in the META-INF
> folder under the source folder. There is a single Entity, listed in the
> persistence.xml file.

> When I close the project I see an error dialog and a log with Stack Trace C,
> seems similar to trace A reported earlier. When this project is reopened, I
> see two log entries (NPEs) with Stack Trace B. So this issue does not appear
> to be fixed yet.

> If I open persistence.xml in the XML editor at this time, only the following
> line is present in it.
> <?xml version="1.0" encoding="UTF-8"?>
> The editor opens in a dirty state directly but if I use any external (to
> eclipse) editor, the file is actually intact (I assume this is why the
> editor is dirty). If I attempt to close the editor, the machine locks up for
> a few seconds after which I get a stack overflow error dialog prompting me
> to quite eclipse. Once I restart everything works again.

> Note: If the project was closed when the workspace was started and later
> opened, there are no problems.

> Exact steps to reproduce:

> 1) Open an Entity in the Java editor and click around a bit, observe the
> details view to ensure that the JPA models have been setup correctly.
> 2) Close project (Trace C)
> 3) Open Project (Trace B x 2)
> 4) Open persistence.xml file to observe the truncated xml file in the
> editor. If you attempt to close the file, you will get the Stack Overflow
> error.
> 5) If you opened an Entity (instead of persistence.xml), the jpa details
> view seems to work fine, however JPA validation does not work - old
> validation errors remain, new ones fail to show up.

> The above series of steps reproduces the issues every time I've tried. The
> presence of an active DB connection does not change the outcome.

> Do let me know if you can reproduce this issue and whether I should file it.

> "Neil Hauge" <neil.hauge@oracle.com> wrote in message
> news:095c77db0006f6d53aea6937a8468624$1@www.eclipse.org...
>> Brian,
>>
>> I wonder if this issue has anything to do with the occasionally seen bug
>> 187370 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=187370).
>> If you could open a bug for this issue and provide steps on reproducing,
>> that would be very helpful. We have seen resync's cause errors on project
>> close when resources are left open, but nothing that causes changes in the
>> persistence.xml or any other file.
>>
>> There was also this bug that was just recently fixed that has the stack
>> trace of A, but I'm not sure it describes your situation. In any case,
>> this NPE may no longer occur in RC3.
>>
>> Neil
>>
>>
>> Brian Fernandes wrote:
>>
>>> Experienced with DALI RC1.
>>
>>> If you close a JPA project, you see an error dialog saying:
>>> An internal error occurred during: "Resynching JPA model ...".
>>> (Stack trace A)
>>
>>> If you now reopen this project, you get a few errors logged saying "An
>>> error occurred while traversing resources". (Stack trace B). At this
>>> time, if you attempt to open your persistence.xml file, it opens in the
>>> XML editor; but the file is marked dirty and only the XML header is
>>> present in the file (<?xml verison ....), the rest of the file seems to
>>> be deleted. If I restart eclipse without saving the file or check the
>>> file on the file system, it seems to be intact. However, if you
>>> subsequently open an Entity and click on any of the @Column annotations,
>>> you will only see the "Map As" combo in the JPA Details view, with
>>> nothing selected and the rest of the view empty. So it seems like the
>>> models are not entirely setup on reopen.
>>
>>> Occasionaly, after reopening the JPA project, you might get a stack
>>> overflow error dialog - the log fills up failed assertions (related to
>>> Ranges, I assume this has something to do with the dorked persistence.xml
>>> file) and also several logs of Stack Trace B.
>>
>>> Any ideas?
>>> Brian.
>>
>>
>>> STACK TRACE A
>>
>>> java.lang.NullPointerException
>>> at org.eclipse.core.runtime.Path.append(Path.java:260)
>>> at
>>> org.eclipse.core.internal.resources.Container.getFile(Contai ner.java:116)
>>> at
>>
org.eclipse.jpt.core.internal.content.persistence.MappingFil eRef.getMappingFile(MappingFileRef.java:204)
>>> at
>>
org.eclipse.jpt.core.internal.platform.PersistenceUnitContex t.xmlRootContentNodeFor(PersistenceUnitContext.java:99)
>>> at
>>
org.eclipse.jpt.core.internal.platform.PersistenceUnitContex t.buildPersistenceUnitMetadatas(PersistenceUnitContext.java: 78)
>>> at
>>
org.eclipse.jpt.core.internal.platform.PersistenceUnitContex t. <init>(PersistenceUnitContext.java:64)
>>> at
>>
org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext .buildPersistenceUnitContexts(BaseJpaProjectContext.java:131 )
>>> at
>>
org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext .buildPersistenceUnitContexts(BaseJpaProjectContext.java:123 )
>>> at
>>
org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext .initialize(BaseJpaProjectContext.java:73)
>>> at
>>
org.eclipse.jpt.core.internal.platform.BaseContext.refreshDe faults(BaseContext.java:50)
>>> at
>>
org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext .refreshDefaults(BaseJpaProjectContext.java:155)
>>> at
>>
org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext .refreshDefaults(BaseJpaProjectContext.java:151)
>>> at
>>
org.eclipse.jpt.core.internal.platform.BaseJpaPlatform.resyn ch(BaseJpaPlatform.java:201)
>>> at org.eclipse.jpt.core.internal.JpaProject$1.run(JpaProject.ja va:176)
>>> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>>
>>> STACK TRACE B
>>
>>> at
>>
org.eclipse.wst.common.internal.emf.resource.IDTranslator.se tMOFValue(IDTranslator.java:45)
>>> at
>>
org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.primUpdateMOFFeature(EMF2DOMAdapterImpl.java:1399)
>>> at
>>
org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.updateMOFFeature(EMF2DOMAdapterImpl.java:1755)
>>> at
>>
org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.primUpdateMOF(EMF2DOMAdapterImpl.java:929)
>>> at
>>
org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.updateMOF(EMF2DOMAdapterImpl.java:909)
>>> at
>>
org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.primUpdateMOFMultiFeature(EMF2DOMAdapterImpl.java:457)
>>> at
>>
org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.updateMOFRootFeature(EMF2DOMAdapterImpl.java:950)
>>> at
>>
org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.primUpdateMOF(EMF2DOMAdapterImpl.java:925)
>>> at
>>
org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.updateMOF(EMF2DOMAdapterImpl.java:909)
>>> at
>>
org.eclipse.wst.common.internal.emf.resource.EMF2DOMRenderer .doLoad(EMF2DOMRenderer.java:62)
>>> at
>>
org.eclipse.wst.common.internal.emf.resource.TranslatorResou rceImpl.basicDoLoad(TranslatorResourceImpl.java:142)
>>> at
>>
org.eclipse.wst.common.internal.emf.resource.CompatibilityXM IResourceImpl.doLoad(CompatibilityXMIResourceImpl.java:173)
>>> at
>>>
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1354)
>>> at
>>
org.eclipse.wst.common.internal.emf.resource.TranslatorResou rceImpl.load(TranslatorResourceImpl.java:391)
>>> at
>>
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:256)
>>> at
>>
org.eclipse.jem.internal.util.emf.workbench.ProjectResourceS etImpl.demandLoad(ProjectResourceSetImpl.java:83)
>>> at
>>
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:271)
>>> at
>>
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:398)
>>> at
>>
org.eclipse.jem.internal.util.emf.workbench.ProjectResourceS etImpl.getResource(ProjectResourceSetImpl.java:262)
>>> at
>>
org.eclipse.jpt.core.internal.content.persistence.Persistenc eXmlJpaFileContentProvider.buildRootContent(PersistenceXmlJp aFileContentProvider.java:43)
>>> at
>>
org.eclipse.jpt.core.internal.JpaFileContentRegistry.buildCo ntent(JpaFileContentRegistry.java:60)
>>> at
>>
org.eclipse.jpt.core.internal.JpaFileContentRegistry.getFile (JpaFileContentRegistry.java:44)
>>> at
>>> org.eclipse.jpt.core.internal.JpaProject.createJpaFile(JpaPr oject.java:613)
>>> at org.eclipse.jpt.core.internal.JpaProject$3.visit(JpaProject. java:480)
>>> at
>>>
org.eclipse.core.internal.resources.Resource$1.visitElement( Resource.java:57)
>>> at
>>
org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:81)
>>> at
>>
org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:85)
>>> at
>>
org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:85)
>>> at
>>
org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:85)
>>> at
>>
org.eclipse.core.internal.watson.ElementTreeIterator.iterate (ElementTreeIterator.java:126)
>>> at org.eclipse.core.internal.resources.Resource.accept(Resource .java:67)
>>> at org.eclipse.jpt.core.internal.JpaProject.fill(JpaProject.jav a:487)
>>> at
>>
org.eclipse.jpt.core.internal.JpaModelManager.createFilledJp aProject(JpaModelManager.java:208)
>>> at
>>
org.eclipse.jpt.core.internal.JpaModelManager$ResourceChange Processor.checkForProjectsBeingAddedOrRemoved(JpaModelManage r.java:411)
>>> at
>>
org.eclipse.jpt.core.internal.JpaModelManager$ResourceChange Processor.checkForProjectsBeingAddedOrRemoved(JpaModelManage r.java:434)
>>> at
>>
org.eclipse.jpt.core.internal.JpaModelManager$ResourceChange Processor.resourceChanged(JpaModelManager.java:327)
>>> at
>>
org.eclipse.jpt.core.internal.JpaModelManager$ResourceChange Listener.resourceChanged(JpaModelManager.java:284)
>>> at
>>
org.eclipse.core.internal.events.NotificationManager$2.run(N otificationManager.java:282)
>>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>> at
>>
org.eclipse.core.internal.events.NotificationManager.notify( NotificationManager.java:276)
>>> at
>>
org.eclipse.core.internal.events.NotificationManager.broadca stChanges(NotificationManager.java:148)
>>> at
>>
org.eclipse.core.internal.resources.Workspace.broadcastPostC hange(Workspace.java:311)
>>> at
>>
org.eclipse.core.internal.resources.Workspace.endOperation(W orkspace.java:1018)
>>> at
>>
org.eclipse.core.internal.resources.InternalWorkspaceJob.run (InternalWorkspaceJob.java:45)
>>> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>>
>>]]>Neil Hauge2007-06-13T15:39:13-00:00Re: Problems closing and reopening DALI projectshttps://www.eclipse.org/forums/index.php/mv/msg/137734/434470/#msg_434470
I am able to reproduce this issue fully. Please do enter a bug for this
with the steps to reproduce that you have provided.

Thanks,
Neil

Brian Fernandes wrote:

> Neil,

> These observations were made from a DALI version I checked out on 12th June,
> 2330 hrs UTC (around an hour ago) - this includes the fix for #192282 (for
> your reference).

> I'm testing in workspace with only 1 project. This project is a standard JPA
> project (no web facet) and has the persistence.xml file in the META-INF
> folder under the source folder. There is a single Entity, listed in the
> persistence.xml file.

> When I close the project I see an error dialog and a log with Stack Trace C,
> seems similar to trace A reported earlier. When this project is reopened, I
> see two log entries (NPEs) with Stack Trace B. So this issue does not appear
> to be fixed yet.

> If I open persistence.xml in the XML editor at this time, only the following
> line is present in it.
> <?xml version="1.0" encoding="UTF-8"?>
> The editor opens in a dirty state directly but if I use any external (to
> eclipse) editor, the file is actually intact (I assume this is why the
> editor is dirty). If I attempt to close the editor, the machine locks up for
> a few seconds after which I get a stack overflow error dialog prompting me
> to quite eclipse. Once I restart everything works again.

> Note: If the project was closed when the workspace was started and later
> opened, there are no problems.

> Exact steps to reproduce:

> 1) Open an Entity in the Java editor and click around a bit, observe the
> details view to ensure that the JPA models have been setup correctly.
> 2) Close project (Trace C)
> 3) Open Project (Trace B x 2)
> 4) Open persistence.xml file to observe the truncated xml file in the
> editor. If you attempt to close the file, you will get the Stack Overflow
> error.
> 5) If you opened an Entity (instead of persistence.xml), the jpa details
> view seems to work fine, however JPA validation does not work - old
> validation errors remain, new ones fail to show up.

> The above series of steps reproduces the issues every time I've tried. The
> presence of an active DB connection does not change the outcome.

> Do let me know if you can reproduce this issue and whether I should file it.

> "Neil Hauge" <neil.hauge@oracle.com> wrote in message
> news:095c77db0006f6d53aea6937a8468624$1@www.eclipse.org...
>> Brian,
>>
>> I wonder if this issue has anything to do with the occasionally seen bug
>> 187370 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=187370).
>> If you could open a bug for this issue and provide steps on reproducing,
>> that would be very helpful. We have seen resync's cause errors on project
>> close when resources are left open, but nothing that causes changes in the
>> persistence.xml or any other file.
>>
>> There was also this bug that was just recently fixed that has the stack
>> trace of A, but I'm not sure it describes your situation. In any case,
>> this NPE may no longer occur in RC3.
>>
>> Neil
>>
>>
>> Brian Fernandes wrote:
>>
>>> Experienced with DALI RC1.
>>
>>> If you close a JPA project, you see an error dialog saying:
>>> An internal error occurred during: "Resynching JPA model ...".
>>> (Stack trace A)
>>
>>> If you now reopen this project, you get a few errors logged saying "An
>>> error occurred while traversing resources". (Stack trace B). At this
>>> time, if you attempt to open your persistence.xml file, it opens in the
>>> XML editor; but the file is marked dirty and only the XML header is
>>> present in the file (<?xml verison ....), the rest of the file seems to
>>> be deleted. If I restart eclipse without saving the file or check the
>>> file on the file system, it seems to be intact. However, if you
>>> subsequently open an Entity and click on any of the @Column annotations,
>>> you will only see the "Map As" combo in the JPA Details view, with
>>> nothing selected and the rest of the view empty. So it seems like the
>>> models are not entirely setup on reopen.
>>
>>> Occasionaly, after reopening the JPA project, you might get a stack
>>> overflow error dialog - the log fills up failed assertions (related to
>>> Ranges, I assume this has something to do with the dorked persistence.xml
>>> file) and also several logs of Stack Trace B.
>>
>>> Any ideas?
>>> Brian.
>>
>>
>>> STACK TRACE A
>>
>>> java.lang.NullPointerException
>>> at org.eclipse.core.runtime.Path.append(Path.java:260)
>>> at
>>> org.eclipse.core.internal.resources.Container.getFile(Contai ner.java:116)
>>> at
>>
org.eclipse.jpt.core.internal.content.persistence.MappingFil eRef.getMappingFile(MappingFileRef.java:204)
>>> at
>>
org.eclipse.jpt.core.internal.platform.PersistenceUnitContex t.xmlRootContentNodeFor(PersistenceUnitContext.java:99)
>>> at
>>
org.eclipse.jpt.core.internal.platform.PersistenceUnitContex t.buildPersistenceUnitMetadatas(PersistenceUnitContext.java: 78)
>>> at
>>
org.eclipse.jpt.core.internal.platform.PersistenceUnitContex t. <init>(PersistenceUnitContext.java:64)
>>> at
>>
org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext .buildPersistenceUnitContexts(BaseJpaProjectContext.java:131 )
>>> at
>>
org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext .buildPersistenceUnitContexts(BaseJpaProjectContext.java:123 )
>>> at
>>
org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext .initialize(BaseJpaProjectContext.java:73)
>>> at
>>
org.eclipse.jpt.core.internal.platform.BaseContext.refreshDe faults(BaseContext.java:50)
>>> at
>>
org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext .refreshDefaults(BaseJpaProjectContext.java:155)
>>> at
>>
org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext .refreshDefaults(BaseJpaProjectContext.java:151)
>>> at
>>
org.eclipse.jpt.core.internal.platform.BaseJpaPlatform.resyn ch(BaseJpaPlatform.java:201)
>>> at org.eclipse.jpt.core.internal.JpaProject$1.run(JpaProject.ja va:176)
>>> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>>
>>> STACK TRACE B
>>
>>> at
>>
org.eclipse.wst.common.internal.emf.resource.IDTranslator.se tMOFValue(IDTranslator.java:45)
>>> at
>>
org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.primUpdateMOFFeature(EMF2DOMAdapterImpl.java:1399)
>>> at
>>
org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.updateMOFFeature(EMF2DOMAdapterImpl.java:1755)
>>> at
>>
org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.primUpdateMOF(EMF2DOMAdapterImpl.java:929)
>>> at
>>
org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.updateMOF(EMF2DOMAdapterImpl.java:909)
>>> at
>>
org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.primUpdateMOFMultiFeature(EMF2DOMAdapterImpl.java:457)
>>> at
>>
org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.updateMOFRootFeature(EMF2DOMAdapterImpl.java:950)
>>> at
>>
org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.primUpdateMOF(EMF2DOMAdapterImpl.java:925)
>>> at
>>
org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterI mpl.updateMOF(EMF2DOMAdapterImpl.java:909)
>>> at
>>
org.eclipse.wst.common.internal.emf.resource.EMF2DOMRenderer .doLoad(EMF2DOMRenderer.java:62)
>>> at
>>
org.eclipse.wst.common.internal.emf.resource.TranslatorResou rceImpl.basicDoLoad(TranslatorResourceImpl.java:142)
>>> at
>>
org.eclipse.wst.common.internal.emf.resource.CompatibilityXM IResourceImpl.doLoad(CompatibilityXMIResourceImpl.java:173)
>>> at
>>>
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1354)
>>> at
>>
org.eclipse.wst.common.internal.emf.resource.TranslatorResou rceImpl.load(TranslatorResourceImpl.java:391)
>>> at
>>
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:256)
>>> at
>>
org.eclipse.jem.internal.util.emf.workbench.ProjectResourceS etImpl.demandLoad(ProjectResourceSetImpl.java:83)
>>> at
>>
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:271)
>>> at
>>
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:398)
>>> at
>>
org.eclipse.jem.internal.util.emf.workbench.ProjectResourceS etImpl.getResource(ProjectResourceSetImpl.java:262)
>>> at
>>
org.eclipse.jpt.core.internal.content.persistence.Persistenc eXmlJpaFileContentProvider.buildRootContent(PersistenceXmlJp aFileContentProvider.java:43)
>>> at
>>
org.eclipse.jpt.core.internal.JpaFileContentRegistry.buildCo ntent(JpaFileContentRegistry.java:60)
>>> at
>>
org.eclipse.jpt.core.internal.JpaFileContentRegistry.getFile (JpaFileContentRegistry.java:44)
>>> at
>>> org.eclipse.jpt.core.internal.JpaProject.createJpaFile(JpaPr oject.java:613)
>>> at org.eclipse.jpt.core.internal.JpaProject$3.visit(JpaProject. java:480)
>>> at
>>>
org.eclipse.core.internal.resources.Resource$1.visitElement( Resource.java:57)
>>> at
>>
org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:81)
>>> at
>>
org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:85)
>>> at
>>
org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:85)
>>> at
>>
org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:85)
>>> at
>>
org.eclipse.core.internal.watson.ElementTreeIterator.iterate (ElementTreeIterator.java:126)
>>> at org.eclipse.core.internal.resources.Resource.accept(Resource .java:67)
>>> at org.eclipse.jpt.core.internal.JpaProject.fill(JpaProject.jav a:487)
>>> at
>>
org.eclipse.jpt.core.internal.JpaModelManager.createFilledJp aProject(JpaModelManager.java:208)
>>> at
>>
org.eclipse.jpt.core.internal.JpaModelManager$ResourceChange Processor.checkForProjectsBeingAddedOrRemoved(JpaModelManage r.java:411)
>>> at
>>
org.eclipse.jpt.core.internal.JpaModelManager$ResourceChange Processor.checkForProjectsBeingAddedOrRemoved(JpaModelManage r.java:434)
>>> at
>>
org.eclipse.jpt.core.internal.JpaModelManager$ResourceChange Processor.resourceChanged(JpaModelManager.java:327)
>>> at
>>
org.eclipse.jpt.core.internal.JpaModelManager$ResourceChange Listener.resourceChanged(JpaModelManager.java:284)
>>> at
>>
org.eclipse.core.internal.events.NotificationManager$2.run(N otificationManager.java:282)
>>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>> at
>>
org.eclipse.core.internal.events.NotificationManager.notify( NotificationManager.java:276)
>>> at
>>
org.eclipse.core.internal.events.NotificationManager.broadca stChanges(NotificationManager.java:148)
>>> at
>>
org.eclipse.core.internal.resources.Workspace.broadcastPostC hange(Workspace.java:311)
>>> at
>>
org.eclipse.core.internal.resources.Workspace.endOperation(W orkspace.java:1018)
>>> at
>>
org.eclipse.core.internal.resources.InternalWorkspaceJob.run (InternalWorkspaceJob.java:45)
>>> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>>
>>]]>Neil Hauge2007-06-13T15:39:13-00:00Re: Problems closing and reopening DALI projectshttps://www.eclipse.org/forums/index.php/mv/msg/137734/600102/#msg_600102
Done, here's the entry: https://bugs.eclipse.org/bugs/show_bug.cgi?id=192477

I want to point out that the stack overflow seems to be a problem with the
JPA Validator and invalid persistence.xml files.

"Neil Hauge" <neil.hauge@oracle.com> wrote in message
news:e82468478ee6117de5ccf45925c8e2be$1@www.eclipse.org...
> Brian,
>
> I am able to reproduce this issue fully. Please do enter a bug for this
> with the steps to reproduce that you have provided.
>
> Thanks,
> Neil]]>Brian Fernandes2007-06-13T17:15:22-00:00Re: Problems closing and reopening DALI projectshttps://www.eclipse.org/forums/index.php/mv/msg/137734/434474/#msg_434474
Done, here's the entry: https://bugs.eclipse.org/bugs/show_bug.cgi?id=192477

I want to point out that the stack overflow seems to be a problem with the
JPA Validator and invalid persistence.xml files.

"Neil Hauge" <neil.hauge@oracle.com> wrote in message
news:e82468478ee6117de5ccf45925c8e2be$1@www.eclipse.org...
> Brian,
>
> I am able to reproduce this issue fully. Please do enter a bug for this
> with the steps to reproduce that you have provided.
>
> Thanks,
> Neil]]>Brian Fernandes2007-06-13T17:15:22-00:00Re: Problems closing and reopening DALI projectshttps://www.eclipse.org/forums/index.php/mv/msg/137734/434477/#msg_434477
Thanks for helping to investigate this. I have opened bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=192694 to address issue B.

Neil]]>Neil Hauge2007-06-14T21:01:40-00:00Re: Problems closing and reopening DALI projectshttps://www.eclipse.org/forums/index.php/mv/msg/137734/600114/#msg_600114
Thanks for helping to investigate this. I have opened bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=192694 to address issue B.