Hi,

I am implementing the interceptor for doing schema validation on incoming 
request. I have written MyInterceptor.java class and made entry of it in 
cxf.xml file.

MyInterceptor.java

*********************************************************************************************************************************************************************

package com.citi.soa.domainservices.interceptor;

import org.apache.cxf.binding.soap.SoapMessage;

import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;

import org.apache.cxf.interceptor.Fault;

import org.apache.cxf.phase.Phase;

public class MyInterceptor extends AbstractSoapInterceptor

{

public MyInterceptor() {

super(Phase.UNMARSHAL); 

}

public void handleMessage(SoapMessage message) throws Fault {

System.out.println("********************************************************************************");

System.out.println("The interceptor MyInterceptor is called");

System.out.println("********************************************************************************");
 

}

}

*********************************************************************************************************************************************************************

Entry in CXF.xml

*********************************************************************************************************************************************************************

<bean id="MyInterceptor" 
class="com.citi.soa.domainservices.interceptor.MyInterceptor"/>

<!-- We are adding the interceptors to the bus as we will have only one 
endpoint/service/bus. -->

<cxf:bus>

<cxf:inInterceptors>

<list>

<ref bean="MyInterceptor"/>

</list>

</cxf:inInterceptors> 

*********************************************************************************************************************************************************************

I have deployed the application and while deploying I faced below exception, 
Can someone guide me how to get rid of this issue?

Exception I got at the console,

*********************************************************************************************************************************************************************

org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'cxf': Er
ror setting property values; nested exception is 
org.springframework.beans.PropertyBatchUpdateEx
ception; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.TypeMismatchException: 
Failed to convert pr
operty value of type [java.util.ArrayList] to required type [java.util.List] 
for property 'inInt
erceptors'; nested exception is java.lang.IllegalArgumentException: Cannot 
convert value of type
 [java.util.ArrayList] to required type 
[org.apache.cxf.interceptor.Interceptor] for property 'i
nInterceptors[0]': no matching editors or conversion strategy found
Caused by: org.springframework.beans.PropertyBatchUpdateException; nested 
PropertyAccessExceptio
n details (1) are:
PropertyAccessException 1:
org.springframework.beans.TypeMismatchException: Failed to convert property 
value of type [java.
util.ArrayList] to required type [java.util.List] for property 
'inInterceptors'; nested exceptio
n is java.lang.IllegalArgumentException: Cannot convert value of type 
[java.util.ArrayList] to r
equired type [org.apache.cxf.interceptor.Interceptor] for property 
'inInterceptors[0]': no match
ing editors or conversion strategy found
Caused by: java.lang.IllegalArgumentException: Cannot convert value of type 
[java.util.ArrayList
] to required type [org.apache.cxf.interceptor.Interceptor] for property 
'inInterceptors[0]': no
 matching editors or conversion strategy found

*********************************************************************************************************************************************************************

 

Thanks & Regards

 Ashwin

Reply via email to