spring配置文件出错

叶知秋 发布于 2013/02/28 19:44
阅读 1K+
收藏 0
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.sseinfo.stockholder.bg.service.builder.StaticJsFileBuilder.builder(StaticJsFileBuilder.java:38)
at com.sseinfo.stockholder.bg.service.builder.StaticJsFileBuilder.main(StaticJsFileBuilder.java:67)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-db.xml]: Initialization of bean failed; nested exception is org.hibernate.MappingNotFoundException: resource: com/sseinfo/stockholder/bg/po/StockholderActiveInfoPO.hbm.xml not found
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:370)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:269)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:320)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:87)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:72)
at com.sseinfo.stockholder.bg.service.StockFactoryBean.<clinit>(StockFactoryBean.java:12)
... 2 more
Caused by: org.hibernate.MappingNotFoundException: resource: com/sseinfo/stockholder/bg/po/StockholderActiveInfoPO.hbm.xml not found
at org.hibernate.cfg.Configuration.addResource(Configuration.java:596)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1621)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1589)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1568)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1542)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1477)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:627)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1059)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:363)
... 9 more


我检查了hibernate.cfg.xml这个配置文件,发现没有字母写错,路径也没有错误。

以下是问题补充:

@叶知秋: <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop> <prop key="hibernate.show_sql">true</prop> </props> </property> <property name="configLocation"> <value>classpath:hibernate.cfg.xml</value> </property> </bean> (2013/02/28 19:45)
@叶知秋:将hibernate.cfg.xml文件中出错的映射文件注释掉后。再次运行时,报其他映射文件的错误 (2013/03/01 10:44)
加载中
0
乾坤摄
乾坤摄

com/sseinfo/stockholder/bg/po/StockholderActiveInfoPO.hbm.xml not found 这个文件不存在

0
叶知秋
叶知秋
这个文件有,而且我检查了没有字母和标点符号的错误,所以才请教大家
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部