0 Replies Latest reply on Mar 10, 2011 6:14 AM by Jens Augustsson

    Cannot put hibernate-core.jar in JBoss patch directory

    Jens Augustsson Newbie

      Hello all,

       

      How do I do to use a JBoss patch directory for Hibernate jars?

       

      If I move {$JBOSS_HOME}/common/lib/hibernate-core.jar out to a directory outside  {$JBOSS_HOME} (like /home/jens/patchdir/), create a simple JEE app (EAR with Servlet in WAR, accessing SLSB and Entity in a JAR) with once entity and start up jboss with the patch directory flag...

       

      bin/run.sh -p "/home/jens/patchdir/"

       

      ...jboss will note that this patch directory is used and obviously find the classes, but on startup of app throw an IllegalAccessError:

       

      11:14:41,912 DEBUG [PersistenceUnitInfoImpl] Found persistence.xml file in EJB3 jar

      11:14:41,972 INFO  [Version] Hibernate Annotations 3.4.0.GA

      11:14:41,988 INFO  [Environment] Hibernate 3.3.1.GA

      11:14:41,993 INFO  [Environment] hibernate.properties not found

      11:14:41,997 INFO  [Environment] Bytecode provider name : javassist

      11:14:42,001 INFO  [Environment] using JDK 1.4 java.sql.Timestamp handling

      11:14:42,143 INFO  [Version] Hibernate Commons Annotations 3.1.0.GA

      11:14:42,154 INFO  [Version] Hibernate EntityManager 3.4.0.GA

      11:14:42,210 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=mytestEAR-1.0.ear/mytestJAR-1.0.jar#sample state=Create

      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)

                at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:130)

                at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:301)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:585)

                at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)

      ...

       

      Using JBoss 5.1 with JDK5.

       

      The real Use Case is that I've patched hibernate-core.jar in Hibernate 3.3.1 and would like to start up JBoss without having to replace internal jars, but once that didn't work I simplified the test by trying to use the standard hibernate-core.jar in a patch directory.

       

      br,

      Jens