Reputation: 1
I'm experiencing an issue with JAX-RS resource initialization in a specific application on TomEE 8.0.13 using CXF 3.4.10. Out of 400 deployed applications, only one consistently throws a NullPointerException related to JAX-RS services when trying to create the HTTP listener. Interestingly, this issue resolves after a server restart, but I’d like to identify the root cause and fix it permanently.
Error Details:
Here’s the stack trace I get on deployment:
2024-09-06 20:06:40.038|ERROR|a-utility-10| | ObserverManager:417|error invoking org.apache.tomee.webservices.TomeeJaxRsService@1d77746b
java.lang.NullPointerException: null
at java.util.TreeMap.rotateLeft(TreeMap.java:2224) ~[?:1.8.0_311]
at java.util.TreeMap.fixAfterInsertion(TreeMap.java:2291) ~[?:1.8.0_311]
at java.util.TreeMap.put(TreeMap.java:582) ~[?:1.8.0_311]
at org.apache.tomee.webservices.TomcatRsRegistry.createRsHttpListener(TomcatRsRegistry.java:141) ~[tomee-jaxrs-8.0.13.jar:8.0.13]
at org.apache.openejb.server.rest.RESTService.deployApplication(RESTService.java:543) ~[openejb-rest-8.0.13.jar:8.0.13]
...
The key error seems to occur at:
at org.apache.tomee.webservices.TomcatRsRegistry.createRsHttpListener(TomcatRsRegistry.java:141)
** Setup:**
TomEE 8.0.13 tomee-jaxrs-8.0.13.jar CXF 3.4.10 (manually upgraded from 3.4.8) OpenEJB 8.0.13 Note: The tomee-jaxrs-8.0.13 JAR is dependent on CXF 3.4.8 by default
What I’ve Tried: Upgrading CXF to 3.4.10: Since the other applications are working fine, I suspect that this particular application's classloading or JAX-RS resource discovery may be conflicting with TomEE's bundled JAX-RS implementation.
JAR Conflicts: I checked for classloading conflicts, and while CXF 3.4.10 and TomEE JAX-RS 8.0.13 seem to coexist, I suspect that upgrading TomEE JAX-RS to 8.0.15 might help, but I haven’t tested that yet.
Debug Logging: I enabled debug logs for CXF, JAX-RS, and OpenEJB, but I haven't found any obvious signs of misconfiguration beyond this error.
What I Need Help With:
Classloading Conflicts: How can I definitively check for classloading issues between TomEE JAX-RS, CXF, and OpenEJB? Are there known issues with upgrading CXF to 3.4.10 on TomEE 8.0.13? Application-Specific Threading: Could this be caused by an application-specific issue related to how resources or threads are being initialized for this app, given that the issue resolves after a server restart?
Compatibility: ****Should I upgrade tomee-jaxrs to 8.0.15 (or a higher version) to resolve this, and would that be compatible with CXF 3.4.10? Any guidance on how to fix this issue or better isolate the problem would be greatly appreciated!
Upvotes: 0
Views: 26