cancel
Showing results for 
Search instead for 
Did you mean: 

Eclipse plug-in unable to instantiate class 'org.activiti.designer.eclipse.editor.ActivitiDiagramEditor'

peilers
Champ in-the-making
Champ in-the-making
I have just build the Activiti Designer plug-in from the source on Github using the following steps:
1. Import the source from the Github clone uri into a Git project
2. Update the pom.xml in org.activiti.designer.parent to reference luna instead of juno
3. Navigate to the local git repository org.activiti.designer.parent directory and perform the following two maven commands:
   mvn clean eclipse:clean
   mvn eclipse:eclipse
4. Refresh all projects in Eclipse
5. Import each of the projects from the local git repository into the Eclipse workspace so that they are each top level projects, importing the org.activiti.designer.libs project first.
6. Import the maven parent project into the Eclipse workspace
7. Refresh and clean all projects–there are no compilation errors
So far so good….

8. Select the plugin.xml from the org.activiti.designer.eclipse project and select Launch an Eclipse Application

I am able to create an Activiti Project but when selecting File/New/Activiti/Activiti Diagram and providing values in the wizard the following error is presented. (I have verified that the activiti-bpmn-model-5.16.2-SNAPSHOT.jar does indeed exist in the org.activiti.designer.libs project.)

org.eclipse.core.runtime.CoreException: Plug-in "org.activiti.designer.eclipse" was unable to instantiate class "org.activiti.designer.eclipse.editor.ActivitiDiagramEditor".
   at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
   at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:188)
   at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
   at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
   at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
   at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:285)
   at org.eclipse.ui.internal.registry.EditorDescriptor.createEditor(EditorDescriptor.java:235)
   at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:349)
   at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPart(CompatibilityPart.java:265)
   at org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.createPart(CompatibilityEditor.java:63)
   at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:303)
   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.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
   at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:888)
   at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:869)
   at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:120)
   at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:337)
   at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:258)
   at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
   at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:104)
   at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:73)
   at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:55)
   at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:127)
   at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:983)
   at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:662)
   at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:766)
   at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:737)
   at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:731)
   at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
   at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:715)
   at org.eclipse.e4.ui.internal.workbench.PartServiceImpl$1.handleEvent(PartServiceImpl.java:94)
   at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:40)
   at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:187)
   at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:156)
   at org.eclipse.swt.widgets.Display.syncExec(Display.java:4734)
   at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:218)
   at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:36)
   at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)
   at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
   at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
   at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
   at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
   at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
   at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
   at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
   at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:81)
   at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:59)
   at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
   at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:171)
   at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:488)
   at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:454)
   at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:694)
   at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.bringToTop(PartServiceImpl.java:387)
   at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1134)
   at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:3210)
   at org.eclipse.ui.internal.WorkbenchPage.access$23(WorkbenchPage.java:3125)
   at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:3107)
   at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
   at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3102)
   at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3066)
   at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3047)
   at org.eclipse.ui.ide.IDE.openEditor(IDE.java:329)
   at org.activiti.designer.eclipse.editor.Bpmn2DiagramCreator$1.run(Bpmn2DiagramCreator.java:101)
   at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
   at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
   at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764)
   at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:175)
   at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:390)
   at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1059)
   at org.activiti.designer.eclipse.ui.wizard.diagram.CreateDefaultActivitiDiagramWizard.performFinish(CreateDefaultActivitiDiagramWizard.java:134)
   at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:853)
   at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:438)
   at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:619)
   at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
   at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
   at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
   at org.eclipse.jface.window.Window.runEventLoop(Window.java:832)
   at org.eclipse.jface.window.Window.open(Window.java:808)
   at org.eclipse.ui.internal.handlers.WizardHandler$New.executeHandler(WizardHandler.java:269)
   at org.eclipse.ui.internal.handlers.WizardHandler.execute(WizardHandler.java:290)
   at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:294)
   at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
   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.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
   at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247)
   at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:229)
   at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
   at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:149)
   at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499)
   at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
   at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
   at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:343)
   at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:159)
   at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
   at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
   at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:420)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
   at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
   at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
   at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
   at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
   at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
   at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
   at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
   at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
   at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
   at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
   at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
   at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
   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:648)
   at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
   at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
   at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Caused by: java.lang.NoClassDefFoundError: org/activiti/bpmn/model/BaseElement
   at java.lang.Class.getDeclaredConstructors0(Native Method)
   at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
   at java.lang.Class.getConstructor0(Unknown Source)
   at java.lang.Class.newInstance(Unknown Source)
   at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:184)
   … 131 more
