Why the hell am I getting StreamCorruptedException?
Hi folks.
I have a really irritating problem. I am using JBoss 2.2.2 as my ejb server, and have successfully deployed the worlds most simple Session bean. I wrote a quick client app in JBuilder to test my bean and see that all was well with the world, but have come accross this problem:
Everytime I run the client, and the jndi lookup of the bean's remote reference is looked up I get a:
javax.naming.CommunicationException [Root exception is java.io.StreamCorruptedException: Type code out of range, is 125]
Why is this? How do I get rid of it?
My code is as follows:
Properties env = new Properties();
env.put(javax.naming.InitialContext.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.put(javax.naming.InitialContext.PROVIDER_URL, "localhost:1099");
env.put(javax.naming.Context.URL_PKG_PREFIXES, "org.jboss.naming");
try{
javax.naming.InitialContext ctx = new javax.naming.InitialContext(env);
jTextArea1.append("Got Context\n");
Object ref = ctx.lookup("testbean/insultHome");
jTextArea1.append("Got home reference\n");
insultHome home = (insultHome) javax.rmi.PortableRemoteObject.narrow(ref, insultHome.class);
jTextArea1.append("Got Home\n");
insult in = home.create();
jTextArea1.append("Created Home\n");
jTextArea1.append(in.getInsult());
}catch(Exception name){
jTextArea1.append(name.toString());
}
This code works fine on another machine with the same setup for JBoss, and the same ejb deployed. Is it my system setup? Could it be that I have another jndi service running somewhere? I simply have had enough of this error!!! Please help me!!!!!
In your hands,
Andy

