Hello
I have an app I am porting from JBoss 4.3 to EAP6. It works in 4.3, but fails in EAP6. The 4.3 version is heavily tested in JDK6 and appears to work in JDK7. I'm working in JDK7 now.
The error I see is :
Cannot convert value of type [org.springframework.orm.hibernate3.LocalSessionFac toryBean] to required type [org.hibernate.SessionFactory] for property 'sessionFactory': no matching editors or conversion strategy found
Between the EAP 4.3 and 6.0 artifacts, the jars appear to be identical. Any leads or suggestions for troubleshooting? I have confirmed that the Spring and Hibernate jars have not changed. I had to do some repackaging of jboss-web.xml and web.xml to get it running, but have otherwise not modified the classpath. I get this error both in Spring 3.0.6 and 3.1.1.
Thanks in advance!
Steven
Code:<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="mappingLocations"> <value>classpath:/config/hibernate/mappings/*.hbm.xml</value> </property> <!--property name="entityInterceptor"> <ref local="auditInterceptor"/> </property --> <property name="entityInterceptor"> <ref local="afterTransactionInterceptor" /> </property> <property name="hibernateProperties"> <props> <!-- JDBC --> <prop key="hibernate.jdbc.fetch_size">10</prop> <prop key="hibernate.jdbc.batch_size">10</prop> <prop key="hibernate.default_batch_fetch_size">16</prop> <!-- TRANSACTION --> <prop key="hibernate.transaction.auto_close_session">true</prop> <!-- SQL DIALECTS --> <prop key="hibernate.dialect">org.hibernatespatial.oracle.OracleSpatial10gDialect</prop> <!-- CACHE --> <prop key="hibernate.cache.region.factory_class">net.sf.ehcache.hibernate.SingletonEhCacheRegionFactory</prop> <prop key="net.sf.ehcache.configurationResourceName">ehcache.xml</prop> <prop key="hibernate.cache.use_second_level_cache">true</prop> <prop key="hibernate.cache.region.jbc2.query.localonly">true</prop> <prop key="hibernate.cache.use_query_cache">true</prop> <prop key="hibernate.cache.use_structured_entries">true</prop> <!-- STATISTICS - this should not be enabled for production --> <prop key="hibernate.generate_statistics">false</prop> <!-- SQL DEBUGGING - this should not be enabled for production --> <prop key="hibernate.show_sql">false</prop> <prop key="hibernate.format_sql">true</prop> <prop key="hibernate.use_sql_comments">true</prop> <!-- MISCELLANEOUS --> <prop key="hibernate.query.substitutions">true 1, false 0, Y 'y', N 'n'</prop> <prop key="hibernate.current_session_context_class">thread</prop> <prop key="hibernate.use_identifer_rollback">true</prop> <prop key="hibernate.order_updates">true</prop> </props> </property> <property name="eventListeners"> <map> <entry key="merge"> <bean class="org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener" /> </entry> </map> </property> </bean>
This is the class that fails:
Code:<bean id="extendedObjectMapper" class="com.axeda.DBMapperTest2"> <property name="sessionFactory"> <ref bean="sessionFactory" /> </property> </bean>Code:import org.springframework.orm.hibernate3.support.HibernateDaoSupport; public class DBMapperTest2 extends HibernateDaoSupport{/**/}
When I inject the code, I get:
Code:Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'extendedObjectMapper' defined in class path resource [config/spring/applicationContext-environment.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.springframework.orm.hibernate3.LocalSessionFactoryBean' to required type 'org.hibernate.SessionFactory' for property 'sessionFactory'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.springframework.orm.hibernate3.LocalSessionFactoryBean] to required type [org.hibernate.SessionFactory] for property 'sessionFactory': no matching editors or conversion strategy found at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE] at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE] ... 60 more Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.springframework.orm.hibernate3.LocalSessionFactoryBean' to required type 'org.hibernate.SessionFactory' for property 'sessionFactory'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.springframework.orm.hibernate3.LocalSessionFactoryBean] to required type [org.hibernate.SessionFactory] for property 'sessionFactory': no matching editors or conversion strategy found at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:481) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE] at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:518) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE] at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:512) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1371) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1330) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE] ... 66 more Caused by: java.lang.IllegalStateException: Cannot convert value of type [org.springframework.orm.hibernate3.LocalSessionFactoryBean] to required type [org.hibernate.SessionFactory] for property 'sessionFactory': no matching editors or conversion strategy found at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:233) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE] at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:466) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE] ... 72 more


Reply With Quote