@ FFDCIgnore ( BatchCDIAmbiguousResolutionCheckedException . class ) protected Bean < ? > getUniqueBeanForBatchXMLEntry ( BeanManager bm , String batchId ) { ClassLoader loader = getContextClassLoader ( ) ; BatchXMLMapper batchXMLMapper = new BatchXMLMapper ( loader ) ; Class < ? > clazz = batchXMLMapper . getArtifactById ( batchId ) ; if ( clazz != null ) { try { return findUniqueBeanForClass ( bm , clazz ) ; } catch ( BatchCDIAmbiguousResolutionCheckedException e ) { if ( logger . isLoggable ( Level . FINER ) ) { logger . finer ( "getBeanForBatchXML: BatchCDIAmbiguousResolutionCheckedException: " + e . getMessage ( ) ) ; } return null ; } } else { return null ; } }
Use the given BeanManager to lookup a unique CDI - registered bean with bean class equal to the batch . xml entry mapped to be the batchId parameter