Hi

Can you post the stacktrace. And what version of Camel are you using?

The ModelCamelContext is just an interface, which is implemented by
the DefaultCamelContext, which SpringCamelContext extends. So it seems
a bit odd spring cannot understand that.

And make sure you don't have different versions of Spring / Camel etc.
on the classpath. That can lead to weird issues.

On Mon, Aug 27, 2012 at 12:05 AM, nicosommi <nicoso...@gmail.com> wrote:
> I'm using Fuse IDE (Eclipse) on a little project with a spring camel context,
> one route, and one test. I put an extra xml for defining test execution
> environment.
>
> When I run the test, it fails with type mismatch loading the context bean
> info (when instantiating PropertyDescriptor class of the bean context,
> setter type is org.apache.camel.spring.SpringCamelContext and getter type is
> org.apache.camel.model.ModelCamelContext...
>
> The original exception is: "java.beans.IntrospectionException: type mismatch
> between read and write methods"
>
> The test code is this:
>
> public class TestDBRoute extends CamelSpringTestSupport {
>
> @DirtiesContext //reload context
> @Test
> public void testPoll() throws Exception {
>     //context.start();
>     System.out.println("comenzo");
>     Thread.sleep(1000);
>     System.out.println("termino");
>     //context.stop();
>     assertEquals("first", 1, 1);
> }
>
> @Override
> protected AbstractApplicationContext createApplicationContext() {
>     return new
> ClassPathXmlApplicationContext("classpath:/com/test-camel-context.xml");
> }
> }
>
> The camel context code is:
>
> <beans xmlns="http://www.springframework.org/schema/beans";
>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>    xsi:schemaLocation="
>    http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
>    http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd";>
>
> <camelContext xmlns="http://camel.apache.org/schema/spring";>
>         <packageScan>
>             <package>com.test.fuse.routes</package>
>         </packageScan>
> </camelContext>
> </beans>
>
> The route code is empty, it only extends the RouteBuilder and overrides the
> configure method.
>
> I'm using OpenJDK 1.6.0_24 on ubuntu.
>
> If you need something else please ask.
>
> Thanks
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Error-loading-spring-camel-context-type-mismatch-tp5718099.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to