junjie

           

          SSH異常總結

          1.HIBERNATE異常
          Exception in thread "main" 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 org.hibernate.InvalidMappingException: Could not parse mapping document from input stream
          Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from input stream
           at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:508)
           at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:656)
           at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:134)
           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1203)
           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1172)
           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
           at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
           at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
           at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
           at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
           at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:285)
           at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
           at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:122)
           at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:66)
           at cn.qdqn.ssh.test.AddUserInfo.main(AddUserInfo.java:25)
          Caused by: org.dom4j.DocumentException: \G1:\JAR\hibernate-mapping-3.0.dtd (文件名、目錄名或卷標語法不正確。) Nested exception: \G1:\JAR\hibernate-mapping-3.0.dtd (文件名、目錄名或卷標語法不正確。)
           at org.dom4j.io.SAXReader.read(SAXReader.java:484)
           at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:499)
           ... 14 more

          異常類型:HiBERNATE中的xml解析器不能找到DTD文件
          異常原因:因為hibernate的xml解析器解析.xml文件的時候需要根據文檔頭的 DOCTYPE去找DTD定義文件
          查看你定義的.xml文件是有效。
          解決方法:正確配置DTD文件的路徑

          posted on 2008-12-16 15:55 wangjunjie 閱讀(651) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           

          導航

          統計

          常用鏈接

          留言簿(2)

          隨筆檔案

          文章分類

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 威远县| 宁波市| 准格尔旗| 正安县| 阳新县| 双鸭山市| 七台河市| 盈江县| 九龙城区| 肥西县| 安阳市| 松桃| 松江区| 齐河县| 黎平县| 阜城县| 黎城县| 阿城市| 高碑店市| 泗阳县| 齐齐哈尔市| 睢宁县| 泾阳县| 黑水县| 溆浦县| 新邵县| 芜湖县| 尼勒克县| 江安县| 榆树市| 定日县| 耒阳市| 房山区| 长沙市| 天气| 嵊州市| 响水县| 万盛区| 岑巩县| 都兰县| 尼勒克县|