hibernate 的一些初级问题
小弟我最近在学习hibernate,但是自己写hibernate应用时却出现了很多问题,都没有真正运行过一个hibernate应用;
1. 我导入包时导入的都是从hibernate.org下载的hibernate3解压后的hibernate3.jar以及lib文件夹下面的jar包,但是运行的时候好像还提示我缺少了jar包,好像是slf4j的相关的包,根据他的错误提示后才解决这个问题;但是我就想知道难道使用hibernate3.jar及同文件下达lib文件里的jar包还不够吗(当然还加了数据库的驱动jar包)?
2.现在好像是没有提示缺少jar包了,但是还是报错,望大家帮忙解释并解决一下,错误信息为:
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.MyTest.main(MyTest.java:16)
Caused by: org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1528)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1448)
at com.HibernateUtil.<clinit>(HibernateUtil.java:11)
... 1 more
Caused by: org.dom4j.DocumentException: Error on line 1 of document : The processing instruction must begin with the name of the target. Nested exception: The processing instruction must begin with the name of the target.
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1518)
... 4 more
另:我的应用很简单,hibernate.cfg.xml的配置和位置应该都没有问题