Test Failure

Hi I have written test classes

@RunWith(FeaturesRunner.class) @Features({PlatformFeature.class,AutomationFeature.class}) @Deploy(“org.nuxeo.ecm.core.schema”) @Deploy(“org.nuxeo.ecm.actions”) @Deploy(“org.nuxeo.ecm.automation.core”) @Deploy(“org.nuxeo.ecm.automation.features”) @Deploy(“org.nuxeo.ecm.automation.server”) @Deploy(“org.nuxeo.ecm.automation.io”) public class TestMetadata{ //code is available }

But while running i am getting java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor

at org.nuxeo.runtime.test.runner.FeaturesRunner.computeTestMethods(FeaturesRunner.java:144)
at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:190)
at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:128)
at org.junit.runners.ParentRunner.validate(ParentRunner.java:416)
at org.junit.runners.ParentRunner.<init>(ParentRunner.java:84)
at org.junit.runners.BlockJUnit4ClassRunner.<init>(BlockJUnit4ClassRunner.java:65)
at org.nuxeo.runtime.test.runner.FeaturesRunner.<init>(FeaturesRunner.java:73)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:49)
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)

Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.ClassVisitor

at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
... 21 more

I am already having asm jar in external librariries . i am running project in intelliJ

0 votes

1 answers

180 views

ANSWER



The proper asm version should automatically be added via Maven. The problem COULD be you somehow referenced a different one than expected.

What happens when you run your tests from the command line? Try mvn clean install on the root folder of your project. If you don't have the problem there, it must be your IDE's project configuration. Just make sure you don't have anything that would bring its own asm in your pom.xml file - directly or as a transitive dependency. If you have some custom dependencies, just remove them to figure out whether or not your test goes further.

0 votes