4 Replies Latest reply on Jul 2, 2009 11:16 PM by Willem Jiang

    Help config issue: java.lang.ClassNotFoundException

    Peter Chandler Master

      1. I have an active spring enable bundle running "transformService".

      2. I then try to invoke the service from inside a

          I then get the following error below:

       

      Any ideas?

       

      Peter.

       

       

      transformService

      1) smx@root:osgi> ls 213

       

      demo.service-bundle (213) provides:

      -


      Bundle-SymbolicName = demo.service-bundle

      Bundle-Version = 0.1

      objectClass = demo.service.TransformService

      org.springframework.osgi.bean.name = transformService

      service.id = 144

      -


      Bundle-SymbolicName = demo.service-bundle

      Bundle-Version = 0.1.0

      objectClass = org.springframework.osgi.context.DelegatedExecutionOsgiBundleApplicationContext, org.springframework.osgi.context.ConfigurableOsgiBundleApplicationContext, org.springframework.context.ConfigurableApplicationContext, org.springframework.context.ApplicationContext, org.springframework.context.Lifecycle, org.springframework.beans.factory.ListableBeanFactory, org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.context.MessageSource, org.springframework.context.ApplicationEventPublisher, org.springframework.core.io.support.ResourcePatternResolver, org.springframework.beans.factory.BeanFactory, org.springframework.core.io.ResourceLoader, org.springframework.beans.factory.DisposableBean

      org.springframework.context.service.name = demo.service-bundle

      service.id = 145

       

      ERROR

      2) org.apache.camel.spring.Main.main() ERROR - Failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transformService': Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type to required type [java.lang.Class[]] for property 'interfaces'; nested exception is java.lang.IllegalArgumentException: Cannot find class

      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transformService': Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type to required type [java.lang.Class[]] for property 'interfaces'; nested exception is java.lang.IllegalArgumentException: Cannot find class

              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:221)

              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:423)

              at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)

              at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)

              at org.springframework.context.support.ClassPathXmlApplicationContext.(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:49)

              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:395)

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

      Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type to required type [java.lang.Class[]] for property 'interfaces'; nested exception is java.lang.IllegalArgumentException: Cannot find class

              at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:391)

              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1288)

              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1249)

              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 find class

              at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:264)

              at org.springframework.beans.propertyeditors.ClassArrayEditor.setAsText(ClassArrayEditor.java:66)

              at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:374)

              at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:350)

              at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:173)

              at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)

              at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386)

              ... 29 more

      Caused by: java.lang.ClassNotFoundException: demo.service.TransformService

              at java.net.URLClassLoader$1.run(URLClassLoader.java:200)

              at java.security.AccessController.doPrivileged(Native Method)

              at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

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

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

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

              at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:261)

              ... 35 more