L.S.,

The FileAuditor should be able to handle all kinds of exchanges. It uses a TeeInputStream in order to handle StreamSources more efficiently (i.e. without converting them into a DOMSource or something first), but it should be perfectly capable of handling all others kinds of XML Sources as well. I have just added a test to ensure it handles DOMSource objects as well and that doesn't show a problem. Could you send the full stack trace you are getting?
Regards,

Gert

KOS schreef:
Hi

the org.apache.servicemix.jbi.audit.file.FileAuditor, which can be started
by putting  <audit:fileAuditor container="#jbi" directory="file:data/audit"
/> in the servicemix.xml, leads to a NPE in Interceptor.handleMessage()
methods, in my case always in BodyOutInterceptor.handleMessage().
It only happens when exchange.getMessage("in").getContent() is of type
StaxSource or DOMSource, because then SourceTransformer is used, which
causes in the end this error. If it is of type StreamSource, everything
works correctly.

The same as with the FileAuditor happens when debugging is turned on in
ServiceMix, as explained in an earlier post:
http://www.nabble.com/http%3Asoap-provider-doesn%27t-return-%28StaxUtils%29%2C-bug--tt21252942.html
The workaround for this problem, as supposed as answer to my post, was to
turn off debugging. This works.

But how can I use the FileAuditor then? Or how can I intercept DOMSource or
StaxSource efficiently, as the SourceTransformer doesn't work correctly? Do
I need to parse the XMLStreamReader 'by hand'? This is a lot of work, as I
only want to copy the content of the message/stream.

The Exception can be produced by sending e.g. a soap-request using
http:soap-consumer, http:soap-provider. Then, the content of the
NormalizedMessage is of type StaxSource.

Thanks for hints.

Reply via email to