WSO2工具(eclipse)错误未处理的事件循环异常:带有groovy脚本的脚本调解器

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了WSO2工具(eclipse)错误未处理的事件循环异常:带有groovy脚本的脚本调解器相关的知识,希望对你有一定的参考价值。

运行WSO2 EI 6.1.1我想在eclipse中使用groovy添加一个脚本调解器,但每当我这样做时,Eclipse会出现Unhandled事件循环异常(如果我通过图编辑器添加)或** Save Failed - > org / codehaus / groovy / control / CompilerConfiguration **(如果我在源视图中添加)。

使用以下序列定义复制很容易:

  <?xml version="1.0" encoding="UTF-8"?>
    <sequence name="test" trace="disable"   xmlns="http://ws.apache.org/ns/synapse">
        <script language="groovy"><![CDATA[def  version = GroovySystem.version
    mc.setProperty("groovyVersion",version);]]></script>
    </sequence>

请注意,如果我在ESB Web控制台中编辑序列并在其中添加介体和groovy代码,那么它可以正常工作 - 因此ESB配置文件上的Groovy运行时本身没有问题,但是它使得维护碳应用程序非常笨拙,因为我找不到任何方法将这些groovy脚本调解器打包到我的应用程序中,其余的。来自eclipse的包。因为eclipse只是拒绝保存它们!

“保存失败”的异常堆栈跟踪:

eclipse.buildId=4.5.2.M20160212-1500
java.version=1.8.0_121
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product

org.eclipse.ui
Warning
Thu Dec 28 15:29:42 GMT 2017
Save Failed

java.lang.LinkageError: org/codehaus/groovy/control/CompilerConfiguration
    at groovy.lang.GroovyClassLoader.<init>(GroovyClassLoader.java:125)
    at groovy.lang.GroovyClassLoader.<init>(GroovyClassLoader.java:135)
    at com.sun.script.groovy.GroovyScriptEngine.<init>(GroovyScriptEngine.java:69)
    at com.sun.script.groovy.GroovyScriptEngineFactory.getScriptEngine(GroovyScriptEngineFactory.java:90)
    at javax.script.ScriptEngineManager.getEngineByExtension(Unknown Source)
    at org.apache.synapse.mediators.bsf.ScriptMediator.initScriptEngine(ScriptMediator.java:533)
    at org.apache.synapse.mediators.bsf.ScriptMediator.initInlineScript(ScriptMediator.java:380)
    at org.apache.synapse.mediators.bsf.ScriptMediator.<init>(ScriptMediator.java:169)
    at org.apache.synapse.mediators.bsf.ScriptMediatorFactory.createSpecificMediator(ScriptMediatorFactory.java:105)
    at org.apache.synapse.config.xml.AbstractMediatorFactory.createMediator(AbstractMediatorFactory.java:94)
    at org.apache.synapse.config.xml.MediatorFactoryFinder.getMediator(MediatorFactoryFinder.java:224)
    at org.apache.synapse.config.xml.AbstractListMediatorFactory.addChildren(AbstractListMediatorFactory.java:46)
    at org.apache.synapse.config.xml.SequenceMediatorFactory.createSpecificMediator(SequenceMediatorFactory.java:87)
    at org.wso2.developerstudio.eclipse.gmf.esb.diagram.custom.deserializer.Deserializer.getArtifacts(Deserializer.java:346)
    at org.wso2.developerstudio.eclipse.gmf.esb.diagram.custom.deserializer.Deserializer.isValidSynapseConfig(Deserializer.java:435)
    at org.wso2.developerstudio.eclipse.gmf.esb.diagram.part.EsbMultiPageEditor.doSave(EsbMultiPageEditor.java:999)
    at org.eclipse.ui.internal.SaveableHelper$2.run(SaveableHelper.java:156)
    at org.eclipse.ui.internal.SaveableHelper$5.run(SaveableHelper.java:285)
    at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:463)
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:371)
    at org.eclipse.ui.internal.WorkbenchWindow$14.run(WorkbenchWindow.java:2181)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2177)
    at org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:293)
    at org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:271)
    at org.eclipse.ui.internal.SaveableHelper.savePart(SaveableHelper.java:161)
    at org.eclipse.ui.internal.WorkbenchPage.saveSaveable(WorkbenchPage.java:3892)
    at org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPage.java:3906)
    at org.eclipse.ui.internal.handlers.SaveHandler.execute(SaveHandler.java:54)
    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:295)
    at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
    at sun.reflect.GeneratedMethodAccessor59.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:56)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:252)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:234)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
    at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
    at org.eclipse.core.commands.Command.executeWithChecks(Command.java:493)
    at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:486)
    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:160)
    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$6.handleEvent(ActionContributionItem.java:462)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4180)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3769)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:827)
    at org.eclipse.jface.window.Window.open(Window.java:803)
    at org.eclipse.ui.internal.views.log.EventDetailsDialog.open(EventDetailsDialog.java:181)
    at org.eclipse.ui.internal.views.log.EventDetailsDialogAction.run(EventDetailsDialogAction.java:98)
    at org.eclipse.ui.internal.views.log.LogView$15.doubleClick(LogView.java:546)
    at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:832)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173)
    at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:829)
    at org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1470)
    at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1263)
    at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:252)
    at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:249)
    at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:311)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4180)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3769)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:694)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:606)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)
    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:669)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1515)

“未处理的事件循环异常”的异常堆栈跟踪:

eclipse.buildId=4.5.2.M20160212-1500
java.version=1.8.0_121
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product

org.eclipse.ui
Error
Thu Dec 28 14:58:46 GMT 2017
Unhandled event loop exception

org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
    at org.eclipse.swt.SWT.error(SWT.java:4491)
    at org.eclipse.swt.SWT.error(SWT.java:4406)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:138)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4155)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3772)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:694)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:606)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)
    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:669)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
Caused by: java.lang.NullPointerException
    at org.wso2.developerstudio.eclipse.gmf.esb.diagram.custom.layout.XYRepossition.resizeSequences(XYRepossition.java:591)
    at org.wso2.developerstudio.eclipse.gmf.esb.diagram.custom.layout.XYRepossition.resizeEditpart(XYRepossition.java:141)
    at org.wso2.developerstudio.eclipse.gmf.esb.diagram.custom.layout.XYRepossition.resizeContainers(XYRepossition.java:129)
    at org.wso2.developerstudio.eclipse.gmf.esb.diagram.custom.AbstractMediator$1.run(AbstractMediator.java:305)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
    ... 23 more
答案

更新WSO2工具包修复此问题,以便从以下软件站点添加

https://product-dist.wso2.com/p2/developer-studio-kernel/4.1.0/ei-tools/releases/1.1.0/

我后来遇到了关于groovy版本的classpath中的冲突的问题,由于@daggett提供的提示,我能够解决这个问题

以上是关于WSO2工具(eclipse)错误未处理的事件循环异常:带有groovy脚本的脚本调解器的主要内容,如果未能解决你的问题,请参考以下文章

Eclipse 堆空间(内存不足错误)

当我尝试添加第二个活动时未处理的事件循环异常

WSO2中的事件格式无效

Eclipse JEE Mars 2 配置 WSO2 ESB 5.0.0 环境

为啥错误事件未处理?

如何修复“未处理的运行时错误类型错误:事件未定义”