java.lang.IllegalStateException: Unable to access CDI is thrown from SOAPHandler in EAP 8.0.3+ and 7.4.19+
Issue
When CDI.current()
is called from JAX-WS SOAPHandler, java.lang.IllegalStateException
is thrown. It works until JBoss EAP 7.4.18 and 8.0.3.1, but we can see the following WARNING
messages in server.log after applying patches 7.4.19+ or 8.0.3+.
EAP 8.0.3.1:
2024-10-22 15:35:43,181 WARNING [org.apache.cxf.jaxws.handler.HandlerChainInvoker] (default task-2) Handler execution raised a runtime exception.: java.lang.IllegalStateException: Unable to access CDI
at jakarta.enterprise.api@4.0.1.redhat-00001//jakarta.enterprise.inject.spi.CDI.lambda$getCDIProvider$0(CDI.java:98)
...
EAP 7.4.19:
2024-10-22 15:36:18,744 WARNING [org.apache.cxf.jaxws.handler.HandlerChainInvoker] (default task-2) Handler execution raised a runtime exception.: java.lang.IllegalStateException: WFLYWELD0039: Singleton not set for org.jboss.ws.common.utils.DelegateClassLoader@49134e6f. This means that you are trying to access a weld deployment with a Thread Context ClassLoader that is not associated with the deployment.
at org.jboss.as.weld@7.4.19.GA-redhat-00002//org.jboss.as.weld.services.ModuleGroupSingletonProvider$TCCLSingleton.get(ModuleGroupSingletonProvider.java:77)
...
Environment
- Red Hat JBoss Enterprise Application Server (EAP)
- 7.4.19+
- 8.0.3+
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.