You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Paul Lowry <pl...@newbay.com> on 2011/06/30 13:31:44 UTC

camel-cxf in tomcat cannot process multiple parameters

Hi all,

I seem to have encountered a bug in Camel-XCF when running in Tomcat (as
described in http://camel.apache.org/cxf-tomcat-example )

I am using a wsdl-first approach, whereas the demo is java-first; but I
don't think this makes any difference.

The problem is: I can invoke any methods in my SEI which have one
parameter; but if I define a method with two or more parameters, only
the first one is processed by Camel; the others are all null.

My WSDL is valid wrapped-doc-literal:
<types>
 <schema>
  <element name="handleTwoArgs">
   <complexType>
    <sequence>
     <element name="input1" type="xsd:string"/>
     <element name="input2" type="xsd:int"/>
    </sequence>
   </complexType>
  </element>
  ...
<message name="handleTwoArgs">
 <part name="request" element="tns:handleTwoArgs"/>
</message>
....
<portType name="TestPort">
 <operation name="handleTwoArgs">
  <input name="handleTwoArgs" message="tns:handleTwoArgs"/>
  ...
<binding name="TestBinding" type="tns:TestPort">
 <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
  <operation name="handleTwoArgs">
   <soap:operation soapAction="" style="document"/>
    <input name="handleTwoArgs">
     <soap:body use="literal" />
    </input>
    ...

But as the trace logs show, only the first input parameter is being
processed by Camel-CXF:
TRACE component.bean.MethodInfo  - >>>> invoking: public
java.lang.String
com.test.webservice.TestWebServiceImpl.handleTwoArgs(java.lang.String,int) on bean: com.test.webservice.TestWebServiceImpl@7e05c4 with arguments: {foo, null} for exchange: Exchange[Message: [foo, 1]]

The problem appears to be in one of these classes:
org.apache.camel.impl.converter.DefaultTypeConverter
org.apache.camel.component.cxf.converter.CxfConverter

The above classes are responsible for converting an incoming message
(type=org.apache.cxf.message.MessageContentsList) into another message
type.

In my example, Camel sending the message to a bean processor, so
CxfConverter should be converting the MessageContentsList into
BeanInvocation. But the same problem occurs when I use a file producer
instead of a bean, so I reckon the problem is in the CxfConverter code,
or the handling of type MessageContentsList, rather than the mapping to
type BeanInvocation.

The attached tar file contains:
- a demo which reproduces the problem
- log files from running the demo (see handleTwoArgs.log)

I tried upgrading from Camel 2.6.0 to 2.7.3-SNAPSHOT, and from CXF 2.3.2
to 2.3.6-SNAPSHOT, but the behaviour did not change.

I could work around the problem by nesting all data in one complex
parameter; but this approach is not suitable, because the client is
already in production and I am integrating with it, so I cannot modify
its wsdl.

I might be able to pre-process the message exchange, converting the
MessageContentsList to a suitable type; but I would need help doing
this, and it's a bit of a hack, so...

Is there any (better) solution?

Kind Regards,

Paul

STRICTLY PRIVATE, CONFIDENTIAL AND PRIVILEGED COMMUNICATION.

This message (including attachments) may contain information that is
privileged, confidential or protected from disclosure. They are intended
solely for the use of the intended recipient. If you are not the
intended recipient, you are hereby notified that dissemination,
disclosure, copying, distribution, printing, transmission or use of this
message or any information contained in it is strictly prohibited. If
you have received this message from NewBay Software in error, please
immediately notify the sender by reply email and delete this message
from your computer. The content of this e-mail, and any files
transmitted with it, may have been changed or altered without the
consent of the author. Although we have taken steps to ensure that this
email and attachments are free from any virus, we advise that in keeping
with good computing practice the recipient should ensure they are
actually virus free.

Re: camel-cxf in tomcat cannot process multiple parameters

Posted by plowry <pl...@newbay.com>.
The axis consumer works!

Thanks for all the help Willem :)

Regards,
Paul


--
View this message in context: http://camel.465427.n5.nabble.com/camel-cxf-in-tomcat-cannot-process-multiple-parameters-tp4538511p4542653.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel-cxf in tomcat cannot process multiple parameters

Posted by plowry <pl...@newbay.com>.
Trying the Axis approach now...

