0

I have a problem with setting holders in my output message. I have following simple routing and processor:

from("cxf:bean:ewidencjaEndpoint")
    .process(new ProcessResult())
    .end();

public class ProcessResult implements Processor {

    public void process(Exchange exchange) throws Exception {

        Object[] args =  exchange.getIn().getBody(Object[].class);

        long id = (long) args[0];
        Holder<A> dataA = (Holder<A>) args[1];
        Holder<B> dataB = (Holder<B>) args[2];

        exchange.getOut().setBody(new Object[]{ dataA, dataB});

}

I get the following error:

java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at org.apache.cxf.jaxws.interceptors.HolderInInterceptor.handleMessage(HolderInInterceptor.java:67)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:737)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2335)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:2198)

I've read many similar problems descriped on web (ie.: http://camel.465427.n5.nabble.com/java-lang-IndexOutOfBoundsException-in-cxf-producer-td468541.html) but without any success in resolving the problem.

In debug I get output message like:

Exchange[Message[null,null, A@xxxm B@yyy]]

I don't understand what the foolowing "null" values come from. I've got only 2 outputs values (in Holders) according to wsdl file (and generated interface). I see also in debug console that in 'out' part of exchange body I have only 2 values set in ProcessResult()(idexed from 2 to 3), and size value of the 'out' part is set to '4' (not 2) ?

TomekB
  • 451
  • 1
  • 4
  • 10

0 Answers0