CXF - too many dependencies

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

CXF - too many dependencies

smalik
Hi, I'm working on a Java application doing various integration work using Camel.

I now need to send a POJO to an external running web service for the first time.
So this should be simple, I simply need to have a producer endpoint using CXF.

However, the number of dependencies required by the CXF component is huge (having a look in camel-cxf project, its around 100 jars). This is going to be tricky, as my application is a legacy one that is non-Maven, non-Spring, so I don't really want to have to pull in all these jars just for a simple POJO webservice call.

Have I got something wrong, is cxf really so large? I looked here for its minimum dependencies (http://svn.apache.org/repos/asf/cxf/trunk/distribution/src/main/release/lib/WHICH_JARS) but its not really clear to me what the critical jars are for my purpose.

Any advice here appreciated.

thanks
Reply | Threaded
Open this post in threaded view
|

Re: CXF - too many dependencies

Sergey Beryozkin
We've discussed this issue recently where we showed that in CXF 3.1.x a
number of dependencies for a given CXF frontend has been dramatically
decreased.

So first try to move to Camel which uses CXF 3.1.x - Camel 2.16.0 to be
released soon for example.

As far as camel-cxf is concerned it is indeed has a modularity  issue of
its own - CXF JAX-RS was piggy-backed on top of CXF JAX-WS there which
adds a certain dependency overhead - which can still be easily managed
by explicitly excluding either of the frontends if needed.
Camel JIRA issue exists for getting camel-cxf split and have a new
camel-cxfrs module introduced - it will be addressed at some point

Sergey

On 08/09/15 16:19, smalik wrote:

> Hi, I'm working on a Java application doing various integration work using
> Camel.
>
> I now need to send a POJO to an external running web service for the first
> time.
> So this should be simple, I simply need to have a producer endpoint using
> CXF.
>
> However, the number of dependencies required by the CXF component is huge
> (having a look in camel-cxf project, its around 100 jars). This is going to
> be tricky, as my application is a legacy one that is non-Maven, non-Spring,
> so I don't really want to have to pull in all these jars just for a simple
> POJO webservice call.
>
> Have I got something wrong, is cxf really so large? I looked here for its
> minimum dependencies
> (http://svn.apache.org/repos/asf/cxf/trunk/distribution/src/main/release/lib/WHICH_JARS)
> but its not really clear to me what the critical jars are for my purpose.
>
> Any advice here appreciated.
>
> thanks
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/CXF-too-many-dependencies-tp5771344.html
> Sent from the Camel Development mailing list archive at Nabble.com.
>


--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/
Reply | Threaded
Open this post in threaded view
|

Re: CXF - too many dependencies

smalik
Thanks Sergey.

Unfortunately I can't wait long enough for Camel 2.16 I have a delivery pretty soon :)

Ok so indeed the camel-cxf stuff looks quite bloated for my purposes.

Do you know of any other (lightweight) Camel endpoint I can use for the purpose of sending a POJO to a webservice? http, restlet? Or maybe I'll have to write my own Camel endpoint. The service I am calling is provided by Axis 2, unfortunately there is no axis endpoint in camel, apparently it got replaced by the bloated cxf!

cheers



Reply | Threaded
Open this post in threaded view
|

Re: CXF - too many dependencies

David J. M. Karlsen
Axis would be my least favourite choice - what about spring-ws ?
http://camel.apache.org/spring-web-services.html

2015-09-08 19:25 GMT+02:00 smalik <[hidden email]>:

> Thanks Sergey.
>
> Unfortunately I can't wait long enough for Camel 2.16 I have a delivery
> pretty soon :)
>
> Ok so indeed the camel-cxf stuff looks quite bloated for my purposes.
>
> Do you know of any other (lightweight) Camel endpoint I can use for the
> purpose of sending a POJO to a webservice? http, restlet? Or maybe I'll
> have
> to write my own Camel endpoint. The service I am calling is provided by
> Axis
> 2, unfortunately there is no axis endpoint in camel, apparently it got
> replaced by the bloated cxf!
>
> cheers
>
>
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/CXF-too-many-dependencies-tp5771344p5771350.html
> Sent from the Camel Development mailing list archive at Nabble.com.
>



--
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
Reply | Threaded
Open this post in threaded view
|

Re: CXF - too many dependencies

Aki Yoshida-3
In reply to this post by smalik
hi smalik,
it is true as Sergey mentioned that the current camel-cxf 2.15.x
brings both jaxws and jaxrs minimal requirements and that is too much
when you want to use only one or the other.

But you still won't be needing a hundred of jars to just run a plain
soap based service call, though.
When using cxf-3.0.6 with camel-2.15.3, a minimal camel file to cxf
soap call scenario using spring will need something like this:

[INFO] +- org.apache.camel:camel-cxf:jar:2.15.3:compile
[INFO] |  +- org.apache.camel:camel-core:jar:2.15.3:compile
[INFO] |  |  \- org.slf4j:slf4j-api:jar:1.6.6:compile
[INFO] |  +- org.apache.camel:camel-cxf-transport:jar:2.15.3:compile
[INFO] |  +- org.apache.cxf:cxf-rt-frontend-jaxrs:jar:3.0.6:compile
[INFO] |  |  +- org.apache.cxf:cxf-core:jar:3.0.6:compile
[INFO] |  |  |  +- org.codehaus.woodstox:woodstox-core-asl:jar:4.4.1:compile
[INFO] |  |  |  |  \- org.codehaus.woodstox:stax2-api:jar:3.1.4:compile
[INFO] |  |  |  \- org.apache.ws.xmlschema:xmlschema-core:jar:2.2.1:compile
[INFO] |  |  +- javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile
[INFO] |  |  +- javax.annotation:javax.annotation-api:jar:1.2:compile
[INFO] |  |  \- org.apache.cxf:cxf-rt-transports-http:jar:3.0.6:compile
[INFO] |  +- org.apache.cxf:cxf-rt-frontend-jaxws:jar:3.0.6:compile
[INFO] |  |  +- xml-resolver:xml-resolver:jar:1.2:compile
[INFO] |  |  +- asm:asm:jar:3.3.1:compile
[INFO] |  |  +- org.apache.cxf:cxf-rt-bindings-xml:jar:3.0.6:compile
[INFO] |  |  \- org.apache.cxf:cxf-rt-frontend-simple:jar:3.0.6:compile
[INFO] |  +- org.apache.cxf:cxf-rt-rs-security-oauth:jar:3.0.6:compile
[INFO] |  |  +- org.apache.cxf:cxf-rt-rs-client:jar:3.0.6:compile
[INFO] |  |  \- net.oauth.core:oauth-provider:jar:20100527:compile
[INFO] |  |     \- net.oauth.core:oauth:jar:20100527:compile
[INFO] |  +- org.springframework:spring-core:jar:4.1.6.RELEASE:compile
[INFO] |  |  \- commons-logging:commons-logging:jar:1.2:compile
[INFO] |  +- org.apache.cxf:cxf-rt-bindings-soap:jar:3.0.6:compile
[INFO] |  |  +- org.apache.cxf:cxf-rt-wsdl:jar:3.0.6:compile
[INFO] |  |  |  \- wsdl4j:wsdl4j:jar:1.6.3:compile
[INFO] |  |  \- org.apache.cxf:cxf-rt-databinding-jaxb:jar:3.0.6:compile
[INFO] |  +- com.sun.xml.bind:jaxb-core:jar:2.2.11:compile
[INFO] |  \- com.sun.xml.bind:jaxb-impl:jar:2.2.11:compile
[INFO] +- org.apache.camel:camel-spring:jar:2.15.3:compile
[INFO] |  +- org.springframework:spring-aop:jar:4.1.6.RELEASE:compile
[INFO] |  |  \- aopalliance:aopalliance:jar:1.0:compile
[INFO] |  \- org.springframework:spring-tx:jar:4.1.6.RELEASE:compile
[INFO] +- org.springframework:spring-context:jar:3.2.13.RELEASE:compile
[INFO] |  \- org.springframework:spring-expression:jar:3.2.13.RELEASE:compile
[INFO] \- org.springframework:spring-beans:jar:3.2.13.RELEASE:compile




2015-09-08 19:25 GMT+02:00 smalik <[hidden email]>:

> Thanks Sergey.
>
> Unfortunately I can't wait long enough for Camel 2.16 I have a delivery
> pretty soon :)
>
> Ok so indeed the camel-cxf stuff looks quite bloated for my purposes.
>
> Do you know of any other (lightweight) Camel endpoint I can use for the
> purpose of sending a POJO to a webservice? http, restlet? Or maybe I'll have
> to write my own Camel endpoint. The service I am calling is provided by Axis
> 2, unfortunately there is no axis endpoint in camel, apparently it got
> replaced by the bloated cxf!
>
> cheers
>
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/CXF-too-many-dependencies-tp5771344p5771350.html
> Sent from the Camel Development mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: CXF - too many dependencies

