-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: How do I set up Hibernate?
PostPosted: Sun Nov 29, 2009 11:08 am 
Newbie

Joined: Wed Nov 12, 2008 7:58 am
Posts: 4
I am ready to scream. I have been trying (for days) to set up Hibernate for a simple application in IntelliJ against an Oracle database. Every google search turns up useless configurations for a server that I don't need.

The current error that I have is below. I can't find anything that tells me how to get rid of the logger error and the Persistence error is a real treat as well. I need to start from scratch with a step-by-step and line-by-line set of instructions. Can anyone provide a list of the absolute basics to set up a database connection?

log4j:WARN No appenders could be found for logger (org.hibernate.cfg.annotations.Version).
log4j:WARN Please initialize the log4j system properly.
javax.persistence.PersistenceException: [PersistenceUnit: ManagerUnit] Unable to configure EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:265)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:125)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33)
at astronomy.test.HibernateOracleTest.initEntityManager(HibernateOracleTest.java:67)
at astronomy.test.HibernateOracleTest.<clinit>(HibernateOracleTest.java:37)
Caused by: org.hibernate.AnnotationException: java.lang.NoSuchMethodException: org.hibernate.validator.ClassValidator.<init>(java.lang.Class, java.util.ResourceBundle, org.hibernate.validator.MessageInterpolator, java.util.Map, org.hibernate.annotations.common.reflection.ReflectionManager)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:374)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1162)
at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1226)
at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:173)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:854)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:191)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:253)
... 5 more
Caused by: java.lang.NoSuchMethodException: org.hibernate.validator.ClassValidator.<init>(java.lang.Class, java.util.ResourceBundle, org.hibernate.validator.MessageInterpolator, java.util.Map, org.hibernate.annotations.common.reflection.ReflectionManager)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getDeclaredConstructor(Unknown Source)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:362)
... 11 more
Nov 29, 2009 9:48:31 AM astronomy.test.HibernateOracleTest initEntityManager
INFO: Exception during JPA EntityManager instanciation.


Top
 Profile  
 
 Post subject: Re: How do I set up Hibernate?
PostPosted: Mon Nov 30, 2009 8:52 am 
Pro
Pro

Joined: Tue Aug 26, 2003 8:07 pm
Posts: 229
Location: Brisbane, Australia
The log4j thing doesn't have anything to do with hibernate, you'll need to look at the log4j doco to figure out what you're doing wrong. Try setting the log4j.debug property (or whatever it's called); that will pump out some debug info to stdout so you can try to diagnose the issue.

The persistence error is a bit weird - once you've got your log configuration issues sorted out, it might tell you a bit more about what's going on. If not, try to reduce your problem to a simple test case and post your mappings to see if people can help.

_________________
Cheers,
Shorn.


Top
 Profile  
 
 Post subject: Re: How do I set up Hibernate?
PostPosted: Mon Nov 30, 2009 12:15 pm 
Newbie

Joined: Wed Nov 12, 2008 7:58 am
Posts: 4
I finally did get it working by modifying an old tutorial that I had. The approach that I had to use was slightly different but, I still have no idea why the other one didn't work. Even the log error went away.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.