Uploaded image for project: 'Thorntail'
  1. Thorntail
  2. THORN-1144

[Camel-cxf]Can't add custom cxf interceptor

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2017.1.1, 2017.2.0
    • Fix Version/s: 2017.6.0
    • Component/s: None
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      Just call the service to see the exception.

      Show
      Just call the service to see the exception.

      Description

      When adding custom interceptor, when invoking the service an error occurs :

      2017-02-28 22:02:38,122 ERROR [io.undertow.request] (default task-1) UT005023: Exception handling request to /camel/greeting: java.lang.ClassCastException: org.wildfly.swarm.examples.camel.cxf.jaxws.SimpleInterceptor cannot be cast to org.apache.cxf.phase.PhaseInterceptor
              at org.apache.cxf.phase.PhaseInterceptorChain.add(PhaseInterceptorChain.java:232)
              at org.apache.cxf.phase.PhaseInterceptorChain.add(PhaseInterceptorChain.java:223)
              at org.apache.cxf.phase.PhaseInterceptorChain.add(PhaseInterceptorChain.java:214)
              at org.apache.cxf.phase.PhaseChainCache.getChain(PhaseChainCache.java:89)
              at org.apache.cxf.phase.PhaseChainCache.get(PhaseChainCache.java:71)
              at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:105)
              at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:254)
              at org.apache.cxf.transport.undertow.UndertowHTTPDestination.doService(UndertowHTTPDestination.java:187)
              at org.apache.cxf.transport.undertow.UndertowHTTPDestination.doService(UndertowHTTPDestination.java:173)
              at org.apache.cxf.transport.undertow.wildfly.WildflyHTTPServerEngine$DefaultServlet.service(WildflyHTTPServerEngine.java:99)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
              at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
              at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
              at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
              at org.wildfly.swarm.generated.FaviconErrorHandler.handleRequest(FaviconErrorHandler.java:62)
              at io.undertow.server.handlers.PathHandler.handleRequest(PathHandler.java:94)
              at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
              at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
              at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
              at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
              at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
              at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
              at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
              at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
              at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
              at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
              at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
              at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
              at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
              at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
              at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
              at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:805)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:745)
      

      Gist : https://gist.github.com/fpirson/ca76b157b60961a5cd8b4256909b465b

      I have just adapted the camel-cxf-jaxws example by adding a custom interceptor

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                fpirson1981 Frédéric Pirson
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: