It is a bit different from Tomcat5 and WebLogic8.
1. When configuring the DataSource's JNDI in the file hibernate.cfg.xml, if weblogic8 is used, you can configure it as follows (where JNDI's name value is "JNDI / DATASOURCE"): JNDI / DATASOURCE Property>
2, and press the configuration in Tomcat5.x, it will be reported: no data source is not found; the configuration is changed as follows, then the problem resolve: Java: comp / ENV / JNDI / DATASOURCE Property>