private String getSecNameFromUniqueID ( String uniqueId ) throws WIMException { String METHODNAME = "getSecNameFromUniqueID" ; String secName = null ; try { secName = getUserSecurityName ( uniqueId ) ; } catch ( EntryNotFoundException e ) { try { secName = getGroupSecurityName ( uniqueId ) ; } catch ( com . ibm . ws . security . registry . EntryNotFoundException renf ) { throw new EntityNotFoundException ( WIMMessageKey . ENTITY_NOT_FOUND , Tr . formatMessage ( tc , WIMMessageKey . ENTITY_NOT_FOUND , WIMMessageHelper . generateMsgParms ( uniqueId ) ) ) ; } catch ( RegistryException re ) { throw new EntityNotFoundException ( WIMMessageKey . ENTITY_NOT_FOUND , Tr . formatMessage ( tc , WIMMessageKey . ENTITY_NOT_FOUND , WIMMessageHelper . generateMsgParms ( uniqueId ) ) ) ; } } catch ( RegistryException e ) { throw new EntityNotFoundException ( WIMMessageKey . ENTITY_NOT_FOUND , Tr . formatMessage ( tc , WIMMessageKey . ENTITY_NOT_FOUND , WIMMessageHelper . generateMsgParms ( uniqueId ) ) ) ; } if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHODNAME + " The Security Name for " + uniqueId + " is " + secName ) ; } return secName ; }
Since UserRegistry throws CustomRegistryException in case of secName not found modify code to handle CustomRegistryException similar to EntryNotFoundException .