-
Bug
-
Resolution: Won't Do
-
Critical
-
None
-
JBossAS-4.0.2RC1
-
None
-
None
Handle implementations keeps an empty environment Hashtable for InitialContext.
The test is very simple: on my client I put into system properties a wrong URL for server (simulates a situation, when we transfer a bean Handle to some computer, that is not knows, where the real server is).
Just try my source:
Hashtable env = new Hashtable();
env.putAll( System.getProperties() );
env.put( "java.naming.provider.url",
System.getProperty( "realServerURL" ) );
InitialContext ic = new InitialContext( env );
Object ref = ic.lookup( "SomeBean" );
SomeBeanHome home =
( SomeBeanHome )PortableRemoteObject.narrow( ref, SomeBeanHome.class );
SomeBean beanA = home.create();
Handle bh = beanA.getHandle();
/*
- here you will get a javax.naming.CommunicationException:
- Receive timed out
*/
EJBObject beanB = bh.getEJBObject();
System.out.println( beanB.isIdentical( beanA ) );