I am trying to run the EventManager the very first tutorial and I am getting the following error where in it says hibernate.cfg.xml not found.
The file hibernate.cfg.xml not found is in the src folder and has been successfully copied over to the bin folder, but I am wondering why I am getting the error and how to fix this. I am very new to hibernate.
BUILD SUCCESSFUL
Total time: 1 second
C:\HibernateProjects\FirstProject>ant run -Daction=store
Buildfile: build.xml
clean:
[delete] Deleting directory C:\HibernateProjects\FirstProject\bin
[mkdir] Created dir: C:\HibernateProjects\FirstProject\bin
copy-resources:
[copy] Copying 4 files to C:\HibernateProjects\FirstProject\bin
[copy] Copied 2 empty directories to 1 empty directory under C:\HibernatePr
ojects\FirstProject\bin
compile:
[javac] Compiling 3 source files to C:\HibernateProjects\FirstProject\bin
run:
[java] SLF4J: This version of SLF4J requires log4j version 1.2.12 or later.
See also
http://www.slf4j.org/codes.html#log4j_version
[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: /hibernate.cfg.xml not found
[java] Exception in thread "main" java.lang.ExceptionInInitializerError
[java] at util.HibernateUtil.<clinit>(Unknown Source)
[java] at events.EventManager.createAndStoreEvent(Unknown Source)
[java] at events.EventManager.main(Unknown Source)
[java] Caused by: org.hibernate.HibernateException: /hibernate.cfg.xml not
found
[java] at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHel
per.java:170)
[java] at org.hibernate.cfg.Configuration.getConfigurationInputStream(C
onfiguration.java:1439)
[java] at org.hibernate.cfg.Configuration.configure(Configuration.java:
1461)
[java] at org.hibernate.cfg.Configuration.configure(Configuration.java:
1448)
[java] ... 3 more
[java] Java Result: 1
BUILD SUCCESSFUL
Total time: 1 second
Thanks,
Manisha