Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 323894

Summary: EclipseLink 1.2.x platform support fails when adding attribute
Product: [WebTools] Dali JPA Tools Reporter: Tuukka Mustonen <catapl3xis>
Component: Diagram EditorAssignee: Project Inbox <dali.diagrameditor-inbox>
Status: RESOLVED WORKSFORME QA Contact: Stefan Dimov <stefan.dimov>
Severity: normal    
Priority: P3 CC: catapl3xis, petya.sabeva
Version: 0.5   
Target Milestone: 0.5 RC2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Tuukka Mustonen CLA 2010-08-28 18:55:49 EDT
Steps to reproduce:
1. Install Eclipse Helios (build 20100617-1415). Install Graphiti nightly build
(0.7.0.v20100827-0726). Install JPA Diagram Editor (0.5.0.201008131407).
2. Create new JPA project. Select "minimal JPA 1.0 configuration". Pick EclipseLink 1.2.x as platform.
3. Open JPA Diagram.
4. Drag-drop entity into diagram and click to add attribute for it. The entity model disappears from the diagram and the trace below occurs.

Note: works with EclipseLink 1.0.x and 1.1.x but not with 1.2.x.

!ENTRY org.eclipse.graphiti 4 0 2010-08-29 01:52:47.680
!MESSAGE CommandExec.executeCommand() java.lang.ClassCastException: org.eclipse.jpt.eclipselink.core.internal.v1_2.context.java.EclipseLinkJavaPersistentType1_2 cannot be cast to org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaPersistentType
!STACK 0
java.lang.ClassCastException: org.eclipse.jpt.eclipselink.core.internal.v1_2.context.java.EclipseLinkJavaPersistentType1_2 cannot be cast to org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaPersistentType
	at org.eclipse.jpt.ui.diagrameditor.feature.ClickAddAttributeButtonFeature.create(ClickAddAttributeButtonFeature.java:54)
	at org.eclipse.graphiti.features.impl.AbstractCreateFeature.execute(AbstractCreateFeature.java:100)
	at org.eclipse.graphiti.internal.command.GenericFeatureCommandWithContext.execute(GenericFeatureCommandWithContext.java:64)
	at org.eclipse.graphiti.internal.command.GFPreparableCommand.doExecute(GFPreparableCommand.java:37)
	at org.eclipse.emf.transaction.RecordingCommand.execute(RecordingCommand.java:135)
	at org.eclipse.emf.workspace.EMFCommandOperation.doExecute(EMFCommandOperation.java:119)
	at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
	at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:511)
	at org.eclipse.emf.workspace.impl.WorkspaceCommandStackImpl.doExecute(WorkspaceCommandStackImpl.java:208)
	at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:165)
	at org.eclipse.graphiti.ui.internal.editor.GFWorkspaceCommandStackImpl.execute(GFWorkspaceCommandStackImpl.java:47)
	at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:219)
	at org.eclipse.graphiti.ui.internal.editor.GFWorkspaceCommandStackImpl.execute(GFWorkspaceCommandStackImpl.java:39)
	at org.eclipse.graphiti.internal.command.CommandExec.executeCommand(CommandExec.java:74)
	at org.eclipse.graphiti.tb.AbstractContextEntry.execute(AbstractContextEntry.java:67)
	at org.eclipse.graphiti.ui.internal.command.ContextEntryCommand.execute(ContextEntryCommand.java:35)
	at org.eclipse.gef.commands.CommandStack.execute(CommandStack.java:197)
	at org.eclipse.graphiti.ui.internal.contextbuttons.ContextButton.actionPerformed(ContextButton.java:626)
	at org.eclipse.draw2d.Clickable.fireActionPerformed(Clickable.java:206)
	at org.eclipse.draw2d.Clickable$1.actionPerformed(Clickable.java:175)
	at org.eclipse.draw2d.ButtonModel.fireActionPerformed(ButtonModel.java:140)
	at org.eclipse.draw2d.ButtonModel$DefaultFiringBehavior.released(ButtonModel.java:506)
	at org.eclipse.draw2d.ButtonModel.fireReleased(ButtonModel.java:179)
	at org.eclipse.draw2d.ButtonModel.setPressed(ButtonModel.java:466)
	at org.eclipse.draw2d.ClickableEventHandler.mouseReleased(ClickableEventHandler.java:92)
	at org.eclipse.draw2d.Figure.handleMouseReleased(Figure.java:944)
	at org.eclipse.graphiti.ui.internal.contextbuttons.ContextButton.handleMouseReleased(ContextButton.java:538)
	at org.eclipse.draw2d.SWTEventDispatcher.dispatchMouseReleased(SWTEventDispatcher.java:268)
	at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouseReleased(DomainEventDispatcher.java:374)
	at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(LightweightSystem.java:548)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:213)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	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:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
Comment 1 Petya Sabeva CLA 2010-09-10 04:00:09 EDT
I am using the same eclipse build (20100617-1415) with the latest succesful build of the JPA Diagram Editor (https://hudson.eclipse.org/hudson/view/WTP/job/cbi-wtp.inc-jpaeditor/lastSuccessfulBuild/artifact/targetPlatform/) and everything works as it is expected...
Comment 2 Stefan Dimov CLA 2010-09-10 05:29:13 EDT
I can't reproduce it with the latest build either ...
Comment 3 Tuukka Mustonen CLA 2010-09-10 10:54:26 EDT
I suppose the cause for this bug was the same as for https://bugs.eclipse.org/bugs/show_bug.cgi?id=323893. What it was, I have no idea.
Comment 4 Stefan Dimov CLA 2010-09-10 12:09:04 EDT
Doesn't really matter ... until it starts reproducing again :)