Search code examples
javajunitguiceetlsnaplogic

Getting java.lang.NoSuchMethodError while setting up JUnits for SnapLogic custom snaps


I want to create my own snap in SnapLogic .

I downloaded the sample project by running the following:

$ mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate -DarchetypeCatalog=http://maven.clouddev.snaplogic.com:8080/nexus/content/repositories/master/

But, when I build this project I get the following error that fails in the JUnit:

C:\Java\jdk1.8.0_141\bin\java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:53596,suspend=y,server=n -ea -Didea.test.cyclic.buffer.size=1048576 -Dfile.encoding=UTF-8 -classpath C:\Users\kqvx285\AppData\Local\Temp\classpath.jar com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 -junit4 com.snaplogic.snaps.TwoInputsTwoOutputsTest
Connected to the target VM, address: '127.0.0.1:53596', transport: 'socket'

java.lang.NoSuchMethodError: com.snaplogic.snap.api.OutputViewsImpl.add(Lcom/snaplogic/snap/view/OutputView;)

V

at com.snaplogic.snap.test.harness.TestResultImpl.addOutputView(TestResultImpl.java:116)
at com.snaplogic.snap.test.harness.TestSetupImpl.addOutputView(TestSetupImpl.java:393)
at com.snaplogic.snap.test.harness.SnapExecutor.createOutputViewFor(SnapExecutor.java:845)
at com.snaplogic.snap.test.harness.SnapExecutor.evaluate(SnapExecutor.java:426)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

Disconnected from the target VM, address: '127.0.0.1:53596', transport: 'socket'

Process finished with exit code -1

Solution

  • This may be related to an out-of-date dependency. Could you try removing the com/snaplogic folder in your local Maven repository and then rebuilding?

    e.g. rm -rf ~/.m2/repository/com/snaplogic/