# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /home/radek/src/glassfish-v3-trunk/connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/naming # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: JndiProxyObjectFactory.java --- JndiProxyObjectFactory.java Base (BASE) +++ JndiProxyObjectFactory.java Locally Modified (Based On LOCAL) @@ -46,6 +46,7 @@ import java.util.Enumeration; import java.util.Hashtable; +import javax.naming.CommunicationException; import javax.naming.Context; import javax.naming.Name; import javax.naming.NamingException; @@ -161,7 +162,25 @@ // use the name to lookup in the external JNDI naming context try { + try { return context.lookup(jndiLookupName); + }catch(CommunicationException ce) { + //Silently skip, we can show warning here + synchronized(contextMap) { + Object result; + try { + if (context != (context = contextMap.get(resourceInfo))) + //In map is new context, try use it + return context.lookup(jndiLookupName); + }catch(CommunicationException ignored) { + } + //In map is old context or recreation failed, recreate one + context = loadInitialContext(jndiFactoryClass, env); + result = context.lookup(jndiLookupName); + contextMap.put(resourceInfo, context); + return result; + } + } } catch (NameNotFoundException e) { throw new ExternalNameNotFoundException(e); }