Jaikiran Pai wrote:Is that "Java class" a servlet? You can't use the java:comp/env in any Java class. It has to be an enterprise component (like servlet).
Hi,
Thats a normal java class, servlet calls this class to get DB connection. wht should i do here?
Ah, so you are looking it up in a ServletContextListener when the context is initialized. I'm not sure the JNDI java:comp/env is setup correctly at that time.
By the way, why do you want to hold the DB connection in the ServletContextListener?
Jaikiran Pai wrote:Ah, so you are looking it up in a ServletContextListener when the context is initialized. I'm not sure the JNDI java:comp/env is setup correctly at that time.
By the way, why do you want to hold the DB connection in the ServletContextListener?
Well...
its working fine with tomcat 6, i wanted to shift this to JBoss 4.2, i couldnt do that because of this issue..
Grow a forest with seedballs and this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth