environment getInitialContext() stuck

Hi, i have some java code that try to get intiialcontext to a weblogic server. it works fine, until the weblogic server status became FAILED. Then the code would just stuck at that line, NOT going into exception or anything.  Cant figure out what is going on, can someone provide a few pointers, thanks.

Environment env = new Environment();
        env.setProviderUrl(_url);
        env.setSecurityPrincipal(_user);
        env.setSecurityCredentials(_password);
        try {
          //WHEN WEBLOGIC SERVER STATE BECAME FAILED, IT STUCKS AT THIS LINE
          //CONFIRMED BY STEP THRU VIA DEBUG
           ctx = env.getInitialContext(); <---STUCKS AT THIS LINE
           home = (MBeanHome) ctx.lookup(MBeanHome.LOCAL_JNDI_NAME);
        } catch (AuthenticationException e)
       {
      etc....
LVL 1
gagaliyaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gagaliyaAuthor Commented:
I want it to go into exceptions,so the program can continue executing.  To confirm again the program does not exit or throw any exceptions/error, it just stuck in run mode at this line.
0
mrcoffee365Commented:
We have found that there are some states with Web servers where they will not disconnect.  I don't know if that is what you are seeing, but I believe the only foolproof solution is to put a timer on the request, and kill it if it goes too long.

If you use HttpClient to make your connection, then this documentation on doing a timeout might help:
http://www.innovation.ch/java/HTTPClient/advanced_info.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gagaliyaAuthor Commented:
thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.