Hi Colm,

We sadly still have quite a few places where reflection is used. That's 
probably 
one of those. There is an ongoing effort to clean up [1] all such occurrences 
but 
it takes time (and the issues go way beyond just CXF). In general, if there is 
an
alternative way to implement the same functionality (without reflection being 
used),
we should do that (JIRA ticket is welcomed), but if not - we degrade it (like 
in 
the case presented, no message since we cannot extract it). 
 
> Are there any other known issues with java 17?

Yes, see please [2] for example.
 
[1] https://issues.apache.org/jira/browse/CXF-8407
[2] https://issues.apache.org/jira/browse/CXF-8173
 
Thanks!

Best Regards,
    Andriy Redko

> Hi,

> Did anyone look into this - is it already fixed? If not we should have
> a JIRA at least to investigate.

> Colm.

> On Tue, Feb 7, 2023 at 1:08 PM Thomas Matthijs <li...@selckin.be> wrote:
>> Hello,
>> There is a difference in behavior between java 11 and java 17. When you 
>> throw and exception from a service, the message is lost.
>> I modified one of the example projects to throw an exception:
>> https://github.com/selckin/cxf-exception/blob/master/src/main/java/demo/hw/server/HelloWorldImpl.java#L50
>> With java 11 on the client you will get:
>> demo.hw.server.AccessDeniedException: foobar123
>>         at 
>> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>>  Method)
>> On java 17, the message "foobar123" is missing
>> demo.hw.server.AccessDeniedException
>>         at 
>> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>>  Method)
>> Believe this is because the message of the exception is retrieved using 
>> reflection that is not allowed on java 17:
>> https://github.com/apache/cxf/blob/b6e3ab83a37cfb777d6eebf9711e552027bde37a/core/src/main/java/org/apache/cxf/interceptor/ClientFaultConverter.java#L197
>> This code is still there even in 4.0.0 which claims to support java 17.
>> Is this a known issue or should I report it as a bug? Or is it accepted that 
>> it won't work under java 17+ ?
>> Are there any other known issues with java 17?
>> Thanks

Reply via email to