Invocation of init method failed; nested exception is java.io.FileNotFoundException: class path reso

来源:互联网 发布:python网络爬虫源码 编辑:程序博客网 时间:2024/05/23 02:09


org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed;nested exception is java.io.FileNotFoundException: class path resource [user.xml] cannot be opened because it does not exist
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1488)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFacto


spring 配置文件 ,配置了一个  映射映射文件,有点不是很明白。这不是hibernate配置文件吗?spring中怎么又也要用到hibernate?


 <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
  <property name="dataSource"  ref="dataSource"/>
  <property name="hibernateProperties">
  <props>
  <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
  <prop key="hibernate.show_sql" >true</prop>
  <prop key="hibernate.format_sql" >true</prop>
  <prop key="hibernate.hbm2ddl.auto">update</prop>
   </props>
   </property>
    <property name="mappingResources">
   <list>
    <value>user.xml</value>
   </list>
   </property> 

  </bean>


0 0
原创粉丝点击