valb3r / flowable-bpmn-intellij-plugin

Flowable, Activiti, Camunda BPMN engines process editor plugin for IntelliJ. Pure Kotlin (and some Java)
https://plugins.jetbrains.com/plugin/14318-flowable-bpmn-visualizer
MIT License
161 stars 33 forks source link

Cannot generate XML code, IntelliJ reports an error. #346

Closed wangwhQAQ closed 1 year ago

wangwhQAQ commented 1 year ago

Describe the bug I encountered an error when using the Flowable BPMN visualizer plugin for the first time. I created a new bpmn 2.0 file and opened the diagram to prepare for drawing the process flow. However, no matter what operation I performed (such as creating a start event), no code was generated on the left side, and IntelliJ reported an error.

To Reproduce Steps to reproduce the behavior:

  1. created a new bpmn 2.0 file
  2. view bpnm (flowable) diagram
  3. start evens --- start event
  4. See error

BPMN definition <?xml version="1.0" encoding="UTF-8"?> <definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:flowable="http://flowable.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.flowable.org/processdef">

<bpmndi:BPMNDiagram id="BPMNDiagram_wwh_test3">
    <bpmndi:BPMNPlane bpmnElement="wwh_test3" id="BPMNPlane_wwh_test3">
    </bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>

Expected behavior As mentioned above, no XML code can be generated by any operation, and IntelliJ will report an error.

Screenshots I have put the specific error message in the "Additional context" section. image

IntelliJ version (please complete the following information):

