Uploaded image for project: 'JBoss Web Services'
  1. JBoss Web Services
  2. JBWS-4430

Sever throws IllegalStateException when call a handler with the CDI bean invocation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • jbossws-cxf-7.3.0.Final
    • jbossws-cxf-7.2.0.Final
    • jbossws-cxf
    • None

      This issue happens after https://issues.redhat.com/browse/JBWS-4385 is fixed and sever throws IllegalStateException when call a handler with the CDI bean invocation:

       

      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//jakarta.enterprise.inject.spi.CDI.lambda$getCDIProvider$0(CDI.java:98) at java.base/java.util.Optional.orElseThrow(Optional.java:403) at jakarta.enterprise.api@4.0.1.redhat-00001//jakarta.enterprise.inject.spi.CDI.getCDIProvider(CDI.java:98) at jakarta.enterprise.api@4.0.1//jakarta.enterprise.inject.spi.CDI.current(CDI.java:65) at deployment.jaxws-server.war//org.example.soap.DelegateBean.<init>(DelegateBean.java:8) at deployment.jaxws-server.war//org.example.soap.LoggingHandler.handleMessage(LoggingHandler.java:17) at deployment.jaxws-server.war//org.example.soap.LoggingHandler.handleMessage(LoggingHandler.java:11) at org.apache.cxf.impl//org.apache.cxf.jaxws.handler.HandlerChainInvoker.invokeHandleMessage(HandlerChainInvoker.java:355) at org.apache.cxf.impl//org.apache.cxf.jaxws.handler.HandlerChainInvoker.invokeHandlerChain(HandlerChainInvoker.java:254) at org.apache.cxf.impl//org.apache.cxf.jaxws.handler.HandlerChainInvoker.invokeProtocolHandlers(HandlerChainInvoker.java:131)

       
       

      public class LoggingHandler implements SOAPHandler<SOAPMessageContext> {
      @Override
      public boolean handleMessage(SOAPMessageContext soapMessageContext) {
      boolean isOutBound = (boolean) soapMessageContext.get(SOAPMessageContext.MESSAGE_OUTBOUND_PROPERTY);
      if (isOutBound) {
      System.out.println("### TCCL in SOAPHandler = " + Thread.currentThread().getContextClassLoader().toString());
      new DelegateBean();
      } return true;
      } ..... }

       
      DelegateBean.java

      @Dependent
      public class DelegateBean {
          EmptyBean logic = CDI.current().select(EmptyBean.class).get();
      } 

       

       

       

            rhn-engineering-ema Jim Ma
            rhn-engineering-ema Jim Ma
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: