Failures upgrading to RESTEasy 4.6.1

161 views
Skip to first unread message

Ron Sigal

unread,
Jun 8, 2021, 5:33:00 PM6/8/21
to Quarkus Development mailing list

Hi,

I'm trying to run the main branch quarkus testsuite with RESTEasy 4.6.1, and I'm getting three failures I don't know how to diagnose. Two of them seem to involve CDI.

I don't like to ask, but can someone take a look at https://github.com/ronsigal/quarkus/actions/runs/919152668, or just give me somehints? If you prefer, I could create a pull request.

1. "JVM Tests - JDK 11", "JVM Tests - JDK 16", "JVM Tests - JDK 11 Windows":

I see

2021-06-08T18:25:10.1925153Z [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.001 s <<< FAILURE! - in io.quarkus.restclient.registerclientheaders.RegisterClientHeadersTest
2021-06-08T18:25:10.1928750Z [ERROR] io.quarkus.restclient.registerclientheaders.RegisterClientHeadersTest.testProvider  Time elapsed: 0.012 s  <<< ERROR!
2021-06-08T18:25:10.1931573Z javax.ws.rs.ProcessingException: org.opentest4j.AssertionFailedError: expected: not <null>
2021-06-08T18:25:10.1934011Z 	at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.filterRequest(ClientInvocation.java:700)
...
021-06-08T18:25:10.2515490Z Caused by: org.opentest4j.AssertionFailedError: expected: not <null>
2021-06-08T18:25:10.2516740Z 	at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:39)
2021-06-08T18:25:10.2518018Z 	at org.junit.jupiter.api.Assertions.fail(Assertions.java:117)
2021-06-08T18:25:10.2519631Z 	at org.junit.jupiter.api.AssertNotNull.failNull(AssertNotNull.java:47)
2021-06-08T18:25:10.2521330Z 	at org.junit.jupiter.api.AssertNotNull.assertNotNull(AssertNotNull.java:36)
2021-06-08T18:25:10.2523032Z 	at org.junit.jupiter.api.AssertNotNull.assertNotNull(AssertNotNull.java:31)
2021-06-08T18:25:10.2524757Z 	at org.junit.jupiter.api.Assertions.assertNotNull(Assertions.java:283)
2021-06-08T18:25:10.2526885Z 	at io.quarkus.restclient.registerclientheaders.MyHeadersFactory.update(MyHeadersFactory.java:21)

It seems that the BeanManager was not injected in extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/registerclientheaders.MyHeadersFactory.java

@Singleton
public class MyHeadersFactory implements ClientHeadersFactory {

    @Inject
    BeanManager beanManager;

    @Override
    public MultivaluedMap<String, String> update(MultivaluedMap<String, String> incomingHeaders,
            MultivaluedMap<String, String> clientOutgoingHeaders) {
        assertNotNull(beanManager);
        incomingHeaders.add("foo", "bar");
        return incomingHeaders;
    }

}


2. "MicroProfile TCKs Tests":

I see

2021-06-08T18:22:43.2475781Z [ERROR] org.eclipse.microprofile.rest.client.tck.cditests.CDIClientHeadersFactoryTest.testClientHeadersFactoryInvoked  Time elapsed: 0.436 s  <<< FAILURE!
2021-06-08T18:22:43.2479615Z java.lang.NullPointerException
2021-06-08T18:22:43.2481018Z 	at org.glassfish.json.JsonObjectBuilderImpl$JsonObjectImpl.getString(JsonObjectBuilderImpl.java:233)
2021-06-08T18:22:43.2485890Z 	at org.eclipse.microprofile.rest.client.tck.cditests.CDIClientHeadersFactoryTest.testClientHeadersFactoryInvoked(CDIClientHeadersFactoryTest.java:87)

It looks like

    @Inject
    private Counter counter;

in org.eclipse.microprofile.rest.client.tck.ext.CdiCustomClientHeadersFactory might not have been injected ...


3. "Native Tests - Main ", "Native Tests - Messaging1", "Native Tests - Security2", "Native Tests - Security2", "Native Tests - Security3", "Native Tests - Cache", "Native Tests - HTTP":

I see

2021-06-08T18:43:38.1584421Z Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: org.jboss.resteasy.cdi.CdiConstructorInjector. To diagnose the issue you can use the --allow-incomplete-classpath option. The missing type is then reported at run time when it is accessed the first time.
2021-06-08T18:43:38.1587308Z Detailed message:
2021-06-08T18:43:38.1587734Z Trace: 
2021-06-08T18:43:38.1590244Z 	at parsing org.jboss.resteasy.microprofile.client.header.ClientHeaderProviders.construct(ClientHeaderProviders.java:107)

I tried adding 

	<quarkus.native.additional-build-args>--allow-incomplete-classpath</quarkus.native.additional-build-args>

to properties of the native-image profile in integration-tests/main/pom.xml, but it didn't help.

Stuart Douglas

unread,
Jun 8, 2021, 8:30:12 PM6/8/21
to Ronald Sigal, Quarkus Development mailing list
On Wed, 9 Jun 2021 at 07:33, Ron Sigal <rsi...@redhat.com> wrote:

Hi,

I'm trying to run the main branch quarkus testsuite with RESTEasy 4.6.1, and I'm getting three failures I don't know how to diagnose. Two of them seem to involve CDI.

