I followed the Introduction to Hibernate (Chapter 2), I insured that all my code and xml files were copied correctly. When I compile the project I get
Code:
C:\Documents and Settings\Administrator\Desktop\Events>ant
Buildfile: build.xml
clean:
[delete] Deleting directory C:\Documents and Settings\Administrator\Desktop\E
vents\bin
[mkdir] Created dir: C:\Documents and Settings\Administrator\Desktop\Events\bin
copy-resources:
[copy] Copying 2 files to C:\Documents and Settings\Administrator\Desktop\E
vents\bin
compile:
[javac] Compiling 3 source files to C:\Documents and Settings\Administrator\
Desktop\Events\bin
[javac] Note: C:\Documents and Settings\Administrator\Desktop\Events\src\Hib
ernateUtil.java uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
Not sure what unchecked or unsafe operation are?????? But the real problem is when I try to run the actual program....I get the following...
Code:
C:\Documents and Settings\Administrator\Desktop\Events>ant run -Daction=store
Buildfile: build.xml
clean:
[delete] Deleting directory C:\Documents and Settings\Administrator\Desktop\E
vents\bin
[mkdir] Created dir: C:\Documents and Settings\Administrator\Desktop\Events\
bin
copy-resources:
[copy] Copying 2 files to C:\Documents and Settings\Administrator\Desktop\E
vents\bin
compile:
[javac] Compiling 3 source files to C:\Documents and Settings\Administrator\
Desktop\Events\bin
[javac] Note: C:\Documents and Settings\Administrator\Desktop\Events\src\Hib
ernateUtil.java uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
run:
[java] log4j:WARN No appenders could be found for logger (org.hibernate.cfg
.Environment).
[java] log4j:WARN Please initialize the log4j system properly.
[java] Initial SessionFactory creation failed.org.hibernate.HibernateExcept
ion: problem parsing configuration/hibernate.cfg.xml
[java] Exception in thread "main" java.lang.ExceptionInInitializerError
[java] at HibernateUtil.<clinit>(Unknown Source)
[java] at EventManager.createAndStoreEvent(Unknown Source)
[java] at EventManager.main(Unknown Source)
[java] Caused by: org.hibernate.HibernateException: problem parsing configu
ration/hibernate.cfg.xml
[java] at org.hibernate.cfg.Configuration.doConfigure(Configuration.jav
a:1173)
[java] at org.hibernate.cfg.Configuration.configure(Configuration.java:
1112)
[java] at org.hibernate.cfg.Configuration.configure(Configuration.java:
1098)
[java] ... 3 more
[java] Caused by: org.dom4j.DocumentException: Error on line 1 of document
: The ' = ' character must follow "version-" in the XML declaration. Nested exc
eption: The ' = ' character must follow "version-" in the XML declaration.
[java] at org.dom4j.io.SAXReader.read(SAXReader.java:482)
[java] at org.hibernate.cfg.Configuration.doConfigure(Configuration.jav
a:1168)
[java] ... 5 more
[java] Java Result: 1
BUILD SUCCESSFUL
Total time: 5 seconds
C:\Documents and Settings\Administrator\Desktop\Events>
Any help with this would be greatly appreciated. I figured that starting with the getting started guide on this site would be a great place to learn hibernate, but it won't work..... :( . Thanks for any help in advance.