This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Java in General and the fly likes JNDI connection returns null in thread when trigger inside web app Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "JNDI connection returns null in thread when trigger inside web app" Watch "JNDI connection returns null in thread when trigger inside web app" New topic
Author

JNDI connection returns null in thread when trigger inside web app

K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2941
    
    9

Hi all

I have an web app with a database connection defined using JNDI. Then I have a method that does file upload and triggers a separate Runnable class. I noticed that in my Runnable class, I can't get the JNDI connection (returns null) inside the run() method. I'm not sure if this is because this separate thread is outside of the web context or some other reason? Any idea?






K. Tsang JavaRanch SCJP5 SCJD OCPJP7 OCPWCD5 OCPBCD5 OCPWSD5 OCMJEA5 part 1
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JNDI connection returns null in thread when trigger inside web app
 
It's not a secret anymore!