hibernate配置文件目录:WEB-INF\classes\config\mappings
spring-hibernate.xml中配置方式<property name="mappingLocations"> 
      <list>
        <value>config/mappings/test.hbm.xml</value>
        <value>config/mappings/test1.hbm.xml</value>
        <value>config/mappings/test2.hbm.xml</value>
        <value>config/mappings/test3.hbm.xml</value>webLogic错误提示:
weblogic.application.ModuleException:
Could not open ServletContext resource [/config/mappings/ADMIN_ChildrenConfigDetail.hbm.xml]
之前解决了关于log4j方面的文件找不到问题。为什么webLogic部署war包怎么纠结呢!有没有终极解决方法?

解决方案 »

  1.   

    看看spring-hibernate 配置的地方 尽量把这些文件放在同一个目录 试试
      

  2.   

    [/config/mappings/ADMIN_ChildrenConfigDetail.hbm.xml 这个文件对应的路径是对的么、
      

  3.   


    这个是对的!就是对对应上面的test.hbm.xml。我忘记改这个了!
      

  4.   

    weblogic对访问web-inf下的资源文件必须写全路径,它无法识别相对路径,包括struts2的配置文件如果你放到web-inf下,在weblogic 8 9 10上都找不到,weblogic对路径的识别比较严格,没有tomcat那么随意,所以建议你写全路径比如:...\domains\base_domain\autodeploy\应用名\web-inf\.... 一个一个试试吧,如果没用就把配置文件丢进类路劲最好,hibernate加载配置文件不仅有mappingLocations一种方式,还有mappingDirectoryLocations等