org.springframework.beans.TypeMismatchException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • We have a simple service and another bundle using this service and it works fine. Without changing anything, we issue a refresh of the service in the osgi console. That results in the Exception given below. Surprisingly, after issuing a second refresh of the service, there is no Exception and everything work fine again. ########### output of the first refresh, 65 is the service osgi> refresh 65 osgi> INFO OsgiBundleXmlApplicationContext - Closing org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@1c2ee8e: display name [OsgiBundleXmlApplicationContext(bundle=application, config=osgibundlejar:/META-INF/spring/*.xml)]; startup date [Tue Nov 27 11:19:13 CET 2007]; root of context hierarchy INFO DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1814dd0: defining beans [myServiceOsgi,listener,myServlet,myServletExporter]; root of factory hierarchy removeservice INFO OsgiBundleXmlApplicationContext - Closing org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@17b9223: display name [OsgiBundleXmlApplicationContext(bundle=myservice, config=osgibundlejar:/META-INF/spring/*.xml)]; startup date [Tue Nov 27 11:19:13 CET 2007]; root of context hierarchy INFO DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@85acc2: defining beans [myServiceOsgi,myListener,myService]; root of factory hierarchy INFO OsgiServiceFactoryBean - Unregistered service [ServiceWrapper for {ag.pinguin.myservice.IMyService}={org.springframework.osgi.bean.name=myService, Bundle-SymbolicName=myservice, Bundle-Version=1.0.19, service.id=336}] INFO OsgiBundleXmlApplicationContext - Closing org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@613b4a: display name [OsgiBundleXmlApplicationContext(bundle=myservice, config=osgibundlejar:/META-INF/spring/*.xml)]; startup date [Tue Nov 27 11:19:13 CET 2007]; root of context hierarchy INFO DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@11b12e1: defining beans [myServiceOsgi,myService]; root of factory hierarchy INFO OsgiServiceFactoryBean - Unregistered service [ServiceWrapper for {ag.pinguin.myservice.IMyService}={org.springframework.osgi.bean.name=myService, Bundle-SymbolicName=myservice, Bundle-Version=1.0.18, service.id=334}] INFO ContextLoaderListener - disabled automatic Spring-DM annotation processing; [ org.springframework.osgi.extender.annotation.auto.processing=null] INFO ContextLoaderListener - disabled automatic Spring-DM annotation processing; [ org.springframework.osgi.extender.annotation.auto.processing=null] INFO OsgiBundleXmlApplicationContext - Refreshing org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@248adb: display name [OsgiBundleXmlApplicationContext(bundle=myservice, config=osgibundlejar:/META-INF/spring/*.xml)]; startup date [Tue Nov 27 11:19:20 CET 2007]; root of context hierarchy INFO XmlBeanDefinitionReader - Loading XML bean definitions from OSGi res[/META-INF/spring/context.xml|64|symName=myservice] INFO ContextLoaderListener - disabled automatic Spring-DM annotation processing; [ org.springframework.osgi.extender.annotation.auto.processing=null] INFO OsgiBundleXmlApplicationContext - Refreshing org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@1e95d95: display name [OsgiBundleXmlApplicationContext(bundle=application, config=osgibundlejar:/META-INF/spring/*.xml)]; startup date [Tue Nov 27 11:19:20 CET 2007]; root of context hierarchy INFO XmlBeanDefinitionReader - Loading XML bean definitions from OSGi res[/META-INF/spring/context.xml|59|symName=application] INFO OsgiBundleXmlApplicationContext - Bean factory for application context [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@248adb]: org.springframework.beans.factory.support.DefaultListableBeanFactory@16c006e INFO OsgiBundleXmlApplicationContext - Refreshing org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@11859fe: display name [OsgiBundleXmlApplicationContext(bundle=myservice, config=osgibundlejar:/META-INF/spring/*.xml)]; startup date [Tue Nov 27 11:19:20 CET 2007]; root of context hierarchy INFO DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@16c006e: defining beans [myServiceOsgi,myService]; root of factory hierarchy INFO OsgiBundleXmlApplicationContext - Bean factory for application context [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@1e95d95]: org.springframework.beans.factory.support.DefaultListableBeanFactory@1a1d5cb INFO XmlBeanDefinitionReader - Loading XML bean definitions from OSGi res[/META-INF/spring/context.xml|65|symName=myservice] INFO OsgiBundleXmlApplicationContext - Bean factory for application context [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@11859fe]: org.springframework.beans.factory.support.DefaultListableBeanFactory@987c7d INFO DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@987c7d: defining beans [myServiceOsgi,myListener,myService]; root of factory hierarchy INFO OsgiServiceFactoryBean - Publishing service under classes [{ag.pinguin.myservice.IMyService}] INFO OsgiBundleXmlApplicationContext - Publishing application context with properties (org.springframework.context.service.name=myservice) INFO OsgiServiceFactoryBean - Publishing service under classes [{ag.pinguin.myservice.IMyService}] INFO OsgiBundleXmlApplicationContext - Publishing application context with properties (org.springframework.context.service.name=myservice) INFO DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1a1d5cb: defining beans [myServiceOsgi,listener,myServlet,myServletExporter]; root of factory hierarchy INFO DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1a1d5cb: defining beans [myServiceOsgi,listener,myServlet,myServletExporter]; root of factory hierarchy ERROR OsgiBundleXmlApplicationContext - Post refresh error org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myServlet' defined in OSGi res[/META-INF/spring/context.xml|59|symName=application]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are: PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy185] to required type [ag.pinguin.myservice.IMyService] for property 'myService'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy185] to required type [ag.pinguin.myservice.IMyService] for property 'myService': no matching editors or conversion strategy found at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1303) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1042) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:485) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:170) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:413) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:735) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:241) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132) at java.lang.Thread.run(Thread.java:595) Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are: PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy185] to required type [ag.pinguin.myservice.IMyService] for property 'myService'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy185] to required type [ag.pinguin.myservice.IMyService] for property 'myService': no matching editors or conversion strategy found at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:104) at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:59) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1300) ... 14 more Exception in thread "SpringOsgiExtenderThread-12" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myServlet' defined in OSGi res[/META-INF/spring/context.xml|59|symName=application]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are: PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy185] to required type [ag.pinguin.myservice.IMyService] for property 'myService'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy185] to required type [ag.pinguin.myservice.IMyService] for property 'myService': no matching editors or conversion strategy found at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1303) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1042) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:485) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:170) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:413) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:735) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:241) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132) at java.lang.Thread.run(Thread.java:595) Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are: PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy185] to required type [ag.pinguin.myservice.IMyService] for property 'myService'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy185] to required type [ag.pinguin.myservice.IMyService] for property 'myService': no matching editors or conversion strategy found at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:104) at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:59) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1300) ... 14 more ########### output of the second refresh osgi> refresh 65 osgi> INFO ContextLoaderListener - Stopping org.springframework.osgi.extender bundle INFO OsgiBundleXmlApplicationContext - the application context service has been already unregistered INFO OsgiBundleXmlApplicationContext - Closing org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@1e95d95: display name [OsgiBundleXmlApplicationContext(bundle=application, config=osgibundlejar:/META-INF/spring/*.xml)]; startup date [Tue Nov 27 11:19:20 CET 2007]; root of context hierarchy INFO DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1a1d5cb: defining beans [myServiceOsgi,listener,myServlet,myServletExporter]; root of factory hierarchy INFO OsgiBundleXmlApplicationContext - Closing org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@11859fe: display name [OsgiBundleXmlApplicationContext(bundle=myservice, config=osgibundlejar:/META-INF/spring/*.xml)]; startup date [Tue Nov 27 11:19:20 CET 2007]; root of context hierarchy INFO DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@987c7d: defining beans [myServiceOsgi,myListener,myService]; root of factory hierarchy INFO OsgiServiceFactoryBean - Unregistered service [ServiceWrapper for {ag.pinguin.myservice.IMyService}={org.springframework.osgi.bean.name=myService, Bundle-SymbolicName=myservice, Bundle-Version=1.0.19, service.id=341}] INFO OsgiBundleXmlApplicationContext - Closing org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@248adb: display name [OsgiBundleXmlApplicationContext(bundle=myservice, config=osgibundlejar:/META-INF/spring/*.xml)]; startup date [Tue Nov 27 11:19:20 CET 2007]; root of context hierarchy INFO DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@16c006e: defining beans [myServiceOsgi,myService]; root of factory hierarchy INFO OsgiServiceFactoryBean - Unregistered service [ServiceWrapper for {ag.pinguin.myservice.IMyService}={org.springframework.osgi.bean.name=myService, Bundle-SymbolicName=myservice, Bundle-Version=1.0.18, service.id=339}] INFO ContextLoaderListener - Starting org.springframework.osgi.extender bundle v.[1.0.0.rc1] INFO ContextLoaderListener - disabled automatic Spring-DM annotation processing; [ org.springframework.osgi.extender.annotation.auto.processing=null] INFO ContextLoaderListener - disabled automatic Spring-DM annotation processing; [ org.springframework.osgi.extender.annotation.auto.processing=null] INFO OsgiBundleXmlApplicationContext - Refreshing org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@7baddd: display name [OsgiBundleXmlApplicationContext(bundle=application, config=osgibundlejar:/META-INF/spring/*.xml)]; startup date [Tue Nov 27 11:22:42 CET 2007]; root of context hierarchy INFO ContextLoaderListener - disabled automatic Spring-DM annotation processing; [ org.springframework.osgi.extender.annotation.auto.processing=null] INFO OsgiBundleXmlApplicationContext - Refreshing org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@1df2b92: display name [OsgiBundleXmlApplicationContext(bundle=myservice, config=osgibundlejar:/META-INF/spring/*.xml)]; startup date [Tue Nov 27 11:22:42 CET 2007]; root of context hierarchy INFO OsgiBundleXmlApplicationContext - Refreshing org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@12e60f3: display name [OsgiBundleXmlApplicationContext(bundle=myservice, config=osgibundlejar:/META-INF/spring/*.xml)]; startup date [Tue Nov 27 11:22:42 CET 2007]; root of context hierarchy INFO XmlBeanDefinitionReader - Loading XML bean definitions from OSGi res[/META-INF/spring/context.xml|59|symName=application] INFO XmlBeanDefinitionReader - Loading XML bean definitions from OSGi res[/META-INF/spring/context.xml|65|symName=myservice] INFO OsgiBundleXmlApplicationContext - Bean factory for application context [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@7baddd]: org.springframework.beans.factory.support.DefaultListableBeanFactory@bbe282 INFO OsgiBundleXmlApplicationContext - Bean factory for application context [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@1df2b92]: org.springframework.beans.factory.support.DefaultListableBeanFactory@1188439 INFO DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1188439: defining beans [myServiceOsgi,myListener,myService]; root of factory hierarchy INFO OsgiServiceFactoryBean - Publishing service under classes [{ag.pinguin.myservice.IMyService}] INFO XmlBeanDefinitionReader - Loading XML bean definitions from OSGi res[/META-INF/spring/context.xml|64|symName=myservice] INFO DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@bbe282: defining beans [myServiceOsgi,listener,myServlet,myServletExporter]; root of factory hierarchy INFO OsgiBundleXmlApplicationContext - Publishing application context with properties (org.springframework.context.service.name=myservice) INFO OsgiBundleXmlApplicationContext - Bean factory for application context [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@12e60f3]: org.springframework.beans.factory.support.DefaultListableBeanFactory@16be8a0 INFO DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@16be8a0: defining beans [myServiceOsgi,myService]; root of factory hierarchy INFO OsgiServiceFactoryBean - Publishing service under classes [{ag.pinguin.myservice.IMyService}] INFO OsgiBundleXmlApplicationContext - Publishing application context with properties (org.springframework.context.service.name=myservice) INFO OsgiBundleXmlApplicationContext - Publishing application context with properties (org.springframework.context.service.name=application)
    via by Christian Franke,
  • JNDI Configuration using Spring Framework.
    via by Unknown author,
    • org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [int] for property 'maxStaleDays'; nested exception is java.lang.NumberFormatException: For input string: "${com.vaau.rbacx.iam.oracle.maxStaleDays}" at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:230) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:117) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472) 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)
    No Bugmate found.