-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Getting datasource from JBoss I have...JNDI problem.
PostPosted: Sat Dec 11, 2004 8:11 pm 
Beginner
Beginner

Joined: Fri Dec 10, 2004 11:46 pm
Posts: 37
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>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.