Caused by: java.lang.ClassNotFoundException: org.activiti.bpmn.model.BaseElement cannot be found by org.activiti.designer.eclipse_5.16.0.SNAPSHOT
   at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:432)
   at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:345)
   at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:337)
   at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   … 136 more

How do I resolve this?
7 REPLIES 7

peilers
Champ in-the-making
Champ in-the-making
I have also attached the .classpath file for org.activiti.designer.libs (there is no ./ entry and all bpmn jars seem to be there). I also have the latest versions of the EMF and Graphiti plug-ins installed.

peilers
Champ in-the-making
Champ in-the-making
RESOLUTION:
For the benefit of others (since there are several permutations of these instructions available across Codehaus and the forum), these are the steps that I performed to result in a successful build of the Activiti Designer:
1. Start with clean workspace with EMF and Graphiti installed and up to date.
2. Import the Activiti Designer source into the workspace via:
     File/Import/Git/Projects from Git. Select "Clone URI" and provide: https://github.com/Activiti/Activiti-Designer.git as the URI.
     Select the "master" branch. Select "Clone submodules".
     Selected "Import as general project" (Default value "Import existing projects" found no projects)
3. View the pom.xml in the parent Maven project –> it references Eclipse Juno version
     Updated references from Juno to Luna
4. Updated manifest.mf (in org.activiti.designer.libs) to remove the ".,/" entry
5. Went to the Runtime tab for manifest file (in org.activiti.designer.libs) and Added (3) jar files as follows:
     org.activiti.designer.libs/activiti-bpmn-converter-5.16.2-SNAPSHOT.jar
     org.activiti.designer.libs/activiti-bpmn-layout-5.16.2-SNAPSHOT.jar
     org.activiti.designer.libs/activiti-bpmn-model-5.16.2-SNAPSHOT.jar
6. Executed >mvn clean eclipse:clean –> BUILD SUCCESS
7. Executed >mvn eclipse:eclipse –> BUILD SUCCESS
8. File/Import/Existing Projects into Workspace (Search for nested projects from local repository into workspace)–select each of the projects one-by-one so that they create top level projects. NOTE: Import the libs project first.
9. File/Import/Maven/Existing Maven Project
10. Repeat #5 above (unknown why this is required)–add jar files again to org.activiti.designer.libs in the Classpath pane of the manifest.mf Runtime tab:
     org.activiti.designer.libs/activiti-bpmn-converter-5.16.2-SNAPSHOT.jar
     org.activiti.designer.libs/activiti-bpmn-layout-5.16.2-SNAPSHOT.jar
     org.activiti.designer.libs/activiti-bpmn-model-5.16.2-SNAPSHOT.jar
11. Selected all top level Activiti Designer projects and performed File/Refresh
12. Selected Project/Clean for all projects (at this point there are no project level errors…progress)
13. Selected the plugin.xml (overview tab) for org.activiti.designer.eclipse and chose to "Launch Eclipse Application" to verify that creating an Activiti Diagram succeeds without errors.

jbarrez
Star Contributor
Star Contributor
Thanks for sharing this!

peilers
Champ in-the-making
Champ in-the-making
By the way, I ended up adding all of the JARs from the libs project to the Classpath list via the Manifest.mf editor (not just the 3 mentioned in my post above) since I continued to get errors as I put the Designer plug-in through its paces.

