Wierd "PlaceholderException" hiding real faliure in junit test


(Karl-Johan Karlberg) #1

We getting a specific error in junit test a PlaceholderException hides the actual failure.

Jenkins gives one lie of useful info: javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException

When remote debugging the junittest and doing an inspect of the actual exception in eclipse we find that the exception contains this message:

com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 8 counts of IllegalAnnotationExceptions
Two classes have the same XML type name "{http://netgiro.com/PaymentEventService/v1/pes}RequestHeader". Use @XmlType.name and @XmlType.namespace to assign different names to them.
 this problem is related to the following location:
  at com.netgiro.paymenteventservice.v1.card.pts.RequestHeader
  at protected com.netgiro.paymenteventservice.v1.card.pts.RequestHeader com.netgiro.paymenteventservice.v1.card.pts.ServiceRequest.requestHeader
  at com.netgiro.paymenteventservice.v1.card.pts.ServiceRequest
 this problem is related to the following location:
  at com.netgiro.paymenteventservice.v1.dd.RequestHeader
  at public com.netgiro.paymenteventservice.v1.dd.RequestHeader com.netgiro.paymenteventservice.v1.dd.ObjectFactory.createRequestHeader()
  at com.netgiro.paymenteventservice.v1.dd.ObjectFactory
...

What actaully is displayed in jenkins is:

java.lang.ClassCastException: org.gradle.messaging.remote.internal.PlaceholderException cannot be cast to com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationException
 at com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException.toString(IllegalAnnotationsException.java:62)
 at java.lang.String.valueOf(String.java:2826)
 at java.lang.StringBuilder.append(StringBuilder.java:115)
 at java.lang.Throwable.printStackTraceAsCause(Throwable.java:536)
 at java.lang.Throwable.printStackTraceAsCause(Throwable.java:545)
 at java.lang.Throwable.printStackTrace(Throwable.java:516)
 at org.gradle.api.internal.tasks.testing.junit.result.TestReportDataCollector.stackTrace(TestReportDataCollector.java:100)
 at org.gradle.api.internal.tasks.testing.junit.result.TestReportDataCollector.afterTest(TestReportDataCollector.java:69)
 at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
 at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
 at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:79)
 at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:31)
 at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
 at com.sun.proxy.$Proxy37.afterTest(Unknown Source)
 at org.gradle.api.internal.tasks.testing.results.TestListenerAdapter.completed(TestListenerAdapter.java:48)
 at org.gradle.api.internal.tasks.testing.results.StateTrackingTestResultProcessor.completed(StateTrackingTestResultProcessor.java:65)
 at org.gradle.api.internal.tasks.testing.results.AttachParentTestResultProcessor.completed(AttachParentTestResultProcessor.java:52)
 at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
 at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
 at org.gradle.messaging.dispatch.FailureHandlingDispatch.dispatch(FailureHandlingDispatch.java:29)
 at org.gradle.messaging.dispatch.AsyncDispatch.dispatchMessages(AsyncDispatch.java:132)
 at org.gradle.messaging.dispatch.AsyncDispatch.access$000(AsyncDispatch.java:33)
 at org.gradle.messaging.dispatch.AsyncDispatch$1.run(AsyncDispatch.java:72)
 at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
 at java.lang.Thread.run(Thread.java:662)

This seems related to:

http://issues.gradle.org/browse/GRADLE-1905


(Peter Niederwieser) #2

Have you tried with the latest Gradle version? If this doesn’t fix the problem, can you provide a reproducible example?


(Karl-Johan Karlberg) #3

Gradle 1.11 is being used.

I will look into providing a reproducible example…