2 Replies Latest reply on Mar 17, 2011 10:10 AM by njiang

    Trying to execute camel example....

    dead_devil_66

      Greetings.

       

      I'm trying to run this example:

       

      http://camel.apache.org/tutorial-osgi-camel-part1.html

       

      but, when i try to deploy demo.camel-bundle, i get the following error in fuse

       

      Exception in thread "SpringOsgiExtenderThread-13" java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext

              at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:171)

              at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.close(DependencyWaiterApplicationContextExecutor.java:345)

              at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.fail(DependencyWaiterApplicationContextExecutor.java:401)

              at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:287)

              at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:175)

              at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)

              at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:718)

              at java.lang.Thread.run(Thread.java:636)

       

       

      what is going wrong????

        • 1. Re: Trying to execute camel example....
          dead_devil_66

          This is the complete log:

           

          http://pastie.org/1679657

          • 2. Re: Trying to execute camel example....
            njiang

            Which version of Karaf and Camel are you using?

            The tutorial was wrote about two years ago, you make need to update the configure file like this.

            <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"
                   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">
                    <camel:route>
                        <camel:from uri="timer://myTimer?fixedRate=true&amp;period=2000"></camel:from>
                        <bean ref="myTransform" method="transform"></bean>
                        <camel:to uri="log:ExampleRouter"></camel:to>
                    </camel:route>
                </camelContext>
            </bean>
            

             

            Willem