1
votes

When trying to create an MUnit test in Anypoint Studio by right clicking on a flow then selecting 'Create new text.xml Suite' I see the following dialog appear:

Screen shot of dialog that appears after trying to create a test suite

This has the disadvantage of not offering any stack trace to follow, however, looking in the error log i can see the following stack trace.

java.lang.NullPointerException
at org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:1003)
at org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:972)
at org.apache.velocity.runtime.RuntimeSingleton.parse(RuntimeSingleton.java:265)
at org.apache.velocity.app.Velocity.evaluate(Velocity.java:274)
at org.mule.tooling.ui.contribution.munit.MunitResourceUtils.createXMLConfigurationFromTemplate(MunitResourceUtils.java:214)
at org.mule.tooling.ui.contribution.munit.actions.CreateTestSuiteAction.createMunitFile(CreateTestSuiteAction.java:86)
at org.mule.tooling.ui.contribution.munit.actions.CreateTestSuiteAction.createAndOpenMunitFile(CreateTestSuiteAction.java:73)
at org.mule.tooling.ui.contribution.munit.actions.CreateTestSuiteAction.doRun(CreateTestSuiteAction.java:59)
at org.mule.tooling.ui.contribution.munit.actions.AbstractFlowEditorMunitAction.run(AbstractFlowEditorMunitAction.java:105)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
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: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)

I am using MUnit version 1.4.3, Anypoint Studio version 6.2.5 and java 1.8.0_131

Has anyone else faced this who is able to suggest a solution?

3

3 Answers

1
votes

Could you please verify that you have maven correctly install and working ? Also, can you check that you have munit plugin install in Anypoint Studio ? Check Help Menu >> installation details >> search for munit anypoint studio plugin

1
votes

Go to Anypoint Navigation bar

  ->Help
  ->Install New Softwares
  ->Work with - Munit Update Sites
  ->Install All updates

It will work after that.

1
votes

I've have similar issues in the past. My solution as suggested by MuleSoft support was to:

Please, try to create a new workspace, since the workspaces sometimes may get corrupted and produce some weird errors.