Christian Schneider
In reply to this post by smalik
Are you sure you really need camel-cxf for this.
How about just using a simple cxf client and call it from the camel
route using java.
This way you can already use the minimal set of dependencies of the most
current cxf release.

Christian


Am 08.09.2015 um 19:25 schrieb smalik:

> Thanks Sergey.
>
> Unfortunately I can't wait long enough for Camel 2.16 I have a delivery
> pretty soon :)
>
> Ok so indeed the camel-cxf stuff looks quite bloated for my purposes.
>
> Do you know of any other (lightweight) Camel endpoint I can use for the
> purpose of sending a POJO to a webservice? http, restlet? Or maybe I'll have
> to write my own Camel endpoint. The service I am calling is provided by Axis
> 2, unfortunately there is no axis endpoint in camel, apparently it got
> replaced by the bloated cxf!
>
> cheers
>
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/CXF-too-many-dependencies-tp5771344p5771350.html
> Sent from the Camel Development mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: CXF - too many dependencies

smalik
In reply to this post by Aki Yoshida-3
Thanks Aki.

I tried your suggestion, yes you are right actually, if I create a new maven project, just pulling in the 3 jars you mention (camel-cxf, camel-spring, spring-context, and their transitive dependencies), it seems to be happy. In fact it also needs jib-x and log4j, but once I include them its about 50 jars total. Unfortunately could not quite get this solution working for some other reasons (complaining about jibx bindings when sending the message). I used another solution./

Reply | Threaded
Open this post in threaded view
|

Re: CXF - too many dependencies

smalik
In the end I ended up using some java client classes provided to me by the team who expose the service, so I wrapped these in a camel bean and simply call the bean to do the web service call. These classes depend on axis2. I will retake a look at getting the cxf working when I get a bit of time, as you are right Christian perhaps I dont need the full camel-cxf, I can just use a simple cxf client call.

thanks for the help all!