quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.54k stars 2.61k forks source link

Kogito quickstart failing with current master #6176

Closed gsmet closed 3 years ago

gsmet commented 4 years ago

With current master, we have the Kogito quickstart failing with:

Caused by:
com.oracle.svm.core.jdk.UnsupportedFeatureError: Proxy class defined by interfaces [interface javax.ws.rs.core.HttpHeaders] not found. Generating proxy classes at runtime is not supported. Proxy classes need to be defined at image build time by specifying the list of interfaces that they implement. To define proxy classes use -H:DynamicProxyConfigurationFiles=<comma-separated-config-files> and -H:DynamicProxyConfigurationResources=<comma-separated-config-resources> options.
    at com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:102)
    at com.oracle.svm.reflect.proxy.DynamicProxySupport.getProxyClass(DynamicProxySupport.java:113)
    at java.lang.reflect.Proxy.getProxyClass0(Proxy.java:54)
    at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:719)
    at org.jboss.resteasy.core.ContextParameterInjector.createProxy(ContextParameterInjector.java:189)
    at org.jboss.resteasy.core.ContextParameterInjector.inject(ContextParameterInjector.java:66)
    at org.jboss.resteasy.core.MethodInjectorImpl.lambda$injectArguments$1(MethodInjectorImpl.java:96)
    at java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:995)
    at java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2137)
    at java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:110)
    at org.jboss.resteasy.core.MethodInjectorImpl.injectArguments(MethodInjectorImpl.java:96)
    at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:121)
    at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:594)
    at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:468)
    at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$2(ResourceMethodInvoker.java:421)
    at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:363)
    at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:423)
    at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:391)
    at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invoke$1(ResourceMethodInvoker.java:365)
    at java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:995)
    at java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2137)
    at java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:110)
    at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:365)
    at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:477)
    ... 15 more

AFAICS, it's related to the Kogito 0.6.1 upgrade because we didn't have this issue before.

That being said, it looks like standard RESTEasy code so I'm not sure if it's a bug in Kogito or in the Quarkus RESTEasy extension (missing declaring some potential proxy creation).

@mswiderski did you include something else than the config fix in 0.6.1? It looks like so because if I revert this upgrade, everything is OK. @asoldano does it ring a bell?

mswiderski commented 4 years ago

@gsmet yes, it does include additional fixes. What we use HttpHeaders is just to inject it into a method of resource class to be able to access http headers.

@POST()
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public TimersModel createResource_timers(@Context HttpHeaders httpHeaders, TimersModel resource) {

In addition I actually tested all this in native and jvm mode and didn't run into any issue, does this fail in native mode only?

gsmet commented 4 years ago

Yes the quickstart fails in native mode. Reproduced on quickstart CI and locally.

mswiderski commented 4 years ago

@gsmet what graalvm version do you use?

gsmet commented 4 years ago

It's failing with GraalVM 19.3 on master and was failing with 19.2.1 on 1.1 until I reverted the upgrade.

But I think your usage is legit so we probably need to authorize creating proxies there. I'll see if it fixes the issue.

On Mon, Dec 16, 2019 at 10:54 AM Maciej Swiderski notifications@github.com wrote:

@gsmet https://github.com/gsmet what graalvm version do you use?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/quarkusio/quarkus/issues/6176?email_source=notifications&email_token=AAJYOBJCFNSSRXUCAOC2QDDQY5F6XA5CNFSM4J22YKTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG6EQ6A#issuecomment-565987448, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJYOBOHXD2IYOBPW7TM5K3QY5F6XANCNFSM4J22YKTA .

mswiderski commented 4 years ago

ok, let me know if I should investigate anything on Kogito end.

gsmet commented 4 years ago

@mswiderski I pinged you on Zulip, let's have the discussion there.

gsmet commented 4 years ago

@mswiderski I'm trying to ping you on Zulip. We need a fix quickly so I would appreciate if we could have a discussion. It's probably an easy fix but I need some information from you.