try
{
// Attempt to get local EJB3 Registrar
//TODO EJBTHREE-1403
// This is the wrong way to determine local/remote
Ejb3Registrar registrar = Ejb3RegistrarLocator.locateRegistrar();
// Local lookup succeeded, so use it
// BES 2008/08/22 -- a NotBoundException doesn't mean failure, just
// means the container isn't deployed in this server. So don't catch it
// in an inner try/catch; let it propagate to the outer catch.
// This may or may not be the proper fix for EJBTHREE-1403, but it allows
// clustering unit tests to pass.
// try
// {
Object pfObj = registrar.lookup(proxyFactoryRegistryKey);
assert pfObj != null : ProxyFactory.class.getName() + " from key " + proxyFactoryRegistryKey + " was null";
assert pfObj instanceof ProxyFactory : " Object obtained from key " + proxyFactoryRegistryKey
+ " was expected to be of type " + ProxyFactory.class.getName() + " but was instead " + pfObj;
proxyFactory = (ProxyFactory) pfObj;
// }