-->
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.  [ 6 posts ] 
Author Message
 Post subject: Error creating EntityManagerFactory, IllegalAccessError
PostPosted: Wed Feb 20, 2008 7:58 am 
Beginner
Beginner

Joined: Tue Mar 13, 2007 8:26 am
Posts: 25
Hello,

When I try to create the EntityManagerFactory I get this error:

Quote:
java.lang.IllegalAccessError: tried to access method org.hibernate.engine.CascadeStyle.<init>()V from class org.hibernate.engine.EJB3CascadeStyle$1
at org.hibernate.engine.EJB3CascadeStyle$1.<init>(EJB3CascadeStyle.java:24)
at org.hibernate.engine.EJB3CascadeStyle.<clinit>(EJB3CascadeStyle.java:19)
at org.hibernate.ejb.event.EJB3PersistEventListener.<clinit>(EJB3PersistEventListener.java:19)
at org.hibernate.ejb.EventListenerConfigurator.<init>(EventListenerConfigurator.java:80)
at org.hibernate.ejb.Ejb3Configuration.<init>(Ejb3Configuration.java:132)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:119)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)


I don't understand why this. What can I do to solve this?

Hibernate Core 3.2.6.ga
Hibernate Annotations 3.3.0 GA
Hibernate EntityManager 3.3.1 GA[/quote]

_________________
---
Felipe Marin Cypriano


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 20, 2008 1:27 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
you have an old hibernate jar somewhere.

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Re: Error creating EntityManagerFactory, IllegalAccessError
PostPosted: Tue Apr 03, 2012 4:24 pm 
Newbie

Joined: Tue Apr 03, 2012 4:19 pm
Posts: 2
I am also experiencing the same problem, when i try to deploy my application in glassfish 3.1.1(build 12).
[#|2012-04-03T16:22:44.452-0400|SEVERE|glassfish3.1.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=17;_ThreadName=Thread-2;|tried to access method org.hibernate.engine.CascadeStyle.<init>()V from class org.hibernate.engine.EJB3CascadeStyle$1
java.lang.IllegalAccessError: tried to access method org.hibernate.engine.CascadeStyle.<init>()V from class org.hibernate.engine.EJB3CascadeStyle$1
at org.hibernate.engine.EJB3CascadeStyle$1.<init>(EJB3CascadeStyle.java:24)
at org.hibernate.engine.EJB3CascadeStyle.<clinit>(EJB3CascadeStyle.java:19)
at org.hibernate.ejb.event.EJB3PersistEventListener.<clinit>(EJB3PersistEventListener.java:19)
at org.hibernate.ejb.EventListenerConfigurator.<init>(EventListenerConfigurator.java:81)
at org.hibernate.ejb.Ejb3Configuration.<init>(Ejb3Configuration.java:136)

I do not understand when you say"there is an old jar somewhere :("
I have the following jars in my lib folder
hibernate-core-3.6.0cr2
log4j-1.2.16
hibernate-commons-annotations-3.2.0.final
dom4j-1.6.1
sl4j-api-1.6.4
log4j-over-sl4j-1.6.4
mysql-connector-java-5.1.19-bin

Please, help me


Top
 Profile  
 
 Post subject: Re: Error creating EntityManagerFactory, IllegalAccessError
PostPosted: Mon Apr 16, 2012 3:27 pm 
Newbie

Joined: Mon Apr 16, 2012 2:42 pm
Posts: 5
I, too, am getting the error:
java.lang.IllegalAccessError: tried to access method org.hibernate.cfg.Configuration.<init>(Lorg/hibernate/cfg/SettingsFactory;)V from class org.hibernate.ejb.Ejb3Configuration
when executing this line:
Code:
emFactory = Persistence.createEntityManagerFactory("practice");

I am following along in the Java Persistence with Hibernate book trying to learn Hibernate. Everything was going very well until they switched from SessionFactory to EntityManagerFactory. I am using:
Code:
hibernate-core-4.1.1.Final.jar
hibernate-commons-annotations-4.0.1.Final.jar
hibernate-jpa-2.0-api-1.0.1.Final.jar
javassist-3.15.0-GA.jar
hibernate-entitymanager-3.3.2.GA.jar
hibernate-c3p0-4.1.1.Final.jar
log4j-1.2.15.jar
...

I don't think it is because of an old hibernate jar. But Hibernate is new to me. Any ideas?
...


Top
 Profile  
 
 Post subject: Re: Error creating EntityManagerFactory, IllegalAccessError
PostPosted: Mon Apr 16, 2012 6:26 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
you need hibernate-entitymanager-4.1.1.Final.jar not the version 3.3.2.GA

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Re: Error creating EntityManagerFactory, IllegalAccessError
PostPosted: Tue Apr 17, 2012 1:08 pm 
Newbie

Joined: Mon Apr 16, 2012 2:42 pm
Posts: 5
That did the trick! Thanks so much.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.