After further testing on my using a JNDI resource in the Filter.init(...) method I found that if I use a DefaultContext to link a resource it fails. eg:

<DefaultContext>
<ResourceLink name="jdbc/test" global="jdbc/db" type="javax.sql.DataSource"/>
</DefaultContext>

But if I link the resource in a Context I can load a JNDI resource in my Filter's init(...) method. eg:

<Context path="/JNDI" docBase="JNDI.war">
<ResourceLink name="jdbc/test" global="jdbc/db" type="javax.sql.DataSource"/>
</Context>


In both forms of resource linking above the Filter can load the JNDI resource from the doFilter(...) method.

Any reasons that there should be a difference in behavior for a ResourceLink depending on if you link it in a DefaultContext or a Context?

Sandy

Attachment: PGP.sig
Description: This is a digitally signed message part

Reply via email to