junit.framework.AssertionFailedError

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
tip

You need to add httpcore to your dependencies. Try adding version 4.3 or further.

tip

A few things cause this exception: 1) Check if you have all jars and if they're in the correct path when running. 2) Your classpath might be broken, you can define it in the command line with "java -cp yourClassPath" or at your IDE if you're using one.

tip

If you're using Hibernate, this indicates you're missing FasterXML Classmate dependency, which you can add to your dependencies. To add it, the groupId is com.fasterxml and artifactId is Classmate.

tip

Check if you didn't forget to instantiate your topic in the kafka broker.

tip

NoClassDefFoundError means java has failed to find a class you're trying to instantiate, look if you've added the class you're trying to instantiate to the dependencies.

tip

You might've forgot to add a dependency or it's written wrong. Also, you might be using incompatible versions of Java and Hibernate. More on this here: https://goo.gl/SjSlRA

tip

This error means there's a class missing in your classpath during runtime. You need to create a jar with all your dependencies and have it in your classpath. Check Maven Assembly Plugin and how to add your dependencies to a jar: https://goo.gl/U2zr8k

tip

jsp-api and servlet-api jars must NOT be deployed by your web app. They should be marked as provided but not deployed by your app.

tip

The server rejects all jars that already belong to the server runtime (such as tomcat-**.jar, servlet**.jar). Consider substituting the CORS filter you're using for this one: https://goo.gl/ctQ7Fs

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • [jira] [Created] (CXF-6178) Missing io.netty.util.Version
    via by Chris Marshall (JIRA),
  • [jira] [Commented] (CXF-6178) Missing io.netty.util.Version
    via by Sergey Beryozkin (JIRA),
  • I just upgraded to version 3.0.3 and I have a number of JUnit tests that act as clients to a service built with CXF. The clients use CXF as well. With 3.0.3 the JUnit tests are all generating the stack trace below. junit.framework.AssertionFailedError: Exception in constructor: testQualifyRest (java.lang.RuntimeException: org.apache.cxf.bus.extension.ExtensionException: Could not create object of extension class org.apache.cxf.transport.http.netty.server.NettyHttpTransportFactory. at org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean.createWithValues(JAXRSClientFactoryBean.java:341) at org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean.create(JAXRSClientFactoryBean.java:264) at com.a100sys.utils.JacksonClientHelper.createJacksonJSONService(JacksonClientHelper.java:429) at com.a100sys.utils.QuestionMapper.getQuestionService(QuestionMapper.java:339) at com.a100sys.utils.QuestionMapper.findQuestionOptions(QuestionMapper.java:279) at com.a100sys.utils.QuestionMapper.<init>(QuestionMapper.java:247) at com.a100sys.utils.QuestionMapper.getInstance(QuestionMapper.java:269) at com.a100sys.affiliateportal.TestQualify.<init>(TestQualify.java:37) at com.a100sys.affiliateportal.rest.TestQualifyRestJSON.<init>(TestQualifyRestJSON.java:14) 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:408) at junit.framework.TestSuite.createTest(TestSuite.java:63) at junit.framework.TestSuite.addTestMethod(TestSuite.java:310) at junit.framework.TestSuite.addTestsFromTestCase(TestSuite.java:153) at junit.framework.TestSuite.<init>(TestSuite.java:132) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.getTest(JUnit3TestLoader.java:102) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.loadTests(JUnit3TestLoader.java:59) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: org.apache.cxf.bus.extension.ExtensionException: Could not create object of extension class org.apache.cxf.transport.http.netty.server.NettyHttpTransportFactory. at org.apache.cxf.bus.extension.Extension.load(Extension.java:260) at org.apache.cxf.bus.extension.ExtensionManagerImpl.loadAndRegister(ExtensionManagerImpl.java:213) at org.apache.cxf.bus.extension.ExtensionManagerImpl.loadBeansOfType(ExtensionManagerImpl.java:368) at org.apache.cxf.transport.TransportFinder.loadAll(TransportFinder.java:138) at org.apache.cxf.transport.TransportFinder.findTransportForURI(TransportFinder.java:84) at org.apache.cxf.bus.managers.DestinationFactoryManagerImpl.getDestinationFactoryForUri(DestinationFactoryManagerImpl.java:128) at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.createEndpointInfo(AbstractJAXRSFactoryBean.java:131) at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.createEndpoint(AbstractJAXRSFactoryBean.java:219) at org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean.createWithValues(JAXRSClientFactoryBean.java:291) ... 22 more Caused by: java.lang.NoClassDefFoundError: io/netty/util/Version at org.apache.cxf.transport.http.netty.server.NettyHttpDestinationFactory.<init>(NettyHttpDestinationFactory.java:36) at org.apache.cxf.transport.http.netty.server.NettyHttpTransportFactory.<init>(NettyHttpTransportFactory.java:55) at org.apache.cxf.transport.http.netty.server.NettyHttpTransportFactory.<init>(NettyHttpTransportFactory.java:58) 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:408) at org.apache.cxf.bus.extension.Extension.load(Extension.java:249) ... 30 more Caused by: java.lang.ClassNotFoundException: io.netty.util.Version at java.net.URLClassLoader$1.run(URLClassLoader.java:372) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:360) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 38 more ) I downloaded a copy of netty and added the jar to the class path and the test then work fine.
    via by Chris Marshall,
  • I just upgraded to version 3.0.3 and I have a number of JUnit tests that act as clients to a service built with CXF. The clients use CXF as well. With 3.0.3 the JUnit tests are all generating the stack trace below. junit.framework.AssertionFailedError: Exception in constructor: testQualifyRest (java.lang.RuntimeException: org.apache.cxf.bus.extension.ExtensionException: Could not create object of extension class org.apache.cxf.transport.http.netty.server.NettyHttpTransportFactory. at org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean.createWithValues(JAXRSClientFactoryBean.java:341) at org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean.create(JAXRSClientFactoryBean.java:264) at com.a100sys.utils.JacksonClientHelper.createJacksonJSONService(JacksonClientHelper.java:429) at com.a100sys.utils.QuestionMapper.getQuestionService(QuestionMapper.java:339) at com.a100sys.utils.QuestionMapper.findQuestionOptions(QuestionMapper.java:279) at com.a100sys.utils.QuestionMapper.<init>(QuestionMapper.java:247) at com.a100sys.utils.QuestionMapper.getInstance(QuestionMapper.java:269) at com.a100sys.affiliateportal.TestQualify.<init>(TestQualify.java:37) at com.a100sys.affiliateportal.rest.TestQualifyRestJSON.<init>(TestQualifyRestJSON.java:14) 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:408) at junit.framework.TestSuite.createTest(TestSuite.java:63) at junit.framework.TestSuite.addTestMethod(TestSuite.java:310) at junit.framework.TestSuite.addTestsFromTestCase(TestSuite.java:153) at junit.framework.TestSuite.<init>(TestSuite.java:132) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.getTest(JUnit3TestLoader.java:102) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.loadTests(JUnit3TestLoader.java:59) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: org.apache.cxf.bus.extension.ExtensionException: Could not create object of extension class org.apache.cxf.transport.http.netty.server.NettyHttpTransportFactory. at org.apache.cxf.bus.extension.Extension.load(Extension.java:260) at org.apache.cxf.bus.extension.ExtensionManagerImpl.loadAndRegister(ExtensionManagerImpl.java:213) at org.apache.cxf.bus.extension.ExtensionManagerImpl.loadBeansOfType(ExtensionManagerImpl.java:368) at org.apache.cxf.transport.TransportFinder.loadAll(TransportFinder.java:138) at org.apache.cxf.transport.TransportFinder.findTransportForURI(TransportFinder.java:84) at org.apache.cxf.bus.managers.DestinationFactoryManagerImpl.getDestinationFactoryForUri(DestinationFactoryManagerImpl.java:128) at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.createEndpointInfo(AbstractJAXRSFactoryBean.java:131) at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.createEndpoint(AbstractJAXRSFactoryBean.java:219) at org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean.createWithValues(JAXRSClientFactoryBean.java:291) ... 22 more Caused by: java.lang.NoClassDefFoundError: io/netty/util/Version at org.apache.cxf.transport.http.netty.server.NettyHttpDestinationFactory.<init>(NettyHttpDestinationFactory.java:36) at org.apache.cxf.transport.http.netty.server.NettyHttpTransportFactory.<init>(NettyHttpTransportFactory.java:55) at org.apache.cxf.transport.http.netty.server.NettyHttpTransportFactory.<init>(NettyHttpTransportFactory.java:58) 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:408) at org.apache.cxf.bus.extension.Extension.load(Extension.java:249) ... 30 more Caused by: java.lang.ClassNotFoundException: io.netty.util.Version at java.net.URLClassLoader$1.run(URLClassLoader.java:372) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:360) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 38 more ) I downloaded a copy of netty and added the jar to the class path and the test then work fine.
    via by Chris Marshall,
    • junit.framework.AssertionFailedError: Exception in constructor: testQualifyRest (java.lang.RuntimeException: org.apache.cxf.bus.extension.ExtensionException: Could not create object of extension class org.apache.cxf.transport.http.netty.server.NettyHttpTransportFactory. at org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean.createWithValues(JAXRSClientFactoryBean.java:341) at org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean.create(JAXRSClientFactoryBean.java:264) at com.a100sys.utils.JacksonClientHelper.createJacksonJSONService(JacksonClientHelper.java:429) at com.a100sys.utils.QuestionMapper.getQuestionService(QuestionMapper.java:339) at com.a100sys.utils.QuestionMapper.findQuestionOptions(QuestionMapper.java:279) at com.a100sys.utils.QuestionMapper.<init>(QuestionMapper.java:247) at com.a100sys.utils.QuestionMapper.getInstance(QuestionMapper.java:269) at com.a100sys.affiliateportal.TestQualify.<init>(TestQualify.java:37) at com.a100sys.affiliateportal.rest.TestQualifyRestJSON.<init>(TestQualifyRestJSON.java:14) 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:408) at junit.framework.TestSuite.createTest(TestSuite.java:63) at junit.framework.TestSuite.addTestMethod(TestSuite.java:310) at junit.framework.TestSuite.addTestsFromTestCase(TestSuite.java:153) at junit.framework.TestSuite.<init>(TestSuite.java:132) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.getTest(JUnit3TestLoader.java:102) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.loadTests(JUnit3TestLoader.java:59) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: org.apache.cxf.bus.extension.ExtensionException: Could not create object of extension class org.apache.cxf.transport.http.netty.server.NettyHttpTransportFactory. at org.apache.cxf.bus.extension.Extension.load(Extension.java:260) at org.apache.cxf.bus.extension.ExtensionManagerImpl.loadAndRegister(ExtensionManagerImpl.java:213) at org.apache.cxf.bus.extension.ExtensionManagerImpl.loadBeansOfType(ExtensionManagerImpl.java:368) at org.apache.cxf.transport.TransportFinder.loadAll(TransportFinder.java:138) at org.apache.cxf.transport.TransportFinder.findTransportForURI(TransportFinder.java:84) at org.apache.cxf.bus.managers.DestinationFactoryManagerImpl.getDestinationFactoryForUri(DestinationFactoryManagerImpl.java:128) at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.createEndpointInfo(AbstractJAXRSFactoryBean.java:131) at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.createEndpoint(AbstractJAXRSFactoryBean.java:219) at org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean.createWithValues(JAXRSClientFactoryBean.java:291) ... 22 more Caused by: java.lang.NoClassDefFoundError: io
    • etty/util/Version at org.apache.cxf.transport.http.netty.server.NettyHttpDestinationFactory.<init>(NettyHttpDestinationFactory.java:36) at org.apache.cxf.transport.http.netty.server.NettyHttpTransportFactory.<init>(NettyHttpTransportFactory.java:55) at org.apache.cxf.transport.http.netty.server.NettyHttpTransportFactory.<init>(NettyHttpTransportFactory.java:58) 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:408) at org.apache.cxf.bus.extension.Extension.load(Extension.java:249) ... 30 more Caused by: java.lang.ClassNotFoundException: io.netty.util.Version at java.net.URLClassLoader$1.run(URLClassLoader.java:372) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:360) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 38 more

    Users with the same issue

    rp
    2 times, last one,
    Unknown visitor1 times, last one,
    musketyr
    2 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    2285 more bugmates