--
View this message in context: http://camel.465427.n5.nabble.com/camel-cxf-in-tomcat-cannot-process-multiple-parameters-tp4538511p4541680.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel-cxf in tomcat cannot process multiple parameters

Posted by Willem Jiang <wi...@gmail.com>.
On 7/1/11 4:17 PM, plowry wrote:
> Hi willem,
>
> I know CXF doesn't support JAX-RPC WSDL, but is there any way to make it
> accept RPC/encoded messages?
>
> For instance, has any progress been made on the Aegis databinding?
> http://cxf.547215.n5.nabble.com/RPC-Encoded-support-td574781.html
> RPC/Encoded Support (cxf-dev)

I read this thread today and don't find any further progress.
Maybe we should bring this discuss back to dev@cxf again.

>
> Could I define an Aegis mapping by hand, to convert my customer's
> RPC/encoded SOAP messages into my JAXB classes?
>
> Or would I be better off using Axis?
> http://camel.apache.org/tutorial-axis-camel.html Camel Axis Tutorial
>
That could be another way to accept the RPC/encoded request :)

> Regards,
> Paul
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/camel-cxf-in-tomcat-cannot-process-multiple-parameters-tp4538511p4541339.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang

Re: camel-cxf in tomcat cannot process multiple parameters

Posted by plowry <pl...@newbay.com>.
Hi willem,

I know CXF doesn't support JAX-RPC WSDL, but is there any way to make it
accept RPC/encoded messages?

For instance, has any progress been made on the Aegis databinding?
http://cxf.547215.n5.nabble.com/RPC-Encoded-support-td574781.html
RPC/Encoded Support (cxf-dev) 

Could I define an Aegis mapping by hand, to convert my customer's
RPC/encoded SOAP messages into my JAXB classes?

Or would I be better off using Axis?
http://camel.apache.org/tutorial-axis-camel.html Camel Axis Tutorial 

Regards,
Paul

--
View this message in context: http://camel.465427.n5.nabble.com/camel-cxf-in-tomcat-cannot-process-multiple-parameters-tp4538511p4541339.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel-cxf in tomcat cannot process multiple parameters

Posted by Willem Jiang <wi...@gmail.com>.
Hi,
CXF is an implementation of JAX-WS which doesn't support the rpc/encoded.
On 6/30/11 10:42 PM, plowry wrote:
> Just to put this in context, there is a bigger problem I'm trying to solve...
>
> I have two requirements:
> 1) deploy my Camel-CXF web service using Tomcat
> 2) accept calls from a JAX-RPC WSDL-based client
>
> I am currently stuck on #1, because I cannot accept messages with multiple
> parameters.
>
> When #1 is solved, I intend to test #2 by using the following JAX-RPC WSDL
> to generate a SOAPUI client:
> http://camel.465427.n5.nabble.com/file/n4539072/test-jaxrpc.wsdl
> test-jaxrpc.wsdl
>
> But if there is no solution for #2, then I am wasting my time.
>
> So tell me, is it possible to do this?
>
> Thanks,
> Paul
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/camel-cxf-in-tomcat-cannot-process-multiple-parameters-tp4538511p4539072.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang

Re: camel-cxf in tomcat cannot process multiple parameters

Posted by boday <be...@initekconsulting.com>.
for #1, did you follow this guide
(http://camel.apache.org/cxf-tomcat-example.html) ??


plowry wrote:
> 
> Just to put this in context, there is a bigger problem I'm trying to
> solve...
> 
> I have two requirements:
> 1) deploy my Camel-CXF web service using Tomcat
> 2) accept calls from a JAX-RPC WSDL-based client
> 
> I am currently stuck on #1, because I cannot accept messages with multiple
> parameters.
> 
> When #1 is solved, I intend to test #2 by using the following JAX-RPC WSDL
> to generate a SOAPUI client:
>  http://camel.465427.n5.nabble.com/file/n4539072/test-jaxrpc.wsdl
> test-jaxrpc.wsdl 
> 
> But if there is no solution for #2, then I am wasting my time.
> 
> So tell me, is it possible to do this?
> 
> Thanks,
> Paul
> 


-----
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: http://camel.465427.n5.nabble.com/camel-cxf-in-tomcat-cannot-process-multiple-parameters-tp4538511p4540311.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel-cxf in tomcat cannot process multiple parameters