I don't like to ask, but can someone take a look at https://github.com/ronsigal/quarkus/actions/runs/919152668, or just give me somehints? If you prefer, I could create a pull request.

1. "JVM Tests - JDK 11", "JVM Tests - JDK 16", "JVM Tests - JDK 11 Windows":

I see

2021-06-08T18:25:10.1925153Z [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.001 s <<< FAILURE! - in io.quarkus.restclient.registerclientheaders.RegisterClientHeadersTest
2021-06-08T18:25:10.1928750Z [ERROR] io.quarkus.restclient.registerclientheaders.RegisterClientHeadersTest.testProvider  Time elapsed: 0.012 s  <<< ERROR!
2021-06-08T18:25:10.1931573Z javax.ws.rs.ProcessingException: org.opentest4j.AssertionFailedError: expected: not <null>
2021-06-08T18:25:10.1934011Z 	at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.filterRequest(ClientInvocation.java:700)
...
021-06-08T18:25:10.2515490Z Caused by: org.opentest4j.AssertionFailedError: expected: not <null>
2021-06-08T18:25:10.2516740Z 	at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:39)
2021-06-08T18:25:10.2518018Z 	at org.junit.jupiter.api.Assertions.fail(Assertions.java:117)
2021-06-08T18:25:10.2519631Z 	at org.junit.jupiter.api.AssertNotNull.failNull(AssertNotNull.java:47)
2021-06-08T18:25:10.2521330Z 	at org.junit.jupiter.api.AssertNotNull.assertNotNull(AssertNotNull.java:36)
2021-06-08T18:25:10.2523032Z 	at org.junit.jupiter.api.AssertNotNull.assertNotNull(AssertNotNull.java:31)
2021-06-08T18:25:10.2524757Z 	at org.junit.jupiter.api.Assertions.assertNotNull(Assertions.java:283)
2021-06-08T18:25:10.2526885Z 	at io.quarkus.restclient.registerclientheaders.MyHeadersFactory.update(MyHeadersFactory.java:21)

It seems that the BeanManager was not injected in extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/registerclientheaders.MyHeadersFactory.java


This code here:


needs to be changed to your new 3 argument version that takes a BeanManager that was introduced here:


Unfortunately this is not enough, that commit also added a hard dependency on CdiConstructorInjector which is in resteasy-cdi. resteasy-cdi is not compatible with Quarkus and is excluded, so this code cannot work with Quarkus.

 

@Singleton
public class MyHeadersFactory implements ClientHeadersFactory {

    @Inject
    BeanManager beanManager;

    @Override
    public MultivaluedMap<String, String> update(MultivaluedMap<String, String> incomingHeaders,
            MultivaluedMap<String, String> clientOutgoingHeaders) {
        assertNotNull(beanManager);
        incomingHeaders.add("foo", "bar");
        return incomingHeaders;
    }

}


2. "MicroProfile TCKs Tests":

I see

2021-06-08T18:22:43.2475781Z [ERROR] org.eclipse.microprofile.rest.client.tck.cditests.CDIClientHeadersFactoryTest.testClientHeadersFactoryInvoked  Time elapsed: 0.436 s  <<< FAILURE!
2021-06-08T18:22:43.2479615Z java.lang.NullPointerException
2021-06-08T18:22:43.2481018Z 	at org.glassfish.json.JsonObjectBuilderImpl$JsonObjectImpl.getString(JsonObjectBuilderImpl.java:233)
2021-06-08T18:22:43.2485890Z 	at org.eclipse.microprofile.rest.client.tck.cditests.CDIClientHeadersFactoryTest.testClientHeadersFactoryInvoked(CDIClientHeadersFactoryTest.java:87)

It looks like

    @Inject
    private Counter counter;

in org.eclipse.microprofile.rest.client.tck.ext.CdiCustomClientHeadersFactory might not have been injected ...


Sounds like the same issue.
 

3. "Native Tests - Main ", "Native Tests - Messaging1", "Native Tests - Security2", "Native Tests - Security2", "Native Tests - Security3", "Native Tests - Cache", "Native Tests - HTTP":

I see

2021-06-08T18:43:38.1584421Z Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: org.jboss.resteasy.cdi.CdiConstructorInjector. To diagnose the issue you can use the --allow-incomplete-classpath option. The missing type is then reported at run time when it is accessed the first time.
2021-06-08T18:43:38.1587308Z Detailed message:
2021-06-08T18:43:38.1587734Z Trace: 
2021-06-08T18:43:38.1590244Z 	at parsing org.jboss.resteasy.microprofile.client.header.ClientHeaderProviders.construct(ClientHeaderProviders.java:107)

I tried adding 

	<quarkus.native.additional-build-args>--allow-incomplete-classpath</quarkus.native.additional-build-args>

to properties of the native-image profile in integration-tests/main/pom.xml, but it didn't help.


Same issue.

Stuart
 

--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/551a8f7b-a860-e619-82c8-5ac9fc93c3a4%40redhat.com.

Stuart Douglas

unread,
Jun 8, 2021, 8:45:06 PM6/8/21
to Ronald Sigal, Quarkus Development mailing list
Actually looks like resteasy-cdi can work if you remove the exclusion, I just had a corrupt local repo.


Should resolve the issues you are having.

Stuart

Ron Sigal

unread,
Jun 9, 2021, 7:58:40 PM6/9/21
to quark...@googlegroups.com

It works!! I'm deeply grateful.

Reply all
Reply to author
Forward
0 new messages