当前位置: 代码迷 >> Java Web开发 >> ssh出的严重异常
  详细解决方案

ssh出的严重异常

热度:485   发布时间:2016-04-10 23:57:43.0
ssh出的严重错误
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
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 [com.tt.bean/EMPLOYEE.hbm.xml] cannot be opened because it does not exist
这问题困扰我好几天了,我是从原来成功的案例中复制的架包,web.xml也是的,但老出这错,以前就没有的。咋回事啊,大神们帮帮我这小菜吧。
ssh

------解决方案--------------------
/EMPLOYEE.hbm.xml这个实体类配置文件没有了 添加上就能解决这个问题了
------解决方案--------------------
如下配置才对
<list>
<value>com/tt/bean/EMPLOYEE.hbm.xml</value>
</list>
</property>
------解决方案--------------------
你这个EMPLOYEE.hbm.xml配置的路径不正确,applicationContext.xml中的sessionFactory没有加载上EMPLOYEE.hbm.xml这个文件......看一下你的applicationContext,xml怎么写的。。。
------解决方案--------------------
<list>
<value>com/tt/bean/EMPLOYEE.hbm.xml</value>
</list>
配置了没?
------解决方案--------------------
引用:
那个实体类的映射文件有啊,在spring里面写的<property name="mappingResources">
<list>
<value>com.tt.bean/EMPLOYEE.hbm.xml</value>
</list>
</property>


你这个 value 怎么有有包路径,又有斜杠分隔符?

------解决方案--------------------
哈哈、配置里的点路径被认为是文件名了吧 名字是com.bb.bean下有个EMPLOYEE.hbm.xml的配置文件。。用斜杠
------解决方案--------------------
看错误是 applicationContext.xml文件错了  然后是没有找到
nested exception is java.io.FileNotFoundException: class path resource [com.tt.bean/EMPLOYEE.hbm.xml] cannot be opened because it does not exist
就是说没有找到Employee.hbm.xml文件   /反斜杠或者其他里面的错误  去了或者从新生成绑定下注入
------解决方案--------------------
应该是配置文件没读到
------解决方案--------------------
com.tt.bean/EMPLOYEE.hbm.xml  又是点 又是/的
写错了,只有/的
------解决方案--------------------
斜杠问题。。

------解决方案--------------------
发个链接,加深下理解http://wenku.baidu.com/view/30428619650e52ea5518980c.html
  相关解决方案