Posted by plowry <pl...@newbay.com>.
Just to put this in context, there is a bigger problem I'm trying to solve...

I have two requirements:
1) deploy my Camel-CXF web service using Tomcat
2) accept calls from a JAX-RPC WSDL-based client

I am currently stuck on #1, because I cannot accept messages with multiple
parameters.

When #1 is solved, I intend to test #2 by using the following JAX-RPC WSDL
to generate a SOAPUI client:
http://camel.465427.n5.nabble.com/file/n4539072/test-jaxrpc.wsdl
test-jaxrpc.wsdl 

But if there is no solution for #2, then I am wasting my time.

So tell me, is it possible to do this?

Thanks,
Paul

--
View this message in context: http://camel.465427.n5.nabble.com/camel-cxf-in-tomcat-cannot-process-multiple-parameters-tp4538511p4539072.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel-cxf in tomcat cannot process multiple parameters

Posted by plowry <pl...@newbay.com>.
Note: I added logging statements to the CxfConverter and BeanConverter source
files; if these extra statements are confusing, just ignore them.

--
View this message in context: http://camel.465427.n5.nabble.com/camel-cxf-in-tomcat-cannot-process-multiple-parameters-tp4538511p4538992.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel-cxf in tomcat cannot process multiple parameters

Posted by plowry <pl...@newbay.com>.
Hi Willem

Here is the tar file.

http://camel.465427.n5.nabble.com/file/n4538980/camel-cxf-tomcat-problem.tar
camel-cxf-tomcat-problem.tar 

The log (snipped) reads as follows:

2011-06-30 15:06:04,504 [http-8080-1] TRACE component.cxf.CxfConsumer  -
Received CXF Request: {org.apache.cxf.service.Service=[ServiceImpl
{http://www.test.com}TestPortService],
javax.xml.ws.wsdl.port={http://www.test.com}TestPortPort,
javax.xml.ws.wsdl.interface={http://www.test.com}TestPort,
org.apache.cxf.service.model.OperationInfo=[OperationInfo:
{http://www.test.com}handleTwoArgs],
java.util.concurrent.Executor=org.apache.cxf.workqueue.SynchronousExecutor@bb1bc4,
javax.xml.ws.wsdl.description=http://localhost:8080/camel-cxf-tomcat-problem-1.0.0/webservices/test?wsdl,
org.apache.cxf.Bus=org.apache.cxf.bus.CXFBusImpl@1396ef7,
javax.xml.ws.wsdl.service={http://www.test.com}TestPortService,
org.apache.cxf.binding.Binding=org.apache.cxf.binding.soap.SoapBinding@1bfefb,
org.apache.cxf.endpoint.Endpoint={},
org.apache.cxf.service.model.BindingOperationInfo=[BindingOperationInfo:
{http://www.test.com}handleTwoArgs]}
2011-06-30 15:06:04,504 [http-8080-1] TRACE component.cxf.CxfConsumer  -
Calling the Camel sync processors.
2011-06-30 15:06:04,504 [http-8080-1] TRACE component.cxf.CxfConsumer  - Set
exchange property: BindingOperationInfo: [BindingOperationInfo:
{http://www.test.com}handleTwoArgs]
2011-06-30 15:06:04,504 [http-8080-1] TRACE component.cxf.CxfConsumer  - Set
Exchange property: org.apache.camel.component.cxf.DataFormat=POJO
2011-06-30 15:06:04,504 [http-8080-1] TRACE component.cxf.DefaultCxfBinding 
- Set IN header: operationNamespace=http://www.test.com
2011-06-30 15:06:04,504 [http-8080-1] TRACE component.cxf.DefaultCxfBinding 
- Set IN header: operationName=handleTwoArgs
2011-06-30 15:06:04,504 [http-8080-1] TRACE component.cxf.DefaultCxfBinding 
- Set exchange MEP: InOut
2011-06-30 15:06:04,504 [http-8080-1] TRACE component.cxf.DefaultCxfBinding 
- Populate header from CXF header=content-type
value=[text/xml;charset=UTF-8]
2011-06-30 15:06:04,504 [http-8080-1] TRACE component.cxf.DefaultCxfBinding 
- Populate header from CXF header=host value=[localhost:8080]
2011-06-30 15:06:04,504 [http-8080-1] TRACE component.cxf.DefaultCxfBinding 
- Populate header from CXF header=SOAPAction value=[""]
2011-06-30 15:06:04,504 [http-8080-1] TRACE component.cxf.DefaultCxfBinding 
- Populate header from CXF header=user-agent value=[Jakarta
Commons-HttpClient/3.1]
2011-06-30 15:06:04,504 [http-8080-1] TRACE component.cxf.DefaultCxfBinding 
- Populate header from CXF header=accept-encoding value=[gzip,deflate]
2011-06-30 15:06:04,504 [http-8080-1] TRACE component.cxf.DefaultCxfBinding 
- Populate header from CXF header=Content-Type
value=[text/xml;charset=UTF-8]
2011-06-30 15:06:04,504 [http-8080-1] TRACE
component.cxf.CxfHeaderFilterStrategy  - messageHeaderfilter =
org.apache.camel.component.cxf.SoapMessageHeaderFilter@146ac5a
2011-06-30 15:06:04,504 [http-8080-1] TRACE component.cxf.DefaultCxfBinding 
- Populate header from CXF header=org.apache.cxf.headers.Header.list
value=[]
2011-06-30 15:06:04,504 [http-8080-1] TRACE component.cxf.DefaultCxfBinding 
- Content format=interface org.w3c.dom.Node value=[#document: null]
2011-06-30 15:06:04,504 [http-8080-1] TRACE component.cxf.DefaultCxfBinding 
- Content format=interface java.util.List value=[foo, 1]
2011-06-30 15:06:04,504 [http-8080-1] TRACE component.cxf.DefaultCxfBinding 
- Content format=class java.io.InputStream
value=org.apache.cxf.transport.http.AbstractHTTPDestination$1@bf9a12
2011-06-30 15:06:04,504 [http-8080-1] TRACE component.cxf.DefaultCxfBinding 
- Content format=class org.apache.cxf.io.DelegatingInputStream
value=org.apache.cxf.transport.http.AbstractHTTPDestination$1@bf9a12
2011-06-30 15:06:04,504 [http-8080-1] TRACE component.cxf.DefaultCxfBinding 
- Content format=interface javax.xml.stream.XMLStreamReader
value=com.ctc.wstx.sr.ValidatingStreamReader@11c248a
2011-06-30 15:06:04,504 [http-8080-1] TRACE component.cxf.DefaultCxfBinding 
- Extracted body from CXF message = [foo, 1]
2011-06-30 15:06:04,504 [http-8080-1] TRACE component.cxf.CxfConsumer  -
Processing +++ START +++
2011-06-30 15:06:04,505 [http-8080-1] TRACE camel.impl.DefaultUnitOfWork  -
UnitOfWork created for ExchangeId: ID-CZC107DGDF-41901-1309442727732-0-3
with Exchange[Message: [foo, 1]]
2011-06-30 15:06:04,505 [http-8080-1] TRACE
camel.impl.DefaultInflightRepository  - Total 1 inflight exchanges. Last
added: ID-CZC107DGDF-41901-1309442727732-0-3
2011-06-30 15:06:04,505 [http-8080-1] DEBUG camel.processor.SendProcessor  -
>>>> Endpoint[bean://TestWebServiceImpl?method=handleTwoArgs]
Exchange[Message: [foo, 1]]
2011-06-30 15:06:04,505 [http-8080-1] TRACE
impl.converter.DefaultTypeConverter  - Converting
com.test.webservice.TestWebServiceImpl -> org.apache.camel.Processor with
value: com.test.webservice.TestWebServiceImpl@39471b
2011-06-30 15:06:04,505 [http-8080-1] TRACE
impl.converter.DefaultTypeConverter  - Converting
org.apache.cxf.message.MessageContentsList ->
org.apache.camel.component.bean.BeanInvocation with value: [foo, 1]
2011-06-30 15:06:04,505 [http-8080-1] TRACE cxf.converter.CxfConverter  -
CXF fallback type converter invoked : converting
org.apache.cxf.message.MessageContentsList to
org.apache.camel.component.bean.BeanInvocation
2011-06-30 15:06:04,505 [http-8080-1] TRACE cxf.converter.CxfConverter  -
CXF fallback type converter returning void type (value cannot be converted)
2011-06-30 15:06:04,505 [http-8080-1] TRACE
impl.converter.DefaultTypeConverter  - Converting
org.apache.camel.impl.DefaultMessage ->
org.apache.camel.component.bean.BeanInvocation with value: Message: [foo, 1]
2011-06-30 15:06:04,505 [http-8080-1] TRACE cxf.converter.CxfConverter  -
CXF fallback type converter invoked : converting
org.apache.camel.impl.DefaultMessage to
org.apache.camel.component.bean.BeanInvocation
2011-06-30 15:06:04,505 [http-8080-1] TRACE cxf.converter.CxfConverter  -
CXF type not assignable; returning null
2011-06-30 15:06:04,506 [http-8080-1] TRACE component.bean.BeanConverter  -
Bean type converter invoked : converting
org.apache.camel.impl.DefaultMessage to
org.apache.camel.component.bean.BeanInvocation
2011-06-30 15:06:04,506 [http-8080-1] TRACE component.bean.BeanConverter  -
Bean type not assignable; returning null
2011-06-30 15:06:04,506 [http-8080-1] TRACE component.bean.BeanInfo  -
Chosen method to invoke: public java.lang.String
com.test.webservice.TestWebServiceImpl.handleTwoArgs(java.lang.String,int)
on bean: com.test.webservice.TestWebServiceImpl@39471b
2011-06-30 15:06:04,506 [http-8080-1] TRACE
impl.converter.DefaultTypeConverter  - Converting
org.apache.cxf.message.MessageContentsList ->
org.apache.camel.component.bean.BeanInvocation with value: [foo, 1]
2011-06-30 15:06:04,506 [http-8080-1] TRACE cxf.converter.CxfConverter  -
CXF fallback type converter invoked : converting
org.apache.cxf.message.MessageContentsList to
org.apache.camel.component.bean.BeanInvocation
2011-06-30 15:06:04,506 [http-8080-1] TRACE cxf.converter.CxfConverter  -
CXF fallback type converter returning void type (value cannot be converted)
2011-06-30 15:06:04,506 [http-8080-1] TRACE
impl.converter.DefaultTypeConverter  - Converting
org.apache.camel.impl.DefaultMessage ->
org.apache.camel.component.bean.BeanInvocation with value: Message: [foo, 1]
2011-06-30 15:06:04,506 [http-8080-1] TRACE cxf.converter.CxfConverter  -
CXF fallback type converter invoked : converting
org.apache.camel.impl.DefaultMessage to
org.apache.camel.component.bean.BeanInvocation
2011-06-30 15:06:04,506 [http-8080-1] TRACE cxf.converter.CxfConverter  -
CXF type not assignable; returning null
2011-06-30 15:06:04,506 [http-8080-1] TRACE component.bean.BeanConverter  -
Bean type converter invoked : converting
org.apache.camel.impl.DefaultMessage to
org.apache.camel.component.bean.BeanInvocation
2011-06-30 15:06:04,506 [http-8080-1] TRACE component.bean.BeanConverter  -
Bean type not assignable; returning null
2011-06-30 15:06:04,506 [http-8080-1] TRACE
impl.converter.DefaultTypeConverter  - Converting
org.apache.cxf.message.MessageContentsList -> java.lang.String with value:
[foo, 1]
2011-06-30 15:06:04,507 [http-8080-1] TRACE cxf.converter.CxfConverter  -
CXF fallback type converter invoked : converting
org.apache.cxf.message.MessageContentsList to java.lang.String
2011-06-30 15:06:04,507 [http-8080-1] INFO  cxf.converter.CxfConverter  -
CXF fallback type converter returning param #1
2011-06-30 15:06:04,507 [http-8080-1] TRACE
impl.converter.DefaultTypeConverter  - Fallback type converter
StaticMethodFallbackTypeConverter: public static java.lang.Object
org.apache.camel.component.cxf.converter.CxfConverter.convertTo(java.lang.Class,org.apache.camel.Exchange,java.lang.Object,org.apache.camel.spi.TypeConverterRegistry)
converted type from: java.lang.String to:
org.apache.cxf.message.MessageContentsList
2011-06-30 15:06:04,507 [http-8080-1] TRACE
impl.converter.DefaultTypeConverter  - Converting java.lang.String ->
java.lang.Object with value: foo
2011-06-30 15:06:04,507 [http-8080-1] TRACE
impl.converter.DefaultTypeConverter  - Converting java.lang.String ->
java.lang.String with value: foo
2011-06-30 15:06:04,507 [http-8080-1] TRACE component.bean.MethodInfo  -
Parameter #0 evaluated as: foo type: class java.lang.String
2011-06-30 15:06:04,507 [http-8080-1] TRACE component.bean.MethodInfo  -
>>>> invoking: public java.lang.String
com.test.webservice.TestWebServiceImpl.handleTwoArgs(java.lang.String,int)
on bean: com.test.webservice.TestWebServiceImpl@39471b with arguments: {foo,
null} for exchange: Exchange[Message: [foo, 1]]
2011-06-30 15:06:04,507 [http-8080-1] TRACE
camel.management.InstrumentationProcessor  - to: Recording duration: 2
millis for exchange: Exchange[Message: [foo, 1]]
2011-06-30 15:06:04,507 [http-8080-1] TRACE
camel.management.InstrumentationProcessor  - route: Recording duration: 2
millis for exchange: Exchange[Message: [foo, 1]]
2011-06-30 15:06:04,507 [http-8080-1] TRACE camel.impl.DefaultUnitOfWork  -
UnitOfWork done for ExchangeId: ID-CZC107DGDF-41901-1309442727732-0-3 with
Exchange[Message: [foo, 1]]
2011-06-30 15:06:04,507 [http-8080-1] TRACE
camel.impl.DefaultInflightRepository  - Total 0 inflight exchanges. Last
removed: ID-CZC107DGDF-41901-1309442727732-0-3
2011-06-30 15:06:04,507 [http-8080-1] TRACE camel.util.AsyncProcessorHelper 
- Exchange processed and is continued routed synchronously for exchangeId:
ID-CZC107DGDF-41901-1309442727732-0-3 -> Exchange[Message: [foo, 1]]
2011-06-30 15:06:04,507 [http-8080-1] TRACE camel.util.AsyncProcessorHelper 
- Exchange processed and is continued routed synchronously for exchangeId:
ID-CZC107DGDF-41901-1309442727732-0-3 -> Exchange[Message: [foo, 1]]
2011-06-30 15:06:04,507 [http-8080-1] TRACE camel.util.AsyncProcessorHelper 
- Exchange processed and is continued routed synchronously for exchangeId:
ID-CZC107DGDF-41901-1309442727732-0-3 -> Exchange[Message: [foo, 1]]
2011-06-30 15:06:04,507 [http-8080-1] TRACE camel.util.AsyncProcessorHelper 
- Exchange processed and is continued routed synchronously for exchangeId:
ID-CZC107DGDF-41901-1309442727732-0-3 -> Exchange[Message: [foo, 1]]
2011-06-30 15:06:04,507 [http-8080-1] TRACE component.cxf.CxfConsumer  -
Processing +++ END +++
30-Jun-2011 15:06:04 org.apache.cxf.phase.PhaseInterceptorChain
doDefaultLogging
WARNING: Interceptor for
{http://www.test.com}TestPortService#{http://www.test.com}handleTwoArgs has
thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: IllegalArgumentException
	at
org.apache.camel.component.cxf.CxfConsumer$1.checkFailure(CxfConsumer.java:219)
	at
org.apache.camel.component.cxf.CxfConsumer$1.setResponseBack(CxfConsumer.java:196)
	at
org.apache.camel.component.cxf.CxfConsumer$1.syncInvoke(CxfConsumer.java:143)
	at org.apache.camel.component.cxf.CxfConsumer$1.invoke(CxfConsumer.java:78)
	at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
	at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
	at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:113)
	at
org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:97)
	at
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:461)
	at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:188)
	at
org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:148)
	at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
	at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
	at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
	at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.IllegalArgumentException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:322)
	at
org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:224)
	at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:167)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)
	at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:74)
	at
org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:102)
	at
org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:72)
	at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
	at
org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:104)
	at
org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:272)
	at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:98)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
	at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)
	at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:269)
	at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)
	at
