Friday, October 14, 2011

Using Localhost To Lookup JNDI Get "No available router to destination

When using localhost as the WebLogic Server listen address. For example, when localhost t is used to look up a JNDI address like this:
System.setProperty(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
System.setProperty(Context.PROVIDER_URL, "t3://localhost:8012");
Then the following error occurs:
java.net.ConnectException: t3://localhost:8001: Destination unreachable; nested exception is:
java.net.ConnectException: Connection refused; No available router to destination
 Cause
Multiple problems could cause this error. In this particular case, the system hosts file had a problem with the localhost config:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 hs21a6-wls localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
Solution
If a similar problem is found in the hosts file, follow these steps to resolve it:
1. Open the /etc/hosts file in the UNIX System (C:\WINDOWS\system32\drivers\etc\hosts in the Windows System).
2. Correct the problem in the hosts file. For example:
# Do not remove the following line, or various programs
# that require network functionality will fail.
10.6.157.108    hs21a6-wls hs21a6-wls.localdomain
127.0.0.1       localhost  localhost.localdomain
3. Save the hosts file.
4. Restart WebLogic Server.

 This issue has been reported in Weblogic 10.3. Contact Oracle Suport if the above does not resolves your case.

0 comments :

Post a Comment