camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Came <>
Subject RE: File consumer to CXF issues
Date Wed, 02 Mar 2011 15:54:23 GMT
I continue to see very strange behavior here...  When I look in Eclipse at the "Maven dependencies"
section of my build path, camel-cxf.jar is not there (a lot of other camel and cxf stuff is
there).  What could be causing Maven / m2eclipse not to bring this jar into the project?

Incidentally, it's not an Eclipse problem...I get the same problem when I run mvn install
from the command line.  The following dependency in my pom is apparently not making any difference
at compile time...



Snippet of results from running mvn install:

[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 2 source files to /Users/scott/Documents/eclipse-workspaces/workspace-servicemix-dev/tsc-connector/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure

package org.apache.camel.component.cxf does not exist

cannot find symbol
symbol  : class CxfPayload
location: class CxfPayloadConverter

-----Original Message-----
From: Scott Came [] 
Sent: Tuesday, March 01, 2011 7:47 AM
Subject: RE: File consumer to CXF issues

Thanks, Willem.

I am having trouble getting this is what I'm trying...  I downloaded the source
file you linked (I also need to download NodeListWrapper, in the same package).  I have changed
the package to something application-specific (for now, I just have it in the default package),
then dropped the source file into src/main/java in my project (i.e., the structure containing
src/main/resources/META-INF/spring/camel-context.xml that defines my camel route that needs
the type converter).

When I do this (in Eclipse), the java source file won't compile, because it can't find org.apache.camel.component.cxf.CxfPayload.
 My pom declares a dependency on camel-cxf (where I assume this class is defined), so I would
expect it to compile.  Eclipse doesn't have an issue with the org.apache.camel imports in
the source file.  Do I need to do something else with the pom to get it to find org.apache.camel.component.cxf.CxfPayload?

By the way, I am following the instructions here:,
which is about all I could find on implementing a custom type converter.


-----Original Message-----
From: Willem Jiang []
Sent: Sunday, February 27, 2011 6:46 PM
Subject: Re: File consumer to CXF issues

Hi Scott,

We just added a CXFPayloadConverter[1][2] into Camel 2.7-SNAPSHOT last month.
You can put this converter into your application if you still need to use camel 2.6.0.


On 2/26/11 11:28 PM, Scott Came wrote:
> The file contains XML...the root element of the xml document in the file is the child
element of soap:body.
> I tried MESSAGE and it seems the CXF component is expecting the file to contain the entire
SOAP message (envelope and body), which would be a pain to create.  I'd rather avoid POJO
mode since I really don't want to have to generate code.  But nonetheless I tried it and ran
into a whole bunch more exceptions...probably wasn't configuring it right.
> I'd rather learn how to write a converter and do that than have to generate code.
> How do I explore whether there is a converter missing?  Again, it's surprising that there
isn't a converter that will take a GenericFile (or String) and plop it into the soap:body,
since that seems like such a common there must be something I'm missing.
> Thanks.
> -----Original Message-----
> From: Claus Ibsen []
> Sent: Friday, February 25, 2011 11:35 PM
> To:
> Subject: Re: File consumer to CXF issues
> Hi
> What does your file contain?
> Often people use either POJO or MESSAGE format. So there could be a converter to/from
CxfPayload missing. Especially for String, byte[], streams which is common types.
> On Sat, Feb 26, 2011 at 7:53 AM, Scott Came<>  wrote:
>> After looking at this a bit more (and upgrading to the 4.3.1-fuse-00-00 version of
ServiceMix, which contains Camel 2.6.0), it seems the problem boils down to Camel not knowing
how to convert a GenericFile (what results from the<from>  part of the route) to a CxfPayload
(what is expected by the<to>  part of the route).
>> Am I on the right track here?
>> If so, is there an available converter that does that?  It seems like a fairly common
scenario to pick up an XML document that fits the schema for a particular SOAP operation and
send that document in the body of a SOAP message to a web service.  So I'm surprised this
isn't built in...perhaps it is, and I'm just not doing something correctly.
>> By the way, I tried using convertBodyTo to convert the input file to java.lang.String
and org.w3c.dom.Document, and those efforts resulted in exceptions too.
>> Any help appreciated.
>> Thanks.
>> --Scott
>> -----Original Message-----
>> From: Scott Came []
>> Sent: Friday, February 25, 2011 1:57 PM
>> To:
>> Subject: File consumer to CXF issues
>> I have a route that looks like this:
>> <osgi:camelContext xmlns="">
>>     <route>
>>       <from uri="file:/tmp/tsc-input"/>
>>       <to uri="cxf:bean:outEndpoint"/>
>>     </route>
>>   </osgi:camelContext>
>> (As you can tell, I'm deploying this in ServiceMix, but the issue I'm 
>> having is in the Camel realm, thus my posting here...)
>> I have defined outEndpoint earlier in the camel-context.xml file using cxfEndpoint.
>> This route is creating exceptions over several different techniques.
>> What I really would like is not to generate code using cxf's wsdl2java (following
this example ( though, I did).  I would
like to use<to uri="cxf:bean:outEndpoint?dataFormat=PAYLOAD"/>  which, as I understand
it, should not require code generation.  However, when I try to do it this way, I get a NullPointerException
in org.apache.camel.component.cxf.CxfEndpoint, at line 577, in the setParameters() method.
>> I don't see anything in the documentation of the Camel CXF component that states
or implies that this isn't supported on the client side.
>> So my question is...  Is it possible to use the cxf component in the 
>> <to>  part of a Camel route, WSDL-first, and not generate code, but 
>> rather have it (under the covers) use the JAX-WS Dispatch approach?
>> Is there an example anywhere that does this (I've looked at all the 
>> examples on the Camel website, and several blog postings, and 
>> couldn't find anything that matched my scenario...)
>> If it would be better to post this on the CXF or even ServiceMix lists, please advise.
>> Thanks.
>> --Scott
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email:
> Web:
> Twitter: davsclaus
> Blog:
> Author of Camel in Action:

Blog: (English)
Twitter: willemjiang

View raw message