Failed to Set a JNDI Lookup Timeout to the Foreign Server (Doc ID 1185126.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Oracle Weblogic Server - Version: 10.3.2 to 10.3.3
Information in this document applies to any platform.

Symptoms

In WebLogic Server 10.3.2 and 10.3.3, when trying to use a foreign JNDI provider for an application, and if you need to set a JNDI lookup timeout to the foreign server (which does not have to be available at all times), when you try to set the timeout for example to 10000ms as follows:

<jndi-property>
  <key>weblogic.jndi.requestTimeout</key>
  <value>10000</value>
</jndi-property>

You will get a ClassCastException in weblogic.jndi.Environment when it tries to cast the String value from above to a long, for example:

Caused By: javax.naming.ConfigurationException: Call to NamingManager.getObjectInstance() failed: [Root exception is java.lang.ClassCastException: java.lang.String]; remaining name ''
  at weblogic.jndi.internal.ServerNamingNode.resolveObject(ServerNamingNode.java:394)
  at weblogic.jndi.internal.BasicNamingNode.resolveObject(BasicNamingNode.java:856)
  at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:209)
  at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:214)
  at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
Truncated. see log file for complete stacktrace
Caused By: java.lang.ClassCastException: java.lang.String
  at weblogic.jndi.Environment.getRequestTimeout(Environment.java:699)
  at weblogic.jndi.WLInitialContextFactoryDelegate$1.run(WLInitialContextFactoryDelegate.java:344)
  at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
  at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
  at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:339)
Truncated. see log file for complete stacktrace>

If you try to use <value>"10000"</value> instead of <value>10000</value>, you will got the following error:

Caused By: java.lang.ClassCastException: java.lang.String
  at weblogic.jndi.Environment.getRequestTimeout(Environment.java:699)
  at weblogic.jndi.WLInitialContextFactoryDelegate$1.run(WLInitialContextFactoryDelegate.java:344)
  at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
  at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
  at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:339)
Truncated. see log file for complete stacktrace

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms