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.

  • Combobox selection value is not converted when the combobox dropdown is opened and closed without change. When I change the value or if I don't even click the dropdown everthing is fine. Reported Exception (LifeCycle$State is a org.springframework.core.enums.ShortCodedLabeledEnum 8.11.2005 17:41:54 WARNING Exception occurred executing dialog finish command. org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [de.innovations.wfr.model.gbz.LifeCycle$State] for property 'lifeCycleState' at org.springframework.beans.BeanWrapperImpl.doTypeConversionIfNecessary(BeanWrapperImpl.java:1103) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:849) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:733) at org.springframework.binding.support.BeanPropertyAccessStrategy$BeanPropertyValueModel.setValue(BeanPropertyAccessStrategy.java:259) at org.springframework.binding.value.support.AbstractValueModel.setValueSilently(AbstractValueModel.java:54) at org.springframework.binding.value.support.BufferedValueModel.commit(BufferedValueModel.java:197) at org.springframework.binding.value.support.BufferedValueModel$CommitTriggerHandler.commit(BufferedValueModel.java:264) at org.springframework.binding.value.CommitTrigger.commit(CommitTrigger.java:45) at org.springframework.binding.form.support.AbstractFormModel.doCommit(AbstractFormModel.java:485) at org.springframework.binding.form.support.AbstractFormModel.commit(AbstractFormModel.java:467) at org.springframework.richclient.form.AbstractForm.commit(AbstractForm.java:531)
    via by Gerald Glocker,
  • Combobox selection value is not converted when the combobox dropdown is opened and closed without change. When I change the value or if I don't even click the dropdown everthing is fine. Reported Exception (LifeCycle$State is a org.springframework.core.enums.ShortCodedLabeledEnum 8.11.2005 17:41:54 WARNING Exception occurred executing dialog finish command. org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [de.innovations.wfr.model.gbz.LifeCycle$State] for property 'lifeCycleState' at org.springframework.beans.BeanWrapperImpl.doTypeConversionIfNecessary(BeanWrapperImpl.java:1103) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:849) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:733) at org.springframework.binding.support.BeanPropertyAccessStrategy$BeanPropertyValueModel.setValue(BeanPropertyAccessStrategy.java:259) at org.springframework.binding.value.support.AbstractValueModel.setValueSilently(AbstractValueModel.java:54) at org.springframework.binding.value.support.BufferedValueModel.commit(BufferedValueModel.java:197) at org.springframework.binding.value.support.BufferedValueModel$CommitTriggerHandler.commit(BufferedValueModel.java:264) at org.springframework.binding.value.CommitTrigger.commit(CommitTrigger.java:45) at org.springframework.binding.form.support.AbstractFormModel.doCommit(AbstractFormModel.java:485) at org.springframework.binding.form.support.AbstractFormModel.commit(AbstractFormModel.java:467) at org.springframework.richclient.form.AbstractForm.commit(AbstractForm.java:531)
    via by Gerald Glocker,
  • I am trying to reproduce this jpa model : http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Entities/Ids/IdClass#Example:_Composite_Primary_Key_Class_With_Foreign_Key When I try to create a new Employee, if have the following stack trace : org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'Department' to required type 'java.lang.Long' for property 'department'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [Department] to required type [java.lang.Long] for property 'department': PropertyEditor [org.springframework.beans.propertyeditors.CustomNumberEditor] returned inappropriate value of type [Department] at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:490) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:516) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1119) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:904) at org.springframework.data.jpa.repository.support.JpaMetamodelEntityInformation$DirectFieldAccessFallbackBeanWrapper.setPropertyValue(JpaMetamodelEntityInformation.java:205) at org.springframework.data.jpa.repository.support.JpaMetamodelEntityInformation.getId(JpaMetamodelEntityInformation.java:94) at org.springframework.data.repository.core.support.AbstractEntityInformation.isNew(AbstractEntityInformation.java:53) at org.springframework.data.jpa.repository.support.SimpleJpaRepository.save(SimpleJpaRepository.java:340) ... The problem comes from JpaMetamodelEntityInformation.getId : this method ignores the fact that the id class contains the id of the department, not a department reference. NB : in this issue https://jira.springsource.org/browse/DATAJPA-50, the same situation was described in a comment : https://jira.springsource.org/browse/DATAJPA-50?focusedCommentId=66633&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-66633 Thanks for reading
    via by Romain Fromi,
  • Error creating bean (Spring/Hibernate)
    via by Unknown author,
  • An exception is thrown when injecting a SchedulerFactoryBean: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.quartz.impl.StdScheduler] to required type [org.springframework.scheduling.quartz.SchedulerFactoryBean] for property 'schedulerFactoryBean' -------------------------------------------------------------------- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <bean id="schedulerFactoryBean" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"/> <bean id="test" class="test.SchedulerTest"> <property name="schedulerFactoryBean"><ref local="schedulerFactoryBean"/></property> </bean> </beans> -------------------------------------------------------------------- package test; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.scheduling.quartz.SchedulerFactoryBean; public class SchedulerTest { private SchedulerFactoryBean schedulerFactoryBean; public void setSchedulerFactoryBean(SchedulerFactoryBean schedulerFactoryBean) { this.schedulerFactoryBean = schedulerFactoryBean; } public static void main(String[] args) { new ClassPathXmlApplicationContext("context.xml"); } } -------------------------------------------------------------------- 11-May-2005 19:11:48 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from class path resource [context.xml] 11-May-2005 19:11:49 org.springframework.context.support.AbstractRefreshableApplicationContext refreshBeanFactory INFO: Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext;hashCode=3043939]: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [schedulerFactoryBean,test]; root of BeanFactory hierarchy 11-May-2005 19:11:49 org.springframework.context.support.AbstractApplicationContext refresh INFO: 2 beans defined in application context [org.springframework.context.support.ClassPathXmlApplicationContext;hashCode=3043939] 11-May-2005 19:11:49 org.springframework.core.CollectionFactory <clinit> INFO: JDK 1.4+ collections available 11-May-2005 19:11:49 org.springframework.context.support.AbstractApplicationContext initMessageSource INFO: Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@19f953d] 11-May-2005 19:11:49 org.springframework.context.support.AbstractApplicationContext initApplicationEventMulticaster INFO: Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@1eed786] 11-May-2005 19:11:49 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons INFO: Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [schedulerFactoryBean,test]; root of BeanFactory hierarchy] 11-May-2005 19:11:49 org.springframework.beans.factory.support.AbstractBeanFactory getBean INFO: Creating shared instance of singleton bean 'schedulerFactoryBean' 11-May-2005 19:11:49 org.quartz.simpl.SimpleThreadPool initialize INFO: Job execution threads will use class loader of thread: main 11-May-2005 19:11:49 org.quartz.simpl.RAMJobStore initialize INFO: RAMJobStore initialized. 11-May-2005 19:11:49 org.quartz.impl.StdSchedulerFactory instantiate INFO: Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties' 11-May-2005 19:11:49 org.quartz.impl.StdSchedulerFactory instantiate INFO: Quartz scheduler version: 1.4.5 11-May-2005 19:11:49 org.springframework.scheduling.quartz.SchedulerFactoryBean startScheduler INFO: Starting Quartz scheduler now 11-May-2005 19:11:49 org.quartz.core.QuartzScheduler start INFO: Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started. 11-May-2005 19:11:49 org.springframework.beans.factory.support.AbstractBeanFactory getBean INFO: Creating shared instance of singleton bean 'test' 11-May-2005 19:11:49 org.springframework.beans.factory.support.AbstractBeanFactory destroySingletons INFO: Destroying singletons in factory {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [schedulerFactoryBean,test]; root of BeanFactory hierarchy} 11-May-2005 19:11:49 org.springframework.scheduling.quartz.SchedulerFactoryBean destroy INFO: Shutting down Quartz scheduler 11-May-2005 19:11:49 org.quartz.core.QuartzScheduler shutdown INFO: Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED shutting down. 11-May-2005 19:11:49 org.quartz.core.QuartzScheduler pause INFO: Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED paused. 11-May-2005 19:11:49 org.quartz.core.QuartzScheduler shutdown INFO: Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED shutdown complete. Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'test' defined in class path resource [context.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyAccessExceptionsException: PropertyAccessExceptionsException (1 errors); nested propertyAccessExceptions are: [org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.quartz.impl.StdScheduler] to required type [org.springframework.scheduling.quartz.SchedulerFactoryBean] for property 'schedulerFactoryBean'] PropertyAccessExceptionsException (1 errors) org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.quartz.impl.StdScheduler] to required type [org.springframework.scheduling.quartz.SchedulerFactoryBean] for property 'schedulerFactoryBean' at org.springframework.beans.BeanWrapperImpl.doTypeConversionIfNecessary(BeanWrapperImpl.java:1010) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:772) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:679) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:819) at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:846) at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:835) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:896) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:714) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:331) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:257) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:277) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:319) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:80) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:65) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:56) at test.SchedulerTest.main(SchedulerTest.java:20) 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:585) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78) Process finished with exit code 1
    via by Vurti Galka,
  • I have an object with two setter methods that differ only by their parameter type, one takes String as an argument, the other one - java.util.regex.Pattern. The following cofiguration results in TypeMismatchException <property name="commandPattern"> <value>\.remove</value> </property> org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.util.regex.Pattern] for property 'commandPattern' at org.springframework.beans.BeanWrapperImpl.doTypeConversionIfNecessary(BeanWrapperImpl.java:1015) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:778) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:684) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:825) at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:852) at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:841) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:863) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:680) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:325) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveInnerBeanDefinition(AbstractAutowireCapableBeanFactory.java:941) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveValueIfNecessary(AbstractAutowireCapableBeanFactory.java:902) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveManagedList(AbstractAutowireCapableBeanFactory.java:993) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveValueIfNecessary(AbstractAutowireCapableBeanFactory.java:915) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:852) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:680) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:325) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:260) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:221) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveReference(AbstractAutowireCapableBeanFactory.java:973) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveValueIfNecessary(AbstractAutowireCapableBeanFactory.java:911) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:852) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:680) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:325) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:260) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:221) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveReference(AbstractAutowireCapableBeanFactory.java:973) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveValueIfNecessary(AbstractAutowireCapableBeanFactory.java:911) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveManagedMap(AbstractAutowireCapableBeanFactory.java:1033) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveValueIfNecessary(AbstractAutowireCapableBeanFactory.java:923) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:852) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:680) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:325) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:260) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:221) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:282) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:317) at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:131) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:303) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:250) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:219) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:111) at javax.servlet.GenericServlet.init(GenericServlet.java:211) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1068) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:725) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:131) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) However, the configuration with a Pattern object as an argument works fine: <property name="commandPattern"> <bean class="java.util.regex.Pattern" factory-method="compile"> <constructor-arg> <value>\.remove</value> </constructor-arg> </bean> </property> I'm using Spring 1.1.4 but I guess there are similar issues in other Spring releases.
    via by Jānis Rukšāns,
    • org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [de.innovations.wfr.model.gbz.LifeCycle$State] for property 'lifeCycleState' at org.springframework.beans.BeanWrapperImpl.doTypeConversionIfNecessary(BeanWrapperImpl.java:1103) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:849) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:733) at org.springframework.binding.support.BeanPropertyAccessStrategy$BeanPropertyValueModel.setValue(BeanPropertyAccessStrategy.java:259) at org.springframework.binding.value.support.AbstractValueModel.setValueSilently(AbstractValueModel.java:54) at org.springframework.binding.value.support.BufferedValueModel.commit(BufferedValueModel.java:197) at org.springframework.binding.value.support.BufferedValueModel$CommitTriggerHandler.commit(BufferedValueModel.java:264) at org.springframework.binding.value.CommitTrigger.commit(CommitTrigger.java:45) at org.springframework.binding.form.support.AbstractFormModel.doCommit(AbstractFormModel.java:485) at org.springframework.binding.form.support.AbstractFormModel.commit(AbstractFormModel.java:467) at org.springframework.richclient.form.AbstractForm.commit(AbstractForm.java:531)

    Users with the same issue

    Unknown visitor1 times, last one,