日期:2014-05-17  浏览次数:20680 次

Java搭建SSH错误
配置文件信息:
 <bean id="orgTypeDao" class="com.bjpowernode.pmes.dao.impl.OrgTypeDaoImpl">
       <property name="sessionFactory" value="sessionFactory"/>
    </bean>
    <bean id="orgDao" class="com.bjpowernode.pmes.dao.impl.OrgDaoImpl">
       <property name="sessionFactory" value="sessionFactory"/>
    </bean>
错误提示:
 ERROR ContextLoader:215 - Context initialization failed
org.springframework.beans.factory.BeanCreationException:
: Error creating bean with name 'orgTypeDao' defined in file [F:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\pmes_01\WEB-INF\classes\applicationContext-dao.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [org.hibernate.SessionFactory] for property 'sessionFactory'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] 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: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:222)
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:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)