// name() and beanInterface() are required for TYPE-level @EJB
// if either of them not set, fail fast. See issue 17284
if (ejbAn.name().equals("") ||
ejbAn.beanInterface() == Object.class ) {
Class c = (Class) ainfo.getAnnotatedElement();
AnnotationProcessorException fatalException =
new AnnotationProcessorException(localStrings.getLocalString(
"enterprise.deployment.annotation.handlers.invalidtypelevelejb",
"Invalid TYPE-level @EJB with name() = [{0}] and " +
"beanInterface = [{1}] in {2}. Each TYPE-level @EJB " +
"must specify both name() and beanInterface().",
new Object[] { ejbAn.name(), ejbAn.beanInterface(), c }),
ainfo);
fatalException.setFatal(true);
throw fatalException;
}
} else {
// can't happen
return getDefaultFailedResult();