ServiceMix
  1. ServiceMix
  2. SM-1900

servicemix-cxf-bc componet can't locate services

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 3.3.1
    • Fix Version/s: None
    • Component/s: servicemix-cxf-bc
    • Labels:
      None
    • Environment:

      Description

      The servicemix-cxf-bc doesn't work inside a Tomcat server.

      The problem is that the service destinations aren't found by the destination factory.
      I think this problem isn't Tomcat specific. It should occur if servicemix is deployed as a war inside some application server.
      I would suggest the following fix:

      1.) Implement a ServletTransportFactory (see attachment 1)
      2.) Register this ServletTransportFactory in the default cxf.xml (classpath root, see attachment 2)

      It's important to note that one needs to configure the CXF default bus with org.apache.servicemix.web.cxf.CXFManagedServlet.
      If one uses the spring based CXF configuration method, the servicemix-cxf-bc and the servlet will have different application contexts and thus it won't work.

      Kind regrades

      Christian

      1. cxf.xml
        2 kB
        Christian Connert
      2. TomcatDestinationFactory.java
        0.7 kB
        Christian Connert

        Activity

        Hide
        Freeman Fang added a comment -

        Hi Christian,

        Thanks for the patch
        But I believe SM-1756 already fix this issue, the org.apache.servicemix.web.cxf.CXFManagedServlet will always grap bus used in cxf-bc and do the servlet transport replace and register there.

        Do you see any problem when you work with 3.3.1?

        Freeman

        Show
        Freeman Fang added a comment - Hi Christian, Thanks for the patch But I believe SM-1756 already fix this issue, the org.apache.servicemix.web.cxf.CXFManagedServlet will always grap bus used in cxf-bc and do the servlet transport replace and register there. Do you see any problem when you work with 3.3.1? Freeman
        Hide
        Christian Connert added a comment -

        Hi Freeman,

        Sorry for the late reply but i was rather busy.

        I'm and was working 3.3.1. I think that the problem isn't related to SM-1756 because it uses the servlet transport but the static method getTrimmedPath (which only removes http(s)://localhost/ prefixes) of CXF ServletTransportFacotry doesn't respects deployment inside web application. It's indirectly called by the ServletController (getDestinationForPath) with the (HttpServlertRequest) request.getPathInfo() which is only the additional request path (e.g.: /someService), without any web app prefix. But the getDestination(EndpointInfo endpointInfo) use the soap address of the wsdl e.g.(http://localhost:8080/SomeApp/services/someService).

        I hope this helps.

        Christian

        Show
        Christian Connert added a comment - Hi Freeman, Sorry for the late reply but i was rather busy. I'm and was working 3.3.1. I think that the problem isn't related to SM-1756 because it uses the servlet transport but the static method getTrimmedPath (which only removes http(s)://localhost/ prefixes) of CXF ServletTransportFacotry doesn't respects deployment inside web application. It's indirectly called by the ServletController (getDestinationForPath) with the (HttpServlertRequest) request.getPathInfo() which is only the additional request path (e.g.: /someService), without any web app prefix. But the getDestination(EndpointInfo endpointInfo) use the soap address of the wsdl e.g.( http://localhost:8080/SomeApp/services/someService ). I hope this helps. Christian
        Hide
        Gert Vanthienen added a comment -

        Bulk-closing older issues for Apache ServiceMix 3.x since we're no longer actively working on these at the moment.

        Show
        Gert Vanthienen added a comment - Bulk-closing older issues for Apache ServiceMix 3.x since we're no longer actively working on these at the moment.

          People

          • Assignee:
            Freeman Fang
            Reporter:
            Christian Connert
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development