Open fitzget opened 1 year ago
The following is in the trace.log and appears to point to the root issue:
[2/14/23 16:20:20:229 GMT] 0000004c id=00000000 org.jboss.resteasy.spi.LoggableFailure > <init> Entry
RESTEASY003880: Unable to find contextual data of type: org.jboss.resteasy.spi.ResteasyConfiguration
[2/14/23 16:20:20:229 GMT] 0000004c id=685f4f47 org.jboss.resteasy.spi.LoggableFailure < <init> Exit
org.jboss.resteasy.spi.LoggableFailure: RESTEASY003880: Unable to find contextual data of type: org.jboss.resteasy.spi.ResteasyConfiguration
at org.jboss.resteasy.core.ContextParameterInjector$GenericDelegatingProxy.invoke(ContextParameterInjector.java:155)
at com.sun.proxy.$Proxy36.getParameter(Unknown Source)
at org.jboss.resteasy.plugins.providers.DocumentProvider.<init>(DocumentProvider.java:92)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:83)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:57)
at java.lang.reflect.Constructor.newInstance(Constructor.java:437)
at org.jboss.resteasy.core.ConstructorInjectorImpl.constructOutsideRequest(ConstructorInjectorImpl.java:225)
at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:209)
at org.jboss.resteasy.core.providerfactory.Utils.createProviderInstance(Utils.java:102)
at org.jboss.resteasy.core.providerfactory.CommonProviders.processProviderContracts(CommonProviders.java:108)
at org.jboss.resteasy.core.providerfactory.ClientHelper.processProviderContracts(ClientHelper.java:104)
at org.jboss.resteasy.core.providerfactory.ResteasyProviderFactoryImpl.processProviderContracts(ResteasyProviderFactoryImpl.java:841)
at org.jboss.resteasy.core.providerfactory.ResteasyProviderFactoryImpl.registerProvider(ResteasyProviderFactoryImpl.java:829)
at org.jboss.resteasy.core.providerfactory.ResteasyProviderFactoryImpl.registerProvider(ResteasyProviderFactoryImpl.java:816)
at org.jboss.resteasy.plugins.providers.RegisterBuiltin.registerProviders(RegisterBuiltin.java:109)
at org.jboss.resteasy.plugins.providers.RegisterBuiltin.register(RegisterBuiltin.java:74)
at org.jboss.resteasy.plugins.providers.RegisterBuiltin.getClientInitializedResteasyProviderFactory(RegisterBuiltin.java:54)
at org.jboss.resteasy.client.jaxrs.internal.ResteasyClientBuilderImpl.getProviderFactory(ResteasyClientBuilderImpl.java:377)
at org.jboss.resteasy.client.jaxrs.internal.ResteasyClientBuilderImpl.getConfiguration(ResteasyClientBuilderImpl.java:466)
at io.openliberty.restfulWS.internal.ssl.component.SslClientBuilderListener.building(SslClientBuilderListener.java:60)
at io.openliberty.org.jboss.resteasy.common.client.LibertyResteasyClientBuilderImpl.lambda$build$1(LibertyResteasyClientBuilderImpl.java:55)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:195)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:204)
at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:959)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:524)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:514)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:162)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:185)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:245)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:429)
at io.openliberty.org.jboss.resteasy.common.client.OsgiFacade.invoke(OsgiFacade.java:86)
at io.openliberty.org.jboss.resteasy.common.client.LibertyResteasyClientBuilderImpl.lambda$build$2(LibertyResteasyClientBuilderImpl.java:55)
at java.util.Optional.map(Optional.java:226)
at io.openliberty.org.jboss.resteasy.common.client.LibertyResteasyClientBuilderImpl.build(LibertyResteasyClientBuilderImpl.java:54)
at io.openliberty.org.jboss.resteasy.common.client.LibertyResteasyClientBuilderImpl.build(LibertyResteasyClientBuilderImpl.java:35)
at jakarta.ws.rs.client.ClientBuilder.newClient(ClientBuilder.java:88)
...
Hi
do you have a timeframe for looking at this please
Many Thanks Tony Fitzgerald
Sorry it has taken so long to get back to you on this Tony. I hope to have a meaningful update for this issue within the next several days.
@fitzget: Hi Tony, I apologize again for the delay on this issue. I've reproduced the problem you were seeing locally and have a resolution for you.
First, the error you are seeing when you turn trace on is a red herring and not actually the cause of the problem you are having. This exception occurs whenever trace is enabled. It indicates that org.jboss.resteasy.spi.ResteasyConfiguration is missing, however it does not appear that configuration is needed when running in Open Liberty and processing continues. That being said I plan on leaving this issue open to fix things so this message is either resolved or is prevented from showing up when trace is enabled.
As for the "real" problem you are experiencing. The code you included in your example is attempting to run a Completable Future operation but it is giving it no time to complete. That is making it look like the resource method was not found or executed (but without a 404). To resolve this simply add the following (.toCompletableFuture().get()) line to your AsyncClientTest.runClientAPI() method:
csResponse.thenAccept(System.out::println);
csResponse.toCompletableFuture().get();
When I add the line above your example works fine for me.
Hopefully this get things going for you.
Hi Jim
apologies for the delay in getting back.
Have added the extra line of code to the application and it has resolved the problem.
Many thanks Tony Fitzgerald
This problem was resolved without code change. This issue was left open to resolve a message issue related to trace. See comments below.
Original problem:
Describe the bug
We have a Java servlet making a call to a restful web service using Jakarta V9.1 (RestfulWs-3.0 feature)
The code issues
the target never gets invoked and trace shows we get (full trace attached in zip file)
This application worked using Java EE8 (using feature jaxrs-2.1)
Trace achieved by setting
*=info=enabled:logservice=all:com.ibm.ws.jaxrs*=all:com.ibm.websphere.jaxrs*=all:org.apache.cxf.*=all:RESTfulWS=all:io.openliberty.org.jboss.*=all:io.openliberty.restfulWS.*=all:org.jboss.resteasy.*=all
Steps to Reproduce
Application code attached. Two classes.Ist class a servlet which invokes the Restful service (the url for which is passed as querystring part url= on the call to the web servlet
Expected behavior
client.target to invoke the restful web service
Diagnostic information:
restfulWS problem 2.zip
$WLP_OUTPUT_DIR/messages.log
Additional context
Add any other context about the problem here.