Additional context The following is the detailed content of the error reported by IntelliJ. org.dom4j.DocumentException: class org.dom4j.DocumentFactory cannot be cast to class org.dom4j.DocumentFactory (org.dom4j.DocumentFactory is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @1128acf3; org.dom4j.DocumentFactory is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @609e2eab) Nested exception: class org.dom4j.DocumentFactory cannot be cast to class org.dom4j.DocumentFactory (org.dom4j.DocumentFactory is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @1128acf3; org.dom4j.DocumentFactory is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @609e2eab) at org.dom4j.io.SAXReader.read(SAXReader.java:468) at org.dom4j.io.SAXReader.read(SAXReader.java:329) at com.valb3r.bpmn.intellij.plugin.bpmn.parser.core.BaseBpmnParser.update(BaseBpmnParser.kt:99) at com.valb3r.bpmn.intellij.plugin.core.events.IntelliJFileCommitter.executeCommitAndGetHash$lambda$0(ProcessModelUpdateEvents.kt:37) at com.intellij.openapi.command.WriteCommandAction.lambda$runWriteCommandAction$4(WriteCommandAction.java:362) at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.lambda$doRunWriteCommandAction$1(WriteCommandAction.java:150) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:955) at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.lambda$doRunWriteCommandAction$2(WriteCommandAction.java:148) at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:219) at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:184) at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.doRunWriteCommandAction(WriteCommandAction.java:157) at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.run(WriteCommandAction.java:124) at com.intellij.openapi.command.WriteCommandAction.runWriteCommandAction(WriteCommandAction.java:362) at com.intellij.openapi.command.WriteCommandAction.runWriteCommandAction(WriteCommandAction.java:350) at com.valb3r.bpmn.intellij.plugin.core.events.IntelliJFileCommitter.executeCommitAndGetHash(ProcessModelUpdateEvents.kt:36) at com.valb3r.bpmn.intellij.plugin.core.events.ProcessModelUpdateEvents.commitToFile(ProcessModelUpdateEvents.kt:123) at com.valb3r.bpmn.intellij.plugin.core.events.ProcessModelUpdateEvents.addObjectEvent(ProcessModelUpdateEvents.kt:217) at ShapeCreator.actionPerformed(CommonCanvasPopupMenuProvider.kt:40) at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972) at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313) at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405) at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262) at java.desktop/javax.swing.AbstractButton.doClick(AbstractButton.java:374) at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1028) at java.desktop/com.apple.laf.AquaMenuItemUI.doClick(AquaMenuItemUI.java:157) at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1072) at java.desktop/java.awt.Component.processMouseEvent(Component.java:6648) at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3392) at java.desktop/java.awt.Component.processEvent(Component.java:6413) at java.desktop/java.awt.Container.processEvent(Container.java:2266) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5022) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4854) at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948) at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575) at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310) at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2802) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4854) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:730) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:724) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:754) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:752) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:751) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:909) at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:831) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:753) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$5(IdeEventQueue.java:437) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:774) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:436) at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:113) at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:615) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:434) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:813) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:480) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92) Nested exception: java.lang.ClassCastException: class org.dom4j.DocumentFactory cannot be cast to class org.dom4j.DocumentFactory (org.dom4j.DocumentFactory is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @1128acf3; org.dom4j.DocumentFactory is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @609e2eab) at org.dom4j.DocumentFactory.getInstance(DocumentFactory.java:92) at org.dom4j.io.SAXReader.getDocumentFactory(SAXReader.java:629) at org.dom4j.io.SAXReader.createContentHandler(SAXReader.java:953) at org.dom4j.io.SAXReader.read(SAXReader.java:433) at org.dom4j.io.SAXReader.read(SAXReader.java:329) at com.valb3r.bpmn.intellij.plugin.bpmn.parser.core.BaseBpmnParser.update(BaseBpmnParser.kt:99) at com.valb3r.bpmn.intellij.plugin.core.events.IntelliJFileCommitter.executeCommitAndGetHash$lambda$0(ProcessModelUpdateEvents.kt:37) at com.intellij.openapi.command.WriteCommandAction.lambda$runWriteCommandAction$4(WriteCommandAction.java:362) at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.lambda$doRunWriteCommandAction$1(WriteCommandAction.java:150) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:955) at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.lambda$doRunWriteCommandAction$2(WriteCommandAction.java:148) at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:219) at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:184) at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.doRunWriteCommandAction(WriteCommandAction.java:157) at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.run(WriteCommandAction.java:124) at com.intellij.openapi.command.WriteCommandAction.runWriteCommandAction(WriteCommandAction.java:362) at com.intellij.openapi.command.WriteCommandAction.runWriteCommandAction(WriteCommandAction.java:350) at com.valb3r.bpmn.intellij.plugin.core.events.IntelliJFileCommitter.executeCommitAndGetHash(ProcessModelUpdateEvents.kt:36) at com.valb3r.bpmn.intellij.plugin.core.events.ProcessModelUpdateEvents.commitToFile(ProcessModelUpdateEvents.kt:123) at com.valb3r.bpmn.intellij.plugin.core.events.ProcessModelUpdateEvents.addObjectEvent(ProcessModelUpdateEvents.kt:217) at ShapeCreator.actionPerformed(CommonCanvasPopupMenuProvider.kt:40) at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972) at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313) at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405) at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262) at java.desktop/javax.swing.AbstractButton.doClick(AbstractButton.java:374) at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1028) at java.desktop/com.apple.laf.AquaMenuItemUI.doClick(AquaMenuItemUI.java:157) at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1072) at java.desktop/java.awt.Component.processMouseEvent(Component.java:6648) at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3392) at java.desktop/java.awt.Component.processEvent(Component.java:6413) at java.desktop/java.awt.Container.processEvent(Container.java:2266) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5022) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4854) at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948) at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575) at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310) at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2802) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4854) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:730) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:724) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:754) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:752) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:751) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:909) at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:831) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:753) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$5(IdeEventQueue.java:437) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:774) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:436) at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:113) at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:615) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:434) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:813) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:480) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

valb3r commented 1 year ago

@wangwhQAQ Thanks for the report. It looks like some class path issue conflict with other plugin. Can you please check if the issue persists on your machine if you download pristine IntelliJ without any other plugins installed?

As I can't spot issue, all works on my machine:

Screenshot 2023-05-26 at 16 42 02
wangwhQAQ commented 1 year ago

Sorry, I have found the cause of the problem. The conflict was caused by this plugin and another plugin I installed, which is Alibaba Java Coding Guidelines. This is a plugin for checking code standards.