Wildfly 33.0.0.Final: Can't use org.jboss.resteasy:resteasy-rxjava2

29 views
Skip to first unread message

nicolas duminil

unread,
Sep 3, 2024, 10:41:23 AM9/3/24
to WildFly
Hello,
I need to deploy some RESTeasy services which use RxJava2 API. I'm then using the following maven dependencies (among others):
   
    <dependency>
      <groupId>org.jboss.resteasy</groupId>
      <artifactId>resteasy-rxjava2</artifactId>
      <version>${resteasy.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.reactivex.rxjava2</groupId>
      <artifactId>rxjava</artifactId>
      <version>2.2.21</version>
    </dependency>

However, the code using classes like `FlowableRxInvokerProvider` or
`FlowableRxInvoker` doesn't compile as they aren't resolved. Not sure what's the problem with this artifact as, looking inside, I can see that the referred classes exist.

Could anyone please let me know what might the problem here ?

James Perkins

unread,
Sep 3, 2024, 11:24:47 AM9/3/24
to WildFly
The io.reactivex.rxjava2:rxjava should be marked as <scope>provided</scope>. You need to add a global dependency or use a jboss-deployment-structure.xml to add a dependency to org.jboss.resteasy.resteasy-rxjava2.
Message has been deleted

nicolas duminil

unread,
Sep 3, 2024, 4:51:06 PM9/3/24
to WildFly
Nope, setting at provided the scope of io.reactivex.rxjava2:rxjava raises the following exception:

3391 INFO  [docker-java-stream-1563602434] fr.simplex_software.react.rxjava2.test.TimeZoneStreamResourceIT     
- STDOUT: 22:15:21,876 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 16) MSC000001: Failed to start service jboss.deployment.unit."ROOT.war".undertow-deployment: org.jboss.msc.service.StartException in service jboss.deployment.unit."ROOT.war".undertow-deployment: java.lang.NoClassDefFoundError: io/reactivex/Flowable
3391 INFO  [docker-java-stream-1563602434] fr.simplex_software.react.rxjava2.test.TimeZoneStreamResourceIT     
- STDOUT:        at org.wildfly.ext...@33.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:73)
3391 INFO  [docker-java-stream-1563602434] fr.simplex_software.react.rxjava2.test.TimeZoneStreamResourceIT     
- STDOUT:        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
3391 INFO  [docker-java-stream-1563602434] fr.simplex_software.react.rxjava2.test.TimeZoneStreamResourceIT     
- STDOUT:        at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
3392 INFO  [docker-java-stream-1563602434] fr.simplex_software.react.rxjava2.test.TimeZoneStreamResourceIT     
- STDOUT:        at org.jbos...@2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
3392 INFO  [docker-java-stream-1563602434] fr.simplex_software.react.rxjava2.test.TimeZoneStreamResourceIT     
- STDOUT:        at org.jbos...@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
3392 INFO  [docker-java-stream-1563602434] fr.simplex_software.react.rxjava2.test.TimeZoneStreamResourceIT     
- STDOUT:        at org.jbos...@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
3392 INFO  [docker-java-stream-1563602434] fr.simplex_software.react.rxjava2.test.TimeZoneStreamResourceIT     
- STDOUT:        at org.jbos...@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
3392 INFO  [docker-java-stream-1563602434] fr.simplex_software.react.rxjava2.test.TimeZoneStreamResourceIT     
- STDOUT:        at java.base/java.lang.Thread.run(Unknown Source)
3392 INFO  [docker-java-stream-1563602434] fr.simplex_software.react.rxjava2.test.TimeZoneStreamResourceIT     
- STDOUT:        at org.jbos...@2.4.0.Final//org.jboss.threads.JBossThread.run(JBossThread.java:513)

Declaring org.jboss.resteasy.resteasy-rxjava2 as a global dependency isn't compliant with build tools like Maven, as for jboss-dependency-structure.xml, I forgot to mention that I'm deploying on Wildfly bootable, where the class loading rules implemented by this file don't apply. Any other more appropriate suggestions ?

Thank you anyway.
Reply all
Reply to author
Forward
0 new messages