Community
Participate
Working Groups
Created attachment 189316 [details] Logged Exception JPA project model is not built after new project creation. This results in the JPA content not displaying in the Explorer. It also prevents the Persistence XML Editor from opening for the generated persistence.xml file. The reason the model is not built is because the generated persistence.xml file isn't committed, and therefor isn't read. To workaround the issue you must save the persistence.xml file that has been generated into an edited state. Once this is done, the model is built and everything goes back to normal. The attached exception is logged. Top of the stack is: org.w3c.dom.DOMException: Not Found at org.eclipse.wst.xml.core.internal.document.ElementImpl.removeAttributeNode(ElementImpl.java:1097) at org.eclipse.wst.xml.core.internal.document.ElementImpl.removeAttributeNode(ElementImpl.java:1067) at org.eclipse.wst.xml.core.internal.document.ElementImpl.removeAttribute(ElementImpl.java:1022) at org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapterImpl.primUpdateDOMFeature(EMF2DOMAdapterImpl.java:1385) at
It would appear that a recent change (released in the last week) to WTP Common or WTP Source Editing has resulted in this issue. This is a tracking bug for Dali.
It looks like the change of note was made in org.eclipse.wst.xml.core.internal.document.ElementImpl by Nitin (attaching Nitin) on 2/16/11. The EMF2DOMSSEAdapter was calling ElementImpl.removeAttribute(String) (which then calls ElementImpl.removeAttributeNode(String)) without checking whether there was an attribute there or not. And perhaps it was counting on there potentially not being an attribute. Perhaps it was also using this API incorrectly. I don't know. But at any rate, with the changes to ElementImpl, there is now an exception thrown when there is no attribute of the given name, and file creation fails. Nitin, do you know the correct behavior in this situation or where this bug should be assigned?
It was caused by a subtle change in trying to improve our DOM conformance. Element#removeAttribute(String) shouldn't be throwing that kind of exception.
Created attachment 189563 [details] patch with test
Committed and released.