4 Replies Latest reply on Apr 23, 2010 3:44 AM by Fernando Salceda

    camel-bundle example ClassNotFoundException

    Fernando Salceda Novice

      I'm following the tutorial with the last release of Fuse-ESB (apache-servicemix-4.2.0-fuse-01-00). When i try to start the "camel-bundle"  it crashes with:

       

      -


      Exception in thread "SpringOsgiExtenderThread-82" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'camelContext': Invocation of init method failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class for bean with name 'myTransform' defined in URL bundleentry://200.fwk27334345/META-INF/spring/camel-context.xml; nested exception is java.lang.ClassNotFoundException: org.fusesource.example.MyTransform not found from bundle

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)

           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.getBeansOfType(DefaultListableBeanFactory.java:308)

           at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:947)

           at org.springframework.context.support.AbstractApplicationContext.registerListeners(AbstractApplicationContext.java:701)

           at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1500(AbstractDelegatedExecutionApplicationContext.java:69)

           at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:351)

           at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)

           at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)

           at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:136)

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

      Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class for bean with name 'myTransform' defined in URL bundleentry://200.fwk27334345/META-INF/spring/camel-context.xml; nested exception is java.lang.ClassNotFoundException: org.fusesource.example.MyTransform not found from bundle

           at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1141)

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:524)

           at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1177)

           at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:222)

           at org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:937)

           at org.apache.camel.spring.CamelContextFactoryBean.getBeanForType(CamelContextFactoryBean.java:570)

           at org.apache.camel.spring.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:192)

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)

           ... 18 more

      Caused by: java.lang.ClassNotFoundException: org.fusesource.example.MyTransform not found from bundle

           at org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:103)

           at org.springframework.osgi.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:156)

           at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

           at org.springframework.util.ClassUtils.forName(ClassUtils.java:211)

           at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:385)

           at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1138)

           ... 26 more

      Caused by: java.lang.ClassNotFoundException: org.fusesource.example.MyTransform

           at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:448)

           at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)

           at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:398)

           at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105)

           at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

           at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:326)

           at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:231)

           at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1193)

           at org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:99)

           ... 31 more

      -


       

      Why the ClassLoader don't find MyTransformer class??

       

      THX