Using VisualCafe 4 as my IDE, and trying to call a method on an EJB I've
deployed to
JBoss. The exception is:
main (16:44:17): javax.naming.CommunicationException. Root exception is
java.io.StreamCorruptedException: Type code out of range, is 125
Here's my code:
try {
Context ctx = getInitialContext();
//Object ref = ctx.lookup("EJBossTest");
//EJBossTestHome home = (EJBossTestHome)
PortableRemoteObject.narrow(ref, EJBossTestHome.class);
//EJBossTest the_ejb = home.create();
EJBossTestHome home = (EJBossTestHome)
ctx.lookup("EJBossTest");
EJBossTest the_ejb = home.create();
System.out.println("the_ejb = " +
the_ejb.toString());
String test = the_ejb.SayHello("Goodbye!");
System.out.println(test);
// to do: call business methods
the_ejb.remove();
}
catch (Exception e) {
e.printStackTrace();
}
}
public static Context getInitialContext()
throws NamingException
{
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
p.put(Context.PROVIDER_URL, url);
if (user != null) {
p.put(Context.SECURITY_PRINCIPAL, user);
if (password == null)
password = "";
p.put(Context.SECURITY_CREDENTIALS, password);
}
return new InitialContext(p);
}
static String url = "localhost:1099";
static String user = null;
static String password = null;
I am successfully obtaining the initial context from JBoss, but the error
shows up when I do the lookup. You'll notice the commented out lines -
it happens if I attempt the lookup that way too.
Can someone explain to me what I'm missing?
Is it possible that this is because the internal VM for VisualCafe is JDK
1.2
and not JDK 1.3??
Thanks,
Robert Price
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
List Help?: [EMAIL PROTECTED]