This is a J2EE client using log4j to log information.
To make the client robust, I decide to test the boundary condition. I stop the JBoss Server, then run the client. no exception is thrown, only warn message is printed on the console.
To know why, I write a simple client as the following:
public static void main( String[] argv)
{
try
{
System.out.println( "1") ;
Context initial = null ;
initial = new InitialContext() ;
System.out.println( "2") ;
Object objref = initial.lookup( "java:comp/env/" + UTILITY_FACADE) ;
System.out.println( "3") ;
UtilityFacadeHome home = ( UtilityFacadeHome ) PortableRemoteObject.narrow( objref, UtilityFacadeHome.class ) ;
System.out.println( "4") ;
UtilityFacade facade = home.create() ;
System.out.println( "5") ;
}
catch ( Throwable ex )
{
System.out.println( "--Error--") ;
throw new UtilityConnectionException( ex.getMessage() ) ;
}
System.out.println( "Done") ;
}