1 2 Previous Next 18 Replies Latest reply on Oct 18, 2007 7:57 AM by bish

    jPDL Designer 3.1.0SP1 and Eclipse 3.3: ClassCastException o

    bish

      I've recently downloaded the jPDL suite for 3.2.2, but I have a problem running the designer in Eclipse.

      Specifically, I downloaded jbpm-jpdl-suite-3.2.2.zip and extracted to c:\jbpm-jpdl-3.2.2
      If the directory names are to be believed, then the designer version in the 3.2.2 suite is 3.1.0SP1. (C:\jbpm-jpdl-3.2.2\designer\eclipse\plugins\org.jbpm.gd.jpdl_3.1.0.SP1)

      Then I followed the instructions in c:\jbpm-jpdl-3.2.2\designer\readme.html and downloaded eclipse-SDK-3.3-win32.zip then ran the "ant install" target. Then I started going through the steps in the getting started doc on the wiki.

      Where the getting started guide says "double click on gpd.xml" I find the file opens in the default XML browser rather than the jBPM Process Designer. If I tell it to open with the Process Designer then I get a ClassCastException as shown in the stack-trace below (from Eclipse .log file).

      I _can_ open the processdefinition.xml file with the Process Designer, but if I right click on the nodes I don't get the correct context menu.

      I noticed someone on the Getting Started Documentation thread had the same issue but no solution was posted. Anyone else seen it or solved it?

      Cheers,
      Ian.

      !ENTRY org.eclipse.ui 4 0 2007-10-16 11:12:33.685
      !MESSAGE Unable to create editor ID org.jbpm.gd.jpdl.editor: org.jbpm.gd.jpdl.model.ProcessDefinition cannot be cast to org.jbpm.gd.common.model.GenericElement
      !STACK 0
      java.lang.ClassCastException: org.jbpm.gd.jpdl.model.ProcessDefinition cannot be cast to org.jbpm.gd.common.model.GenericElement
      at org.jbpm.gd.common.xml.GenericElementXmlAdapter.initialize(Unknown Source)
      at org.jbpm.gd.common.editor.Editor.getSemanticElement(Unknown Source)
      at org.jbpm.gd.common.editor.Editor.initSourcePage(Unknown Source)
      at org.jbpm.gd.common.editor.Editor.createPages(Unknown Source)
      at org.jbpm.gd.jpdl.editor.JpdlEditor.createPages(Unknown Source)
      at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:283)
      at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:661)
      at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:426)
      at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:592)
      at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:299)
      at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:179)
      at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:268)
      at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
      at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:400)
      at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1256)
      at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1209)
      at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1604)
      at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
      at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103)
      at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
      at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112)
      at org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:63)
      at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:217)
      at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:207)
      at org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:774)
      at org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:673)
      at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:634)
      at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2719)
      at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2633)
      at org.eclipse.ui.internal.WorkbenchPage.access$12(WorkbenchPage.java:2625)
      at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2577)
      at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
      at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2572)
      at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2556)
      at org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu.java:340)
      at org.eclipse.ui.actions.OpenWithMenu.access$0(OpenWithMenu.java:328)
      at org.eclipse.ui.actions.OpenWithMenu$3.handleEvent(OpenWithMenu.java:226)
      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)

        • 1. Re: jPDL Designer 3.1.0SP1 and Eclipse 3.3: ClassCastExcepti
          dleerob

          Remember, you cant just download eclipse 3.3, you need all the relevant plugins as well, and make sure they are the correct versions. These are mentioned in the META-INF\MANIFEST.MF file that comes with the GPD download. I also had weird errors until I downloaded all the latest plugins that were mentioned in that file.

          Here is a list of what you must download (or just look at the file mentioned above) from the Eclipse site. At least this is what I did, and it then worked perfectly:

          Name: Eclipse Drivers
          - SDK: 3.3
          - EMF: 2.3.0
          - GEF: 3.3
          - DTP: 1.5
          - WTP: 2.0

          • 2. Re: jPDL Designer 3.1.0SP1 and Eclipse 3.3: ClassCastExcepti
            dleerob

            Oh and after you have installed a fresh copy of Eclipse with all the plugins I mentioned above, don't forget to configure the Jbpm runtime in Eclipse, mentioned in the Getting Started Guide I think.

            Click: Window--> Preferences --> JBoss Jbpm --> Runtime Locations --> and add jbpm 3.2.2

            • 3. Re: jPDL Designer 3.1.0SP1 and Eclipse 3.3: ClassCastExcepti
              kukeltje

              all these other downloads are in eclipse europa afaik.

              afaik the SDK versions are not needed

              • 4. Re: jPDL Designer 3.1.0SP1 and Eclipse 3.3: ClassCastExcepti
                bhuber

                hmm ... i installed my eclipse SDK now 3 or 4 times and it was always the same like topic says

                now i take jbpm-jpdl-designer-3.0.13 and it looks fine (in the suite 3.2.2 there is the jbpm-jpdl-designer-3.1.0.sp1 or ?)

                i can open the gpd.xml file without problems

                i cant say if this was the real problem ... or if i do something else that it works now ?

                • 5. Re: jPDL Designer 3.1.0SP1 and Eclipse 3.3: ClassCastExcepti
                  bish

                  Thanks for the responses.

                  First, I tried getting all of those dependencies. That's a lot of dependencies and downloads and must be a block to any non-eclipse-guru end user. Certainly put me off. And downloading them didn't fix the problem.

                  Second, I suspect a bug in the 3.2.2 suite download, and specifically in the designer 3.1.0SP1 plugin for Eclipse, as included in the suite 3.2.2 download.

                  I set up a little project and added the ui.jar file from jbpm-jpdl-3.2.2\designer\eclipse\plugins\org.jbpm.gd.jpdl_3.1.0.SP1 to the build path then set up the following class:

                  import org.jbpm.gd.common.model.GenericElement;
                  import org.jbpm.gd.jpdl.model.ProcessDefinition;
                  
                  
                  public class Play {
                  
                   public static void main(String[] args) {
                  
                   ProcessDefinition pd = new ProcessDefinition();
                   GenericElement ge = (GenericElement)pd;
                  
                   }
                  }
                  
                  


                  It gives me the following compile error:

                  Cannot cast from ProcessDefinition to GenericElement

                  Examining the classes in the ui.jar file, ProcessDefinition doesn't extend GenericElement (though they do share a common parent in org.jbpm.gd.common.model.AbstractSemanticElement) so unless I've gone soft in the head (entirely possible) or am missing some other vital piece of info (also entirely possible) I don't see how a cast from ProcessDefinition to GenericElement is ever going to work.

                  What does everyone else think. Am I going mad here?

                  Cheers,
                  Ian.



                  • 6. Re: jPDL Designer 3.1.0SP1 and Eclipse 3.3: ClassCastExcepti
                    bish

                    Yep - definitely a bug. I've checked out the code now to confirm it. The code is casting to GenericElement via the SemanticElement interface, but our friend ProcessDefinition can't be cast that way as it doesn't extend GenericElement. I've updated Play to show how it's blowing up. (This reflects the code pattern used in GenericElementXmlAdapter).

                    import org.jbpm.gd.common.model.GenericElement;
                    import org.jbpm.gd.common.model.SemanticElement;
                    import org.jbpm.gd.jpdl.model.ProcessDefinition;
                    
                    
                    public class Play {
                    
                     public static void main(String[] args) {
                    
                     ProcessDefinition pd = new ProcessDefinition();
                     //GenericElement ge = (GenericElement)pd;
                    
                    
                     SemanticElement se = (SemanticElement)pd;
                     GenericElement ge = (GenericElement)se;
                     }
                    }
                    


                    This compiles happily and gives a runtime error...

                    Exception in thread "main" java.lang.ClassCastException: org.jbpm.gd.jpdl.model.ProcessDefinition cannot be cast to org.jbpm.gd.common.model.GenericElement
                    at Play.main(Play.java:15)


                    Case proved I think! Now, how do I raise a bug report?!

                    (I'm still not clear how some of you guys did get it working. Maybe you're using a different version of the designer plugin in eclipse, or maybe this has only sneaked into the windows version somehow)?

                    Cheers,
                    Ian.


                    • 7. Re: jPDL Designer 3.1.0SP1 and Eclipse 3.3: ClassCastExcepti
                      dleerob

                      Hmmm...weird, mine worked fine. Did you guys download the suite, and therefore using the GPD from that download?

                      I only downloaded the GPD (jbpm-jpdl-designer-3.1.0.sp1.zip), and not the suite, and that one works for me.

                      • 8. Re: jPDL Designer 3.1.0SP1 and Eclipse 3.3: ClassCastExcepti
                        dleerob

                        Anyway here is the list of files I downloaded, in order to get it to work:

                        From JBoss:
                        - jbpm-jpdl-designer-3.1.0.sp1.zip (7,927 KB)

                        From Eclipse:
                        - eclipse-SDK-3.3-win32.zip (144,176KB)
                        - dtp_1.5_20070704.zip (8,680KB)
                        - emf-sdo-xsd-SDK-2.3.1.zip (26,042KB)
                        - GEF-SDK-3.3.1.zip (6,311KB)
                        - wtp-R-2.0-200706260303.zip (37,715KB)

                        • 9. Re: jPDL Designer 3.1.0SP1 and Eclipse 3.3: ClassCastExcepti
                          bhuber

                           

                          Anyway here is the list of files I downloaded, in order to get it to work:

                          From JBoss:
                          - jbpm-jpdl-designer-3.1.0.sp1.zip (7,927 KB)

                          From Eclipse:
                          - eclipse-SDK-3.3-win32.zip (144,176KB)
                          - dtp_1.5_20070704.zip (8,680KB)
                          - emf-sdo-xsd-SDK-2.3.1.zip (26,042KB)
                          - GEF-SDK-3.3.1.zip (6,311KB)
                          - wtp-R-2.0-200706260303.zip (37,715KB)


                          i use all the files in your list, installed a new eclipse and with both i got the same problem
                          doesnt matter if i take designer from suite or designer from zip file

                          • 10. Re: jPDL Designer 3.1.0SP1 and Eclipse 3.3: ClassCastExcepti
                            bish

                            Quick thought (that I don't have time to check at the moment, but will this evening, if no-one else has done it by then): maybe the xml in the example is different.
                            I was trying to open the websales example that comes with the suite. Is that example also in the designer-only download, and is it the same as the version in the suite download?

                            Cheers,
                            Ian.

                            • 11. Re: jPDL Designer 3.1.0SP1 and Eclipse 3.3: ClassCastExcepti
                              bish
                              • 12. Re: jPDL Designer 3.1.0SP1 and Eclipse 3.3: ClassCastExcepti
                                dleerob

                                I did notice in your JIRA issue that you are using Java 1.6.0_02. Not sure if that would have anything to do with it, seeing that you found the code that seems to cause the problem.

                                But anyway, incase you want to try it, I'm using Java 1.5.0_06 with my Eclipse.

                                • 13. Re: jPDL Designer 3.1.0SP1 and Eclipse 3.3: ClassCastExcepti
                                  koen.aers

                                  I am running a jBPM training at the moment where 11 guys are using a plain Eclipse 3.3 installed over the jBPM-jPDL suite version 3.2.2 (including the designer version 3.1.0 SP1). No one has had any problems whatsoever...
                                  Can you guys doublecheck once again? Remember that you shouldn't try to open gpd.xml with the designer but rather processdefinition.xml.

                                  Regards,
                                  Koen

                                  • 14. Re: jPDL Designer 3.1.0SP1 and Eclipse 3.3: ClassCastExcepti
                                    bish

                                    Ok - opening gpd.xml instead of processdefinition.xml will teach me not to trust documentation. I ought to know better at my age. I was right about that cast though!

                                    More seriously, it still doesn't (appear) to work for me, though perhaps my expectations are wrong. I can open processdefinition.xml ok, but when I right click on the node (as per the getting started doc) I don't see a context menu that includes "Add task" or "Add action", nor do I have a "Swimlanes" tab as shown in fig 22 of http://wiki.jboss.org/wiki/Wiki.jsp?page=JbpmGettingStarted.

                                    Should I see those things, or is the document incorrect?

                                    Cheers,
                                    Ian.

                                    1 2 Previous Next