My Oracle Support Banner

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

Last updated on FEBRUARY 10, 2019

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 needed 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 10000 ms 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 tried to use <value>"10000"</value> instead of <value>10000</value>, we will get 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

Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

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


In this Document
Symptoms
Changes
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.