Hi All,

I was having a test project that worked well in CXF 2.7.11 in jdk1.7

In this project, I have a parameterized method in an interface
SomeService<T> as:

void doSomething(List<T> objects)

There is another interface called SpecialService which extends SomeService
as SomeService<Foo> and has no other methods. The implementation of
SpecialService was a SpecialServiceImpl class that I had annotated with
@Path and @GET to make it JAX-RS ready.

After upgrading to jdk8, I randomly get an error like:
[utils.InjectionUtils.reportServerError():478  ERROR]: Parameter Class
java.util.List has no constructor with single String parameter, static
valueOf(String) or fromString(String) methods

Debugging it several times over leads me to believe that the bridge methods
coming from SomeService interface are causing problems. Empirically it
seems that this problem only comes when the listing in getMethods() call
returns the bridge method before the non-bridge method.

Looking through jdk compatibility notes, it looks like the order of methods
can actually vary from invocation to invocation
http://www.oracle.com/technetwork/java/javase/compatibility-417013.html
*Area:* HotSpot
*Synopsis:* Order of Methods returned by Class.get Methods can Vary

>From my cursory analysis of the code in JAXRSUtils, it seems that the first
ORI that matches the types is chosen and if it so happens that the ori
corresponds to the bridge method, it is not able to get the exact type
information of T and proceeeds to call a java.util.List constructor with a
single string constructor.

Ofcourse, I could be completely wrong and wanted to see if anyone else also
has experienced something similar.

Thanks in advance!

Reply via email to