ClassCastException occurs when multiple corbaloc PROVIDER_URL parameters contain a space between entries
 Technote (troubleshooting)
 
Problem(Abstract)
If improperly coded, the string for multiple CORBA object URLs within a JNDI InitialContext request within applications, receive a ClassCastException error.

java.lang.ClassCastException: com.ibm.rmi.corba.ProtAddrImpl
at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootJndiContext(WsnInitCtxFactory...)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory...)
at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:102)
at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:408)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:131)
at javax.naming.InitialContext.lookup(InitialContext.java:360)
 
Cause
When setting up JNDI requests in an application, perform the InitialContext request providing multiple CORBA object URLs; however, if coded incorrectly and there are one or more spaces between the entries, you can receive a ClassCastException:

Incorrect syntax with two spaces between entries:
env.put(Context.PROVIDER_URL,"corbaloc::myhost1:9810, :myhost1:9811, :myhost2:9810");

 
Resolving the problem
Ensure that multiple CORBA object provider URLs do not have spaces between entries. The following example is extracted from the Information Center:

Correct syntax:
env.put(Context.PROVIDER_URL,"corbaloc::myhost1:9810,:myhost1:9811,:myhost2:9810");

 
Related information
WebSphere Application Server InfoCenter
 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK
 
Historical Number
82555
122
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > JNDI/Naming
Operating system(s): Windows
Software version: 5.0
Software edition:
Reference #: 1176668
IBM Group: Software Group
Modified date: Aug 11, 2004