Hi

Looks like the # reference failed.
              serviceClass="#reportIncidentEndpoint"

eg # instructs Camel / CXF to lookup in Spring for a bean with that id.


Got the attention of Willem Tam or William Jiang.


On Tue, Mar 3, 2009 at 5:46 PM, cmoulliard <[email protected]> wrote:
>
> Hi,
>
> Camel 2.0-SNAPSHOT & Cxf-2.2.-SNAPSHOT returns the following error :
>
> 2009-03-03 17:42:06,906 DEBUG DisposableBeanAdapter - Invoking destroy() on
> bean with name 'camelContext'
> 2009-03-03 17:42:06,906 ERROR MainSupport - Failed:
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'reportIncident': Initialization of bean failed; nested exception
> is org.springframework.beans.TypeMismatchException: Failed to convert
> property value of type
> [org.apache.camel.example.reportincident.service.ReportIncidentEndpointService]
> to required type [java.lang.Class] for property 'serviceClass'; nested
> exception is java.lang.IllegalArgumentException: Cannot convert value of
> type
> [org.apache.camel.example.reportincident.service.ReportIncidentEndpointService]
> to required type [java.lang.Class] for property 'serviceClass':
> PropertyEditor [org.springframework.beans.propertyeditors.ClassEditor]
> returned inappropriate value
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'reportIncident': Initialization of bean failed; nested exception
> is org.springframework.beans.TypeMismatchException: Failed to convert
> property value of type
> [org.apache.camel.example.reportincident.service.ReportIncidentEndpointService]
> to required type [java.lang.Class] for property 'serviceClass'; nested
> exception is java.lang.IllegalArgumentException: Cannot convert value of
> type
> [org.apache.camel.example.reportincident.service.ReportIncidentEndpointService]
> to required type [java.lang.Class] for property 'serviceClass':
> PropertyEditor [org.springframework.beans.propertyeditors.ClassEditor]
> returned inappropriate value
>        at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
>        at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
>        at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
>        at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>        at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
>        at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
>        at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
>        at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
>        at
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
>        at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
>        at
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
>        at
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
>        at
> org.apache.camel.spring.Main.createDefaultApplicationContext(Main.java:232)
>        at org.apache.camel.spring.Main.doStart(Main.java:186)
>        at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:50)
>        at org.apache.camel.util.MainSupport.run(MainSupport.java:121)
>        at org.apache.camel.util.MainSupport.run(MainSupport.java:299)
>        at org.apache.camel.spring.Main.main(Main.java:98)
>        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.maven.RunMojo$1.run(RunMojo.java:396)
>        at java.lang.Thread.run(Thread.java:619)
> Caused by: org.springframework.beans.TypeMismatchException: Failed to
> convert property value of type
> [org.apache.camel.example.reportincident.service.ReportIncidentEndpointService]
> to required type [java.lang.Class] for property 'serviceClass'; nested
> exception is java.lang.IllegalArgumentException: Cannot convert value of
> type
> [org.apache.camel.example.reportincident.service.ReportIncidentEndpointService]
> to required type [java.lang.Class] for property 'serviceClass':
> PropertyEditor [org.springframework.beans.propertyeditors.ClassEditor]
> returned inappropriate value
>        at
> org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:391)
>        at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1289)
>        at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1250)
>        at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
>        at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
>        ... 25 more
> Caused by: java.lang.IllegalArgumentException: Cannot convert value of type
> [org.apache.camel.example.reportincident.service.ReportIncidentEndpointService]
> to required type [java.lang.Class] for property 'serviceClass':
> PropertyEditor [org.springframework.beans.propertyeditors.ClassEditor]
> returned inappropriate value
>        at
> org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231)
>        at
> org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
>        at
> org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386)
>        ... 29 more
>
> with my config :
>
> <beans xmlns="http://www.springframework.org/schema/beans";
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>        xmlns:camel="http://camel.apache.org/schema/spring";
>        xmlns:cxf="http://camel.apache.org/schema/cxfEndpoint";
>        xsi:schemaLocation=" http://www.springframework.org/schema/beans
>                
> http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
>                http://camel.apache.org/schema/osgi
>                http://camel.apache.org/schema/osgi/camel-osgi-2.0-SNAPSHOT.xsd
>                http://camel.apache.org/schema/spring
>                http://camel.apache.org/schema/spring/camel-spring.xsd
>                http://camel.apache.org/schema/cxfEndpoint
>                http://camel.apache.org/schema/cxf/camel-cxf-2.0-SNAPSHOT.xsd";>
>
>        <!-- not required for camel-cxf
>    <import resource="classpath:META-INF/cxf/cxf.xml"/>
>    <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
>    <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
>         -->
>
>        <bean id="bindyDataformat"
>                  
> class="org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat">
>             <constructor-arg type="java.lang.String"
> value="org.apache.camel.example.reportincident.model" />
>        </bean>
>
>        <bean id="csv" 
> class="org.apache.camel.example.reportincident.csv.CsvBean"
> />
>
>        <bean id="reportIncidentEndpoint"
> class="org.apache.camel.example.reportincident.service.ReportIncidentEndpointService"/>
>
>    <!-- webservice endpoint -->
>    <cxf:cxfEndpoint id="reportIncident"
>                     address="/incident"
>                     wsdlURL="/wsdl/report_incident.xml"
>                     serviceClass="#reportIncidentEndpoint"
>                     endpointName="s:ReportIncidentPort"
>                     serviceName="s:ReportIncidentService"
>
> xmlns:s="http://reportincident.example.camel.apache.org";
>     />
>
>        <camelContext xmlns="http://camel.apache.org/schema/osgi";>
>                <camel:route>
>                        <camel:from uri="cxf:bean:reportIncident" />
>                        <camel:convertBodyTo
> type="org.apache.camel.example.reportincident.domain.InputReportIncident" />
>                        <camel:to uri="log:cxf" />
>                </camel:route>
>
>        </camelContext>
>
> What is wrong ?
>
> Regards,
>
> -----
> Charles Moulliard
> SOA Architect
>
> My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/
> --
> View this message in context: 
> http://www.nabble.com/camel-cxf-endpoint---error-%3A-Failed-to-convert-property-value-of-type--...-tp22312601p22312601.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/

Reply via email to