Hi -
AFAIK, on the server side you can only get outFaultInterceptors called,
while the regular in interceptors will get their handleFault called in
case of exceptions escaping on the inbound chain
And the other way around on the client side
HTH, Sergey
On 06/12/12 16:13, Ivan Latysh wrote:
Hello All!
Apache CXF 2.4.0
I have a bus and a multiple jaxrs servers.
Using CXFServlet with spring.
The main issue is that inFaultInterceptors are not called at all. Does
not matter the phase they are registered on.
If anyone can point me out on what am I doing wrong would be great.
[bus]
<cxf:bus>
<cxf:inInterceptors>
<ref bean="logInbound"/>
</cxf:inInterceptors>
<cxf:outInterceptors>
<ref bean="logOutbound"/>
</cxf:outInterceptors>
<cxf:inFaultInterceptors>
<ref bean="faultInInterceptor"/>
</cxf:inFaultInterceptors>
<cxf:outFaultInterceptors>
<ref bean="faultOutInterceptor"/>
</cxf:outFaultInterceptors>
</cxf:bus>
[/bus]
[server]
<jaxrs:server id="MyServices" address="/endpoint">
<jaxrs:serviceBeans>
<ref bean="myServiceBean" />
</jaxrs:serviceBeans>
<jaxrs:inFaultInterceptors>
<ref bean="faultInInterceptor"/>
</jaxrs:inFaultInterceptors>
<jaxrs:outFaultInterceptors>
<ref bean="faultOutInterceptor"/>
</jaxrs:outFaultInterceptors>
</jaxrs:server>
[/server]
[log for {Unparseable date: "12Wew"} exception]
23:08:52: 98786 DEBUG org.apache.cxf.jaxrs.utils.JAXRSUtils - Resource
operation getUser on the resource class com.MyServiceBeanImpl has been
selected
23:08:52: 98787 DEBUG
org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor - Request path is:
/users/get_user
23:08:52: 98787 DEBUG
org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor - Request HTTP
method is: GET
23:08:52: 98787 DEBUG
org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor - Request
contentType is: */*
23:08:52: 98788 DEBUG
org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor - Accept contentType
is: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
23:08:52: 98788 DEBUG
org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor - Found operation:
getUser
23:08:52: 98801 WARN
org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper -
WebApplicationException has been caught : Unparseable date: "12Wew"
23:08:52: 98801 DEBUG org.apache.cxf.phase.PhaseInterceptorChain -
Invoking handleMessage on interceptor
org.apache.cxf.interceptor.OneWayProcessorInterceptor@68bc42e
23:08:52: 98801 DEBUG org.apache.cxf.phase.PhaseInterceptorChain -
Invoking handleMessage on interceptor
org.apache.cxf.interceptor.ServiceInvokerInterceptor@4806198f
23:08:52: 98805 DEBUG org.apache.cxf.phase.PhaseInterceptorChain -
Invoking handleMessage on interceptor
org.apache.cxf.interceptor.OutgoingChainInterceptor@878203a
23:08:52: 98808 DEBUG
org.apache.cxf.interceptor.OutgoingChainInterceptor - Interceptors
contributed by bus:
[org.apache.cxf.interceptor.LoggingOutInterceptor@58d5533a,
org.apache.cxf.ws.policy.PolicyOutInterceptor@1d4b3266]
23:08:52: 98808 DEBUG
org.apache.cxf.interceptor.OutgoingChainInterceptor - Interceptors
contributed by service: []
23:08:52: 98808 DEBUG
org.apache.cxf.interceptor.OutgoingChainInterceptor - Interceptors
contributed by endpoint:
[org.apache.cxf.interceptor.MessageSenderInterceptor@33d9d590]
23:08:52: 98812 DEBUG
org.apache.cxf.interceptor.OutgoingChainInterceptor - Interceptors
contributed by binding:
[org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor@2253fb88]
23:08:52: 98812 DEBUG org.apache.cxf.phase.PhaseInterceptorChain -
Adding interceptor
org.apache.cxf.interceptor.LoggingOutInterceptor@58d5533a to phase
pre-stream
23:08:52: 98812 DEBUG org.apache.cxf.phase.PhaseInterceptorChain -
Adding interceptor
org.apache.cxf.ws.policy.PolicyOutInterceptor@1d4b3266 to phase setup
23:08:52: 98812 DEBUG org.apache.cxf.phase.PhaseInterceptorChain -
Adding interceptor
org.apache.cxf.interceptor.MessageSenderInterceptor@33d9d590 to phase
prepare-send
23:08:52: 98813 DEBUG org.apache.cxf.phase.PhaseInterceptorChain -
Adding interceptor
org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor@2253fb88 to phase
marshal
23:08:52: 98813 DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Chain
org.apache.cxf.phase.PhaseInterceptorChain@37a6af53 was created. Current
flow:
setup [PolicyOutInterceptor]
prepare-send [MessageSenderInterceptor]
pre-stream [LoggingOutInterceptor]
marshal [JAXRSOutInterceptor]
23:08:52: 98813 DEBUG org.apache.cxf.phase.PhaseInterceptorChain -
Invoking handleMessage on interceptor
org.apache.cxf.ws.policy.PolicyOutInterceptor@1d4b3266
23:08:52: 98813 DEBUG org.apache.cxf.ws.policy.PolicyOutInterceptor - No
binding operation info.
23:08:52: 98814 DEBUG org.apache.cxf.phase.PhaseInterceptorChain -
Invoking handleMessage on interceptor
org.apache.cxf.interceptor.MessageSenderInterceptor@33d9d590
23:08:52: 98816 DEBUG org.apache.cxf.phase.PhaseInterceptorChain -
Adding interceptor
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor@228287e2
to phase prepare-send-ending
23:08:52: 98816 DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Chain
org.apache.cxf.phase.PhaseInterceptorChain@37a6af53 was modified.
Current flow:
setup [PolicyOutInterceptor]
prepare-send [MessageSenderInterceptor]
pre-stream [LoggingOutInterceptor]
marshal [JAXRSOutInterceptor]
prepare-send-ending [MessageSenderEndingInterceptor]
23:08:52: 98821 DEBUG org.apache.cxf.phase.PhaseInterceptorChain -
Invoking handleMessage on interceptor
org.apache.cxf.interceptor.LoggingOutInterceptor@58d5533a
23:08:52: 98823 DEBUG org.apache.cxf.phase.PhaseInterceptorChain -
Invoking handleMessage on interceptor
org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor@2253fb88
23:08:52: 98823 DEBUG org.apache.cxf.phase.PhaseInterceptorChain -
Invoking handleMessage on interceptor
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor@228287e2
23:08:52: 98824 INFO org.apache.cxf.interceptor.LoggingOutInterceptor -
Outbound Message
---------------------------
ID: 1
Response-Code: 500
Content-Type: text/xml
Headers: {Date=[Thu, 06 Dec 2012 04:08:52 GMT], Content-Length=[0]}
--------------------------------------
23:08:52: 98828 DEBUG org.apache.cxf.transport.servlet.ServletController
- Finished servicing http request on thread: Thread[[ACTIVE]
ExecuteThread: '0' for queue: 'weblogic.kernel.Default
(self-tuning)',5,Pooled Threads]
[/log]
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com