Hide Forgot
Description of problem: Failing tests due to Caused by: java.lang.NoClassDefFoundError: org/jboss/resteasy/plugins/server/tjws/TJWSEmbeddedJaxrsServer. => Dependencies are missing. It is possible to use dependencies from section "Additional info" to overcome this problem. org.overlord.sramp.governance.services.DeploymentResourceTest.org.overlord.sramp.governance.services.DeploymentResourceTest org.overlord.sramp.governance.services.NotificationResourceTest.org.overlord.sramp.governance.services.NotificationResourceTest Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. Get DTGov from FSW6 ER7-2 2. Use maven development repository (http://download.devel.redhat.com/brewroot/repos/jb-ip-6-build/latest/maven/) 3. cd <path-to-dtgov>/dtgov-war 4. mvn -fae -Dmave.test.skip=false -DskipTests=false clean test Actual results: Stacktrace java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.overlord.sramp.common.test.resteasy.EmbeddedContainer.start(EmbeddedContainer.java:91) at org.overlord.sramp.common.test.resteasy.EmbeddedContainer.start(EmbeddedContainer.java:70) at org.overlord.sramp.common.test.resteasy.BaseResourceTest.before(BaseResourceTest.java:43) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75) Caused by: java.lang.NoClassDefFoundError: org/jboss/resteasy/plugins/server/tjws/TJWSEmbeddedJaxrsServer at org.overlord.sramp.common.test.resteasy.TJWSServletContainer.start(TJWSServletContainer.java:106) at org.overlord.sramp.common.test.resteasy.TJWSServletContainer.start(TJWSServletContainer.java:100) at org.overlord.sramp.common.test.resteasy.TJWSServletContainer.start(TJWSServletContainer.java:46) ... 29 more Caused by: java.lang.ClassNotFoundException: org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) 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) ... 32 more Standard Output [Embedded Container Start] [Embedded Container Stop] Expected results: Additional info: Try to add following dependencies to file <path-to-dtgov>/dtgov-war/pom.xml. Dependencies are not contained and contain missing classes. <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-jaxrs</artifactId> <version>3.0.6.Final</version> </dependency> <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>jaxrs-api</artifactId> <version>3.0.6.Final</version> </dependency>
Where is this source coming from? The production version of the codebase already contains dependencies for those two as below <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-jaxrs</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>jaxrs-api</artifactId> <scope>provided</scope> </dependency>
I do not know why it did not work but I just added dependencies which contained missing classes. I found the dependencies according to information found on this page http://search.maven.org/#advancedsearch|gav. Maybe those provided information are not really "provided" by container.
It looks like there are classes missing from the resteasy-jaxrs-2.3.6.Final-redhat-1.jar provided in the repo 351,358d352 < org/jboss/resteasy/plugins/server/tjws/ < org/jboss/resteasy/plugins/server/tjws/AuthenticatedHttpServletRequest.class < org/jboss/resteasy/plugins/server/tjws/PatchedHttpServletRequest.class < org/jboss/resteasy/plugins/server/tjws/TJWSEmbeddedJaxrsServer.class < org/jboss/resteasy/plugins/server/tjws/TJWSRequestPreProcessor.class < org/jboss/resteasy/plugins/server/tjws/TJWSServletDispatcher.class < org/jboss/resteasy/plugins/server/tjws/TJWSServletServer$FileMappingServe.class < org/jboss/resteasy/plugins/server/tjws/TJWSServletServer.class 432,436d425 < org/jboss/resteasy/test/ < org/jboss/resteasy/test/BaseResourceTest.class < org/jboss/resteasy/test/EmbeddedContainer.class < org/jboss/resteasy/test/TJWSServletContainer.class < org/jboss/resteasy/test/TestPortProvider.class 472d460 < org/jboss/resteasy/util/HttpServletRequestDelegate.class
*** Bug 1043836 has been marked as a duplicate of this bug. ***
The EAP 6.1.1 build of RESTEasy :2.3.6.Final-redhat-1 does not include the tjws classes. A build of 2.3.7 has been done for us, which does include them: https://brewweb.devel.redhat.com/buildinfo?buildID=319693 We will use this RESTEasy version in CR1. Note, that the test/*.class files will still not be present. See also: https://bugzilla.redhat.com/show_bug.cgi?id=1032115
New version of RESTEasy dependency (containing missing classes) was not included in CR1! Problem was not solved. There is still old version 2.3.6.Final-redhat-1.