Also, there is a step missing in setting up the initial Eclipse environment as follows from the Codehaus instructions:
"In order to have BPMN code completion and validation, import BPMN's XML Schemas from activiti-engine/src/main/resources/org/activiti/impl/bpmn/parser into the Eclipse XML Catalog, which can be found in Preferences –> XML –> XMLCatalog."

peilers
Champ in-the-making
Champ in-the-making
So the final instruction steps would now be:

1. Start with clean workspace with EMF and Graphiti installed and up to date.

2. Per the instructions on Codehaus, "In order to have BPMN code completion and validation, import BPMN's XML Schemas from activiti-engine/src/main/resources/org/activiti/impl/bpmn/parser into the Eclipse XML Catalog, which can be found in Preferences –> XML –> XMLCatalog." (Created the files in the BPAWorks directory)

3. Import the Activiti Designer source into the workspace via:
File/Import/Git/Projects from Git. Select "Clone URI" and provide: https://github.com/Activiti/Activiti-Designer.git as the URI.
Select the "master" branch. Select "Clone submodules".
Selected "Import as general project" (Default value "Import existing projects" found no projects)

4. View the pom.xml in the parent Maven project –> it references Eclipse Juno version
Update references from Juno to Luna (or whatever version of Eclipse you are using).

5. Update build.properties for the manifest.mf (in org.activiti.designer.libs) to remove the ".,/" entry

6. Go to the Runtime tab for the manifest file (in org.activiti.designer.libs) and Add all jar files to the Classpath list.

7. In a console window, navigate to the local Git repository and to the org.activiti.designer.parent directory. Execute >mvn clean eclipse:clean –> BUILD SUCCESS

8. Still in the org.activiti.designer.parent directory, execute >mvn eclipse:eclipse –> BUILD SUCCESS

9. File/Import/Existing Projects into Workspace (Search for nested projects from local repository into workspace)–Select each of the projects one-by-one so that they create top level projects. NOTE: Import the libs project first.

10. File/Import/Maven/Existing Maven Project to import the org.activiti.designer.parent project

11. Repeat #5 above (unknown why this is required)–add all jar files again to org.activiti.designer.libs in the Classpath pane of the manifest.mf Runtime tab.

11. Selected all top level Activiti Designer projects and performed File/Refresh

12. Selected Project/Clean for all projects

Note that depending on the version of the Graphiti plug-in you may need to change the reference to the Graphiti feature within the org.activiti.designer.feature project (via the feature.xml editor).

dbmalkovsky
Champ in-the-making
Champ in-the-making
I've been working on a similar issue and have made some changes so you don't have to modify the parent pom for different eclipse versions but rather specify a profile to Maven that defines the appropriate paths for the repositories, etc.

The problem that I am left with is not understanding why the MANIFEST.MF file is re-written by the <code>mvn eclipse:eclipse</code> process.  Each MANIFEST.MF file is change in all the sub-projects.  In the org.activiti.designer.libs project it removes the <code>activiti-bpmn-……jars</code> from the original MANIFEST.MF file as part of the re-rewrite.  The jars exist in both the original MANIFEST.MF and the build.properties files.  The classes in those jars are referenced in  the Export-Package list.  I am further confused as to why the <code>activiti-simple-workflow-alfresco-5.16.2-SNAPSHOT.jar</code> is retained in the MANIFEST.MF file.  I've played around with different Export lists, build.properties values, etc. but cannot seem to find a pattern.  FWIW, I've tried with and without step #5 above.  I've run Maven with <code>–debug</code> and examined the output without any further insight into the issue.
I hope that someone who understands Maven and the MANIFEST semantics better than I can explain why the necessary Activiti jars are removed from the classpath in the MANIFEST.MF during the <code>eclipse:eclipse</code> processing so that the manual step (#6) to add them back in is no longer required.

Thank you in advance.

chockyc91
Champ in-the-making
Champ in-the-making
Dear peiler,
I have tried the above steps as informed by you. But I couldn't open the activiti diagram editor.

Kindly help.
Thanks in Advance.