PDA

View Full Version : TypeMismatchException: Failed to convert property value of type...



malmit
Nov 11th, 2005, 10:57 AM
I ran into this annoying exception which took a long time to figure out and just want post it to save someone else the trouble and time.

Here is the stacktrace that I received:

11:47:19,708 ERROR [[/search]] Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListe ner
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'transactionManagerDataAccessTarget' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyAccessExceptions Exception: PropertyAccessExceptionsException (1 errors); nested propertyAccessExceptions are: [org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.springframework.jms.core.JmsTemplate] to required type [org.springframework.jms.core.JmsTemplate] for property 'jmsTemplate']
PropertyAccessExceptionsException (1 errors)
org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.springframework.jms.core.JmsTemplate] to required type [org.springframework.jms.core.JmsTemplate] for property 'jmsTemplate'
at org.springframework.beans.BeanWrapperImpl.doTypeCo nversionIfNecessary(BeanWrapperImpl.java:1035)
at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrapperImpl.java:803)
at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrapperImpl.java:716)
at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrapperImpl.java:844)
at org.springframework.beans.BeanWrapperImpl.setPrope rtyValues(BeanWrapperImpl.java:871)
at org.springframework.beans.BeanWrapperImpl.setPrope rtyValues(BeanWrapperImpl.java:860)


The message tells me that a org.springframework.jms.core.JmsTemplate can not be converted to a org.springframework.jms.core.JmsTemplate??? After ripping apart my application I found out that I included spring.jar in a war file of mine and also included the same spring.jar at the ear level. After removing the war level spring.jar and redeploying the error message went away.