wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes problem connection hibernate eclipse oracle10g Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "problem connection hibernate eclipse oracle10g" Watch "problem connection hibernate eclipse oracle10g" New topic
Author

problem connection hibernate eclipse oracle10g

mhamdia hosni
Greenhorn

Joined: Dec 03, 2011
Posts: 2
hi every body
I have a consistent problem with hibernate when trying to map my classes to a oracle 10g database,I've just started to learn on it
I got this error when I was trying to run project:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/kAREM/Desktop/formation/WS_TEST/HibernateGRH/lib/slf4j-simple-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/kAREM/Desktop/Dossier%20bureau/hosni/J2EE/outils%20J2EE/librairie/hibernate/lib/slf4j-simple-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
38 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.3.2.GA
40 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
49 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
55 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
140 [main] INFO org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
140 [main] INFO org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.grh.util.Main.main(Main.java:26)
Caused by: java.lang.RuntimeException: Problème de configuration : /hibernate.cfg.xml not found
at com.grh.util.MotivationUtil.<clinit>(MotivationUtil.java:17)
... 1 more
Caused by: org.hibernate.HibernateException: /hibernate.cfg.xml not found
at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:170)
at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:1453)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1475)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)
at com.grh.util.MotivationUtil.<clinit>(MotivationUtil.java:15)
... 1 more

this is Motivation.hbm.xml:
i

Motivation.cfg.xml:


MotivationUtil.java



Motivation.java


and finally :Main.java

I have imported all lib of hibernate but
Fandy Akhmad
Ranch Hand

Joined: Nov 26, 2011
Posts: 32

Have you configure your Main class to detect Hibernate?


In configure() method you must declares your hibernate configuration file name explicitily. Why? Because your hibernate configuration saved with different name, not hibernate.cfg.xml.
If you save with different name, you must set configure like this.


So



And for error :
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/kAREM/Desktop/formation/WS_TEST/HibernateGRH/lib/slf4j-simple-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/kAREM/Desktop/Dossier%20bureau/hosni/J2EE/outils%20J2EE/librairie/hibernate/lib/slf4j-simple-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

You must import Slf4j library.Please see link below
http://www.slf4j.org/codes.html


Hope this help you

mhamdia hosni
Greenhorn

Joined: Dec 03, 2011
Posts: 2
I did that , no the message is:

log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.grh.util.Main.main(Main.java:7)
Caused by: java.lang.RuntimeException: Problème de configuration : Motivation.cfg.xml not found
at com.grh.util.MotivationUtil.<clinit>(MotivationUtil.java:17)
... 1 more
Caused by: org.hibernate.HibernateException: Motivation.cfg.xml not found
at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:147)
at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:1405)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1427)
at com.grh.util.MotivationUtil.<clinit>(MotivationUtil.java:15)
... 1 more
 
Consider Paul's rocket mass heater.
 
subject: problem connection hibernate eclipse oracle10g