0, Preparation Conditions JBoss4 Database Configuration Success, see http://blog.9cbs.net/chenm"jboss4 installation configuration "Built under $ jboss_home $ / server / default / deploy --- javatrip --- WEB-INF - CLASS --- LIB 1, Hibernate Configuration 1.1, copy Hibernate's JAR Pack to $ JBOSS_HOME $ / Server / Default / Deploy / Javatrip / Web-INF / LIB Directory: CGLIB-FULL- 2.0.2.jar Commons-Collections-2.1.1.jar Commons-logging-1.0.4.jar DOM4J-1.4.jar ehcache-0.9.jar jta.jar log4j-1.2.8.jar odmg-3.0.jar Hibernate2. JAR1.2, copy hibernate.cfg.xml to $ JBOSS_HOME $ / Server / Default / Conf, set the database to use the JBoss4 database connection. Xml version = '1.0' encoding = 'utf-8'?>
hibernate-configuration> 2, test See http://blog.csdb.net/CHENM "Install Hibernate Tomcat", except for the Tomcat section, directory structure, and code is exactly the same.