PDA

View Full Version : Help? Cannot Wire datasource, JNDI name not found.



jlistnews
Oct 16th, 2009, 03:06 PM
Sun Webserver 7 + Spring + JNDI

Problem: Seems like no matter what I do, I get:

Name X is not bound in this Context.

I've got this in applicationContext.xml:

<jee:jndi-lookup id="dataSource" jndi-name="jdbcService" />

web.xml:
<resource-ref>
<description>JDBC Connection Pool</description>
<res-ref-name>jdbcServicePool</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref

sun-web.xml:
<sun-web-app>
<context-root>/conap</context-root>
<resource-ref>
<res-ref-name>jdbcServicePool</res-ref-name>
<jndi-name>jdbcService</jndi-name>
</resource-ref>
<jsp-config/>

...any clues?? This is working OK in GlassFish but I need it to work on SW7.

Grzegorz Grzybek
Oct 18th, 2009, 11:48 PM
Try adding resource-ref="false" to jndi-lookup. It defaults to "true" which means that the lookup is performed under java:com/env name.

regards
Grzegorz Grzybek

jlistnews
Nov 23rd, 2009, 03:00 PM
Try adding resource-ref="false" to jndi-lookup. It defaults to "true" which means that the lookup is performed under java:com/env name.

regards
Grzegorz Grzybek

Just had a go at this with no success. It's become a real problem.