org.apache.camel.component.cxf.CxfConsumer$1.syncInvoke(CxfConsumer.java:136)
	... 29 more

--
View this message in context: http://camel.465427.n5.nabble.com/camel-cxf-in-tomcat-cannot-process-multiple-parameters-tp4538511p4538980.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel-cxf in tomcat cannot process multiple parameters

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

I can't see the log or the demo.
Can you show me your route configure and error log ?

On 6/30/11 7:31 PM, Paul Lowry wrote:
> Hi all,
>
> I seem to have encountered a bug in Camel-XCF when running in Tomcat (as
> described in http://camel.apache.org/cxf-tomcat-example )
>
> I am using a wsdl-first approach, whereas the demo is java-first; but I
> don't think this makes any difference.
>
> The problem is: I can invoke any methods in my SEI which have one
> parameter; but if I define a method with two or more parameters, only
> the first one is processed by Camel; the others are all null.
>
> My WSDL is valid wrapped-doc-literal:
> <types>
>   <schema>
>    <element name="handleTwoArgs">
>     <complexType>
>      <sequence>
>       <element name="input1" type="xsd:string"/>
>       <element name="input2" type="xsd:int"/>
>      </sequence>
>     </complexType>
>    </element>
>    ...
> <message name="handleTwoArgs">
>   <part name="request" element="tns:handleTwoArgs"/>
> </message>
> ....
> <portType name="TestPort">
>   <operation name="handleTwoArgs">
>    <input name="handleTwoArgs" message="tns:handleTwoArgs"/>
>    ...
> <binding name="TestBinding" type="tns:TestPort">
>   <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
> style="document"/>
>    <operation name="handleTwoArgs">
>     <soap:operation soapAction="" style="document"/>
>      <input name="handleTwoArgs">
>       <soap:body use="literal" />
>      </input>
>      ...
>
> But as the trace logs show, only the first input parameter is being
> processed by Camel-CXF:
> TRACE component.bean.MethodInfo  ->>>>  invoking: public
> java.lang.String
> com.test.webservice.TestWebServiceImpl.handleTwoArgs(java.lang.String,int) on bean: com.test.webservice.TestWebServiceImpl@7e05c4 with arguments: {foo, null} for exchange: Exchange[Message: [foo, 1]]
>
> The problem appears to be in one of these classes:
> org.apache.camel.impl.converter.DefaultTypeConverter
> org.apache.camel.component.cxf.converter.CxfConverter
>
> The above classes are responsible for converting an incoming message
> (type=org.apache.cxf.message.MessageContentsList) into another message
> type.
>
> In my example, Camel sending the message to a bean processor, so
> CxfConverter should be converting the MessageContentsList into
> BeanInvocation. But the same problem occurs when I use a file producer
> instead of a bean, so I reckon the problem is in the CxfConverter code,
> or the handling of type MessageContentsList, rather than the mapping to
> type BeanInvocation.
>
> The attached tar file contains:
> - a demo which reproduces the problem
> - log files from running the demo (see handleTwoArgs.log)
>
> I tried upgrading from Camel 2.6.0 to 2.7.3-SNAPSHOT, and from CXF 2.3.2
> to 2.3.6-SNAPSHOT, but the behaviour did not change.
>
> I could work around the problem by nesting all data in one complex
> parameter; but this approach is not suitable, because the client is
> already in production and I am integrating with it, so I cannot modify
> its wsdl.
>
> I might be able to pre-process the message exchange, converting the
> MessageContentsList to a suitable type; but I would need help doing
> this, and it's a bit of a hack, so...
>
> Is there any (better) solution?
>
> Kind Regards,
>
> Paul
>
> STRICTLY PRIVATE, CONFIDENTIAL AND PRIVILEGED COMMUNICATION.
>
> This message (including attachments) may contain information that is
> privileged, confidential or protected from disclosure. They are intended
> solely for the use of the intended recipient. If you are not the
> intended recipient, you are hereby notified that dissemination,
> disclosure, copying, distribution, printing, transmission or use of this
> message or any information contained in it is strictly prohibited. If
> you have received this message from NewBay Software in error, please
> immediately notify the sender by reply email and delete this message
> from your computer. The content of this e-mail, and any files
> transmitted with it, may have been changed or altered without the
> consent of the author. Although we have taken steps to ensure that this
> email and attachments are free from any virus, we advise that in keeping
> with good computing practice the recipient should ensure they are
> actually virus free.


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang