4 Replies Latest reply on Jan 7, 2004 10:35 AM by juha

    Hibernate Hell

    kellyschrock Newbie


      Up until very recently, I've done all of my JBoss and Hibernate development on Windows. I'm now using RedHat9 to do basically the same thing. Actually, I should say I WOULD do it, if I could get anything to work. I am attempting to use Hibernate from within a Session bean, which has worked fine before. Per the Hibernate instructions, I have copied the requisite .jar files into $JBOSS_HOME/lib. (This worked on Windows, whereas $JBOSS_HOME/server/default/lib did NOT work. On Linux, putting the .jar files into $JBOSS_HOME/server/default/lib causes JBoss's JVM to crash completely at the point where I try to open a Session.)

      So, now I have hibernate2.jar in the classpath, but no matter what I do, I get this error when I try to open a Session:

      java.lang.NoClassDefFoundError: net/sf/hibernate/collection/Set
      at net.sf.hibernate.type.TypeFactory.set(TypeFactory.java:184)
      at net.sf.hibernate.mapping.Set.getType(Set.java:29)
      at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:856)

      I have tried putting the hibernate jar file into my EJB's jar file, but I still get either this error or a "linker constraints violated" error when trying to open a Session. This actually makes sense if the same jar file is being loaded twice.

      I only have one version of Hibernate's jar files on this machine. Has anyone ever actually used JBoss, Linux, and Hibernate together? If so, what pagan god do I need to sacrifice a virgin to in order to experience that particular joy for myself??? It seems like I'm having to do a hell of a lot of work just to see anything useful.

        • 1. Re: Hibernate Hell

          Might be an idea to change that JVM that crashes and then go back to your original configuration.

          • 2. Re: Hibernate Hell
            kellyschrock Newbie

            It isn't just the JVM crashing, although that is troublesome as you might imagine. It's the fact that NO MATTER WHAT I have tried, it doesn't work. If it's not crashing the JVM, I'm getting "NoClassDefFoundError"s for hibernate classes, even though they're in the classpath AND embedded in my EJB jar. I'm using JDK 1.4.2. I'm going to try using a different JDK/JVM tonight, and see if that makes any difference. If it does, I will be suprised.

            • 3. Re: Hibernate Hell

              Using system classpath is definitely not the way to go. Try another more stable VM and then go back to the originally suggested method of adding the library to jboss/server//lib dir (I don't see how using jboss/lib directory would ever had worked, that only contains a fixed set of libraries for the bootstrap, everything additional is ignored).

              • 4. Re: Hibernate Hell

                Should have been jboss/server/[config]/lib, forums bug