tags:

views:

811

answers:

3

I'm trying to access a remote ejb which is not available yet. But the lookup takes 5 min before I get the NameNotFoundException. Is there a way I can set the lookup timeout to a lesser value so that the client application doesn't hang for 5 mins? Thanks in advance...

+1  A: 

Do the lookup in another thread, so that the client GUI does not hang. You can use plain Runnable to do this, or try a better option like swingworker.

To customize the JNDI lookup timeout, I am afraid, you will have to hack the internals of an open source app server, if that is an option.

swapnonil
Thanks a lot Swapnonil. I'm using jboss so I was able to specify lookup timeouts in there. That worked :)
A: 

Hi Sridhar,

Can you provide how you could do this in Jboss

A: 

Do the lookup in another thread, so that the client GUI does not hang. You can use plain Runnable to do this, or try a better option like swingworker.

That's exactly what we are doing. But this brings another problem: It seems that it is not possible to lookup a EJB on another server as long as the erroneous lookup is hanging.

Is there any way to avoid this and get further lookups working?

dmt