[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - IllegalAccessError with Hibernate Annotation

apfeuti do-not-reply at jboss.com
Fri May 4 11:58:46 EDT 2007


Hi

If I try to build a SessionFactory for annotated classes

AnnotationConfiguration cfg = new AnnotationConfiguration();
  | cfg.addAnnotatedClass(mypackage.MyAnnotatedEntity.class);
  |         SessionFactory sessionFactory = cfg.buildSessionFactory();

(or if I try with an xml-configuration instead the above code)

 I get always this error:

java.lang.IllegalAccessError: tried to access method org.hibernate.cfg.Mappings.(Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/List;Ljava/util/List;Lorg/hibernate/cfg/NamingStrategy;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/List;Ljava/util/Map;Ljava/util/Map;)V from class org.hibernate.cfg.ExtendedMappings
	at org.hibernate.cfg.ExtendedMappings.(ExtendedMappings.java:65)
	at org.hibernate.cfg.AnnotationConfiguration.createExtendedMappings(AnnotationConfiguration.java:175)
	at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:263)
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1210)
	at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)

I use the latest Hibernate and Hibernate-Annotations.
I deployed the latest hibernate3.jar to /server/all/lib and
hibernate-annotations.jar, hibernate-commons-annotations.jar, ejb3-persistence.jar to /server/all/farm.

The same code works perfectly in a standalone-environment (no JBoss, just a VM for JUnit-Tests). So it cannot be a incompatibility between Hibernate and Hibernate-Annotations.

Thanks for any help
Andreas

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043259#4043259

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043259



More information about the jboss-user mailing list