-
1. Re: problems with jdbc jndi lookups
jaikiran Mar 14, 2009 2:45 AM (in response to pinan)Post your datasource file (which used to work for 4.x). The java:comp/env namespace is not something that is configured through the datasource file. It is configured to web.xml and jboss-web.xml for the war component.
-
2. Re: problems with jdbc jndi lookups
pinan Mar 15, 2009 2:56 PM (in response to pinan)From my jboss-web.xml
<resource-ref>
<res-ref-name>jdbc/castleDB</res-ref-name>
<jndi-name>java:/jdbc/castleDB</jndi-name>
</resource-ref>
From my web.xml
<resource-ref >
<res-ref-name>jdbc/castleDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
Any suggestions as to where I am going wrong on jboss 5.0? -
3. Re: problems with jdbc jndi lookups
jaikiran Mar 16, 2009 2:50 AM (in response to pinan)You haven't posted the datasource file (-ds.xml). Please post that.
While posting logs or xml content or code, please remember to wrap it in a code block by using the Code button in the message editor window. Please use the Preview button to ensure that your post is correctly formatted. -
4. Re: problems with jdbc jndi lookups
pinan Mar 16, 2009 3:02 AM (in response to pinan)my postgres-ds.xml file for jboss 4.2 and 5.0 is
<?xml version="1.0" encoding="UTF-8"?> <datasources> <local-tx-datasource> <jndi-name>jdbc/castleDB</jndi-name> <connection-url>jdbc:postgresql://localhost:5434/castle</connection-url> <driver-class>org.postgresql.Driver</driver-class> <user-name>dp42</user-name> <password></password> <!-- sql to call when connection is created. Can be anything, select 1 is valid for PostgreSQL <new-connection-sql>select 1</new-connection-sql> --> <!-- sql to call on an existing pooled connection when it is obtained from pool. Can be anything, select 1 is valid for PostgreSQL <check-valid-connection-sql>select 1</check-valid-connection-sql> --> <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml --> <metadata> <type-mapping>PostgreSQL 8.0</type-mapping> </metadata> </local-tx-datasource> <local-tx-datasource> <jndi-name>PostgresDS</jndi-name> <connection-url>jdbc:postgresql://localhost:5434/postgresStock</connection-url> <driver-class>org.postgresql.Driver</driver-class> <user-name>dp42</user-name> <password>haggis42</password> <!-- sql to call when connection is created. Can be anything, select 1 is valid for PostgreSQL <new-connection-sql>select 1</new-connection-sql> --> <!-- sql to call on an existing pooled connection when it is obtained from pool. Can be anything, select 1 is valid for PostgreSQL <check-valid-connection-sql>select 1</check-valid-connection-sql> --> <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml --> <metadata> <type-mapping>PostgreSQL 8.0</type-mapping> </metadata> </local-tx-datasource> </datasources>
#I am not aware of any changes between version 4.2 and 5.0. -
5. Re: problems with jdbc jndi lookups
jaikiran Mar 16, 2009 3:13 AM (in response to pinan)Based on these configuration files, the datasource should be available in the ENC of the war component under java:comp/env/jdbc/castleDB. Are you able to use this to lookup the datasource? Also where and when are you using this JNDI name to lookup the datasource? Can you post that relevant code. Finally please post the entire jmx-console JNDI tree output as explained here http://www.jboss.org/community/docs/DOC-9584