• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem connection hibernate eclipse oracle10g

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 32
MySQL Database Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
reply
    Bookmark Topic Watch Topic
  • New Topic