Europa woes with JPA and Dali
I was looking forward to the Europa Eclipse release. There are nice things included. But,…
For an all-in-one jee download you also had to go to the update manager to download DTP “enablement” to do anything. Poor out-of-the-box experience right away.
After updating and rebooting I get this in a dialog box after the “resynching” process:
An error occurred while traversing resources.
org.eclipse.jdt.core.dom.TypeLiteral cannot be cast to org.eclipse.jdt.core.dom.StringLiteral
Fine. What do I do about it?
There are show stopper bugs when you try to use JPA and the Dali tools.
The validation on persistence.xml fails. The xsd – and the JPA spec – and gazillions of examples on the web – allow multiple persistence units in this file. In this release you will be flagged with the red X of death and told your are using “multiple persistence units” in the problems view. How about following the JPA spec please?
OK, I moved the other PUs and have just one going to derby via glassfish jpa in a JSE simple example. Trying to simply assign the Id annotation in the JPA details view generates a “Unhandled event loop exception” in the error log. (stack trace appended below).
Yeesh.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
eclipse.buildId=I20070621-1340 java.version=1.6.0_01 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Command-line arguments: -os win32 -ws win32 -arch x86 -clean -data C:Documents and Settingsgeneworkspacesjpa Error Fri Jul 06 10:46:31 EDT 2007 Unhandled event loop exception org.eclipse.core.runtime.AssertionFailedException: assertion failed: at org.eclipse.core.runtime.Assert.isTrue(Assert.java:109) at org.eclipse.core.runtime.Assert.isTrue(Assert.java:95) at org.eclipse.ui.internal.texteditor.quickdiff.DocumentLineDiffer.handleAboutToBeChanged(DocumentLineDiffer.java:775) at org.eclipse.ui.internal.texteditor.quickdiff.DocumentLineDiffer.documentAboutToBeChanged(DocumentLineDiffer.java:744) at org.eclipse.jface.text.AbstractDocument.fireDocumentAboutToBeChanged(AbstractDocument.java:606) at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1072) at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:151) at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1091) at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:137) at org.eclipse.text.edits.InsertEdit.performDocumentUpdating(InsertEdit.java:81) at org.eclipse.text.edits.TextEdit.traverseDocumentUpdating(TextEdit.java:896) at org.eclipse.text.edits.TextEdit.traverseDocumentUpdating(TextEdit.java:889) at org.eclipse.text.edits.TextEditProcessor.executeDo(TextEditProcessor.java:186) at org.eclipse.text.edits.TextEdit.dispatchPerformEdits(TextEdit.java:736) at org.eclipse.text.edits.TextEditProcessor.performEdits(TextEditProcessor.java:154) at org.eclipse.text.edits.TextEdit.apply(TextEdit.java:708) at org.eclipse.jpt.core.internal.jdtutility.AnnotationEditFormatter.apply(AnnotationEditFormatter.java:36) at org.eclipse.jpt.core.internal.jdtutility.Member.edit_(Member.java:391) at org.eclipse.jpt.core.internal.jdtutility.Member.edit(Member.java:354) at org.eclipse.jpt.core.internal.jdtutility.AbstractAnnotationAdapter.edit(AbstractAnnotationAdapter.java:77) at org.eclipse.jpt.core.internal.jdtutility.AbstractAnnotationAdapter.newMarkerAnnotation(AbstractAnnotationAdapter.java:45) at org.eclipse.jpt.core.internal.content.java.mappings.JavaId.attributeChanged(JavaId.java:278) at org.eclipse.jpt.core.internal.content.java.mappings.JavaId.notifyChanged(JavaId.java:159) at org.eclipse.jpt.core.internal.content.java.JavaEObject$1.notifyChanged(JavaEObject.java:48) at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:247) at org.eclipse.jpt.core.internal.JpaEObject.eNotify(JpaEObject.java:88) at org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1030) at org.eclipse.jpt.core.internal.content.java.mappings.JavaId.setGeneratedValue(JavaId.java:263) at org.eclipse.jpt.ui.internal.mappings.details.IdComposite.primaryKeyGenerationCheckBoxClicked(IdComposite.java:264) at org.eclipse.jpt.ui.internal.mappings.details.IdComposite$5.widgetSelected(IdComposite.java:248) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176) 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:504) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443) at org.eclipse.equinox.launcher.Main.run(Main.java:1169) |
Thanks for trying out Dali and I’m sorry you’re having troubles.
Multiple persistence unit support is not in Dali 1.0 but support is on the
roadmap for 2.0. It’s a pretty tough feature to implement and, AFAIK, no
other JPA tooling supports multiple persistence units at this time. The issues
center on understanding context. For example, if an entity is included in
multiple persistence units, each targeting different database schemas, what
happens when you want to provide code assist for annotations referencing schema
values. What values should be shown in the code assist drop down for @Table?
The Dali team is looking for feedback on how we can smoothly add multiple
persistence unit support into 2.0 so it would be great if you can contribute to
the discussion! The Dali newsgroup is a good place to contribute feedback:
http://www.eclipse.org/newsportal/thread.php?group=eclipse.technology.dali
It looks like you’ve hit a bug discovered after 1.0 went out:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=196086. This should be fixed in
the WTP 2.0/Dali 1.0 maintenance release scheduled for September.
Not sure how you got this but it maybe a result of some bad state resulting
from the previous exception. Hopefully you don’t see it after a restart.
Again, I’m sorry you’re encountering problems but I hope you’ll
log bugs in Bugzilla for things you hit and enhancement requests for things you
think are missing. The Dali community needs more user feedback! We’d
really appreciate your help!
Shaun Smith
Dali co-Lead
EclipseLink Ecosystem Development Lead