Hibernate version: 2.1.7c
Does hibernate recognize the JNDI mapping from a web application web.xml?
If you look below I map to jdbc/MamothDB, but I guess Hibernate wanst the full path, which in JBoss would be... java:/jdbc/MamothDB??
I have...
jboss-web.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.3//EN" "http://www.jboss.org/j2ee/dtds/jboss-web_3_0.dtd">
<jboss-web>
<context-root>/mamoth</context-root>
<resource-ref>
<res-ref-name>jdbc/MamothDB</res-ref-name>
<jndi-name>java:/jdbc/MamothDB</jndi-name>
</resource-ref>
</jboss-web>
web.xml
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>mamoth Blue</display-name>
<description>mamoth Blue web site</description>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/MamothDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
Datasource...
Code:
<datasources>
<local-tx-datasource>
<jndi-name>jdbc/MamothDB</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/mamoth</connection-url>
<driver-class>org.gjt.mm.mysql.Driver</driver-class>
<user-name>xxxxxx</user-name>
<password>xxxxxx</password>
<min-pool-size>5</min-pool-size>
<max-pool-size>15</max-pool-size>
<check-valid-connection-sql>select * from Artist where Id = 1</check-valid-connection-sql>
</local-tx-datasource>
</datasources>