homeProps.setProperty("java.naming.factory.initial", "org.jboss.naming.NamingContextFactory");
InitialContext ic = new InitialContext(homeProps);
CtsBmpHome home = (CtsBmpHome) ic.lookup("ejbcts/BMPBean");
AccountPK pk = new AccountPK(BEAN_PK_007);
CtsBmp bean = doEjbCreate(pk, BEAN_NAME);
Handle beanHandle = bean.getHandle();
ByteArrayOutputStream out = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(out);
oos.writeObject(beanHandle);
oos.flush();
byte[] bytes = out.toByteArray();
Properties sysProps = System.getProperties();
Properties newProps = new Properties(sysProps);
newProps.setProperty("java.naming.factory.initial", "badFactory");
newProps.setProperty("java.naming.provider.url", "jnp://badhost:12345");
System.setProperties(newProps);
try
{
getLog().debug("Unserialize bean handle...");
ByteArrayInputStream in = new ByteArrayInputStream(bytes);
ObjectInputStream ois = new ObjectInputStream(in);
beanHandle = (Handle) ois.readObject();
bean = (CtsBmp) beanHandle.getEJBObject();
String name = bean.getPersonsName();
getLog().debug("getPersonsName: "+name);
}
finally
{