3 Replies Latest reply on Feb 26, 2007 4:59 PM by Mike Baranczak

    Strange IllegalAccessError with JBoss + Hibernate

    Guillaume Bilodeau Newbie

      Hi guys,

      I'm getting the following error when loading up my application on JBoss 4.0.5:

      java.lang.IllegalAccessError: tried to access method org.hibernate.cfg.Mappings.<init>(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.<init>(ExtendedMappings.java:65)
       at org.hibernate.cfg.AnnotationConfiguration.createExtendedMappings(AnnotationConfiguration.java:166)
       at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:254)
       at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1039)
       at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1211)
       at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:154)
       at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:847)
       at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:385)
       at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:126)
      


      This application is running fine on Tomcat 5.5 and Glassfish (Sun JSAS 9.0), but not on JBoss.

      Looking at the code, I see that the two classes (Mappings and ExtendedMappings) are declared to be in the same package (org.hibernate.cfg) but are located in 2 different JARs (Hibernate and Annotations). Maybe this is enforced more strictly by JBoss?

      I'm running on Java 5, JBoss 4.0.5GA, Hibernate 3.2GA, Hibernate Annotations 3.2GA and Hibernate EntityManager 3.2GA. All the libraries are correctly deployed and there is no mistake in using a release candidate instead of the final release.

      Any ideas?

      Thanks,
      GB