I wanted some of the new features of hibernate3, but am stuck with jboss 3.2.6 for a while, so I thought I'd share my process for getting that setup working.
1. check out Hibernate3 and build the jar (or download it)
2. download and unpack the jboss 326 source
(from the jboss-3.2.6-src directory)
3. copy hibernate3.jar(from step 1) to thirdparty/hibernate/lib/
4. edit build/build.xml - it references hibernate2.jar in one spot, change it to hibernate3.jar
5. edit hibernate/build.xml - it references hibernate2.jar in one spot, change it to hibernate3.jar
6. Edit every *.java file under hibernate/src/main/. You need to change all imports from "net.sf.hibernate.*" to "org.hibernate.*" (There are only 5 classes that need changes, so it's not a big deal)
7. (optional) I also changed the package name of all the files from org.jboss.hibernate.* to org.jboss.hibernate3.*, so I could deploy my new jar file alongside of the existing jboss-hibernate.jar without trouble. That means changing the directory name too.
8. cd to build and run build.sh (of course, you might run build.bat)
9. Once the build is done, if you're still in the build directory, the file you want is output/jboss-3.2.6/server/default/lib/jboss-hibernate.jar. I renamed mine to jboss-hibernate3.jar.
10. Copy the jar mentioned in step 8 to your real jboss 3.2.6 installation, to the server/{whatever}/lib directory.
11. Also place hibernate3.jar and antlr-2.7.4.jar in server/{whatever}/lib directory. I got the antlr jar when I checked out the Hibernate3 source. (step 1)
12. I had to modify the hibernate-service.xml file that ends up in my HAR file. Wherever I referenced a hibernate2 class ("net.sf") I changed it to reference the hibernate3 class ("org")
Hope that helps someone.
|