CXF
  1. CXF
  2. CXF-3021

Try to remove a wsdl4J dependency from the JAXRS frontend

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 3.0.0-milestone1
    • Component/s: JAX-RS
    • Labels:
      None

      Description

      HTTP Transport and API modules depend strongly at runtime on javax.wsdl.* (wsdl4j)

      1. cxf3021.patch
        5 kB
        Sergey Beryozkin
      2. cxf3021-2.patch
        29 kB
        Sergey Beryozkin

        Activity

        Hide
        Sergey Beryozkin added a comment -

        This patch removes a javax.wsdl.Port reference from WSDLEndpointFactory interface

        Show
        Sergey Beryozkin added a comment - This patch removes a javax.wsdl.Port reference from WSDLEndpointFactory interface
        Hide
        Sergey Beryozkin added a comment -

        1. Basic EndpointReferenceType utility code is moved to WSAEndpointReferenceTypeUtils, with EndpointReferenceTypeUtils delegating to it.

        2. Non-WSDL code in AbstractBindingFactory has been pushed to AbstractBaseEndpointFactory which AbstractBindingFactory extends

        3. Last resort catch statements have been put in HTTP transport around HttpPolicy and Address extensions which are linked to javax.wsdl.ExtensibilityElement : this is the least ideal piece of this patch - with the rationale being that the relevant code is only making sense in WSDL-first developments

        Show
        Sergey Beryozkin added a comment - 1. Basic EndpointReferenceType utility code is moved to WSAEndpointReferenceTypeUtils, with EndpointReferenceTypeUtils delegating to it. 2. Non-WSDL code in AbstractBindingFactory has been pushed to AbstractBaseEndpointFactory which AbstractBindingFactory extends 3. Last resort catch statements have been put in HTTP transport around HttpPolicy and Address extensions which are linked to javax.wsdl.ExtensibilityElement : this is the least ideal piece of this patch - with the rationale being that the relevant code is only making sense in WSDL-first developments
        Hide
        Sergey Beryozkin added a comment -

        HttpConduit still needs on the client side -> HttpClientPolicy

        Show
        Sergey Beryozkin added a comment - HttpConduit still needs on the client side -> HttpClientPolicy
        Hide
        Sergey Beryozkin added a comment -

        This issue has been fixed, sorry, only clients accessing HttpConduit.getClient() will need it - some thinking is needed how to drop that dependency. CXF JAX-RS wiki has been updated too, wsdl4j dep is still included (for the clients to work) but can be excluded on the server side

        Show
        Sergey Beryozkin added a comment - This issue has been fixed, sorry, only clients accessing HttpConduit.getClient() will need it - some thinking is needed how to drop that dependency. CXF JAX-RS wiki has been updated too, wsdl4j dep is still included (for the clients to work) but can be excluded on the server side
        Hide
        Travis Finch added a comment -

        Recently upgraded from CXF 2.2.12 to 2.4 for our JAX-RS server. We are using embedded Jetty 7.3.1.

        I tried to remove wsdl4j from our server-side dependency list, but server fails when launching. Here is the stack trace:

        !ENTRY org.eclipse.osgi 4 0 2011-05-04 00:10:34.897
        !MESSAGE Application error
        !STACK 1
        java.lang.NoClassDefFoundError: javax/wsdl/extensions/ElementExtensible
        at java.lang.Class.getDeclaredFields0(Native Method)
        at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
        at java.lang.Class.getField0(Class.java:2618)
        at java.lang.Class.getField(Class.java:1518)
        at org.apache.cxf.transport.TransportFinder$3.loadBean(TransportFinder.java:200)
        at org.apache.cxf.bus.extension.ExtensionManagerImpl.loadBeansOfType(ExtensionManagerImpl.java:267)
        at org.apache.cxf.transport.TransportFinder.loadDefaultURIs(TransportFinder.java:212)
        at org.apache.cxf.transport.TransportFinder.findTransportForURI(TransportFinder.java:81)
        at org.apache.cxf.transport.DestinationFactoryManagerImpl.getDestinationFactoryForUri(DestinationFactoryManagerImpl.java:132)
        at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.createEndpointInfo(AbstractJAXRSFactoryBean.java:125)
        at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.createEndpoint(AbstractJAXRSFactoryBean.java:207)
        at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:147)
        at com.vmware.vide.ws.WsServer.start(WsServer.java:167)

        From WsServer:

        164: JAXRSServerFactoryBean factory = new JAXRSServerFactoryBean();
        165: factory.setResourceProviders(providers);
        166: factory.setAddress("http://0.0.0.0:8080/");
        167: Server server = factory.create();

        If I add wsdl4j back, everything works find with 2.4. I compared the patch attached to this issue with the 2.4 source, and it does not look like the entire patch was applied.

        Any ideas?

        Show
        Travis Finch added a comment - Recently upgraded from CXF 2.2.12 to 2.4 for our JAX-RS server. We are using embedded Jetty 7.3.1. I tried to remove wsdl4j from our server-side dependency list, but server fails when launching. Here is the stack trace: !ENTRY org.eclipse.osgi 4 0 2011-05-04 00:10:34.897 !MESSAGE Application error !STACK 1 java.lang.NoClassDefFoundError: javax/wsdl/extensions/ElementExtensible at java.lang.Class.getDeclaredFields0(Native Method) at java.lang.Class.privateGetDeclaredFields(Class.java:2291) at java.lang.Class.getField0(Class.java:2618) at java.lang.Class.getField(Class.java:1518) at org.apache.cxf.transport.TransportFinder$3.loadBean(TransportFinder.java:200) at org.apache.cxf.bus.extension.ExtensionManagerImpl.loadBeansOfType(ExtensionManagerImpl.java:267) at org.apache.cxf.transport.TransportFinder.loadDefaultURIs(TransportFinder.java:212) at org.apache.cxf.transport.TransportFinder.findTransportForURI(TransportFinder.java:81) at org.apache.cxf.transport.DestinationFactoryManagerImpl.getDestinationFactoryForUri(DestinationFactoryManagerImpl.java:132) at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.createEndpointInfo(AbstractJAXRSFactoryBean.java:125) at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.createEndpoint(AbstractJAXRSFactoryBean.java:207) at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:147) at com.vmware.vide.ws.WsServer.start(WsServer.java:167) From WsServer: 164: JAXRSServerFactoryBean factory = new JAXRSServerFactoryBean(); 165: factory.setResourceProviders(providers); 166: factory.setAddress("http://0.0.0.0:8080/"); 167: Server server = factory.create(); If I add wsdl4j back, everything works find with 2.4. I compared the patch attached to this issue with the 2.4 source, and it does not look like the entire patch was applied. Any ideas?
        Hide
        Sergey Beryozkin added a comment -

        it may be a regression - unfortunately I don't have tests on the trunk - more investigation is needed

        Show
        Sergey Beryozkin added a comment - it may be a regression - unfortunately I don't have tests on the trunk - more investigation is needed
        Hide
        Sergey Beryozkin added a comment -

        Hi - it appears that works in a non-Spring case, but with Spring we are getting some early resolution happening. Actually - I think I know what is happening,
        can you please add
        "factory.setTransportId("http://cxf.apache.org/transports/http");"

        that should avoid the early loading, please confirm when you get a chance, as I'm keen now to close this JIRA
        thanks

        Show
        Sergey Beryozkin added a comment - Hi - it appears that works in a non-Spring case, but with Spring we are getting some early resolution happening. Actually - I think I know what is happening, can you please add "factory.setTransportId("http://cxf.apache.org/transports/http");" that should avoid the early loading, please confirm when you get a chance, as I'm keen now to close this JIRA thanks

          People

          • Assignee:
            Daniel Kulp
            Reporter:
            Sergey Beryozkin
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development