users@glassfish.java.net

Accessing JNDI resources from webapp

From: Major Péter <majorpetya_at_sch.bme.hu>
Date: Mon, 19 Apr 2010 15:27:18 +0200

Hi,

Why is that, that if I want to access a JNDI resource from a
web/enterprise app, then I have to add to the web.xml a resource-ref? Is
this really necessary?
If I create a simple JAR library, which access to this JNDI resource,
and add to the webmodule as a simple dependency (so it's not a module),
then the library can access the resource without web.xml magic, probably
because it's loaded by a different classloader then the main project is.
So why does the resource-management works like this?
I'm just asking..

Regards,
Peter