-
1. Re: ClassCastException/Receive Timed Out
boxhead Apr 26, 2004 11:21 PM (in response to boxhead)I did a bit a troubleshooting. Here's the stack trace:
javax.naming.CommunicationException: Failed to connect to server localhost:1099. Root exception is
java.lang.ClassCastException
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:199)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1181)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:514)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at com.boxhead.framework.ejb.EJBUtil.getEJB(EJBUtil.java:83)
I took a look at NamingContext.java:199 and found that the ClassCast is occurring while trying to do a cast to Naming. Naming appears to be a representation of a client side JNDI server. Therefore, it does not appear to be my code, but it appears to be something with the configuration of my server?
I am using a standard configuration. I made no modifications to any files in the standard jboss 3.2.3 implementation. I am passing the following properties to the server during startup:
jndi.provider.url=jnp://localhost:1099
jndi.initial.context.factory=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp://localhost:1099
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
Suggestions would be appreciated ... -
2. HELP!!
boxhead Apr 27, 2004 10:33 PM (in response to boxhead)Hi All;
I am really stuck on this problem and any help would be appreciated. I have been adding to the following thread, and if anyone has any input, please add to it. I am really stuck and frustrated. I believe this to be a problem within JBoss and not in my code.
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3832766#3832766 -
3. Re: ClassCastException/Receive Timed Out
boxhead Apr 28, 2004 10:39 PM (in response to boxhead)I read somewhere in the forums that maybe I should not supply a hostname and factory while trying to get the initial context. I tried that, and that did not solve the problem. Hence, I did this:
props = new Properties();
// JBOSS DOES NOT LIKE THE FOLLOWING TWO LINES... GO FIGURE.
// props.put(Context.INITIAL_CONTEXT_FACTORY,providerFactory);
// props.put(Context.PROVIDER_URL, jndiProviderUrl);
if (user != null)
{
props.put(Context.SECURITY_PRINCIPAL, user);
}
if (password != null)
{
props.put(Context.SECURITY_CREDENTIALS, password);
}
propCache.put(key,props);
}
Context out=new InitialContext(props);
HELP!!!!!!!!!!!!!!!! -
4. Re: ClassCastException/Receive Timed Out
starksm64 Apr 28, 2004 11:44 PM (in response to boxhead)The only way to get any further help is by posting a bug report to sourceforge with a testcase:
http://sourceforge.net/tracker/?group_id=22866&atid=376685