Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
try{
EjbBundleDescriptorImpl ejbBundleDesc = descriptor.getEjbBundleDescriptor();
ResourceReferenceDescriptor cmpResource = ejbBundleDesc.getCMPResourceReference();
if(cmpResource!=null){
// String jndiName = cmpResource.getJndiName();
String jndiName = getXPathValue("sun-ejb-jar/enterprise-beans/cmp-resource/jndi-name");
if(jndiName == null || jndiName.length()==0){
oneFailed=true;//4698046
addErrorDetails(result, compName);
result.failed(smh.getLocalString(getClass().getName()+".failed",
"FAILED [AS-EJB cmp-resource] : jndi-name cannot be an empty string"));
}else{
if(jndiName.startsWith("jdbc/")|| jndiName.startsWith("jdo/")) {
addGoodDetails(result, compName);
result.passed(smh.getLocalString(getClass().getName()+".passed",
"PASSED [AS-EJB cmp-resource] : jndi-name is {0}",new Object[]{jndiName}));
}else{
oneWarning=true;//4698046
addWarningDetails(result, compName);
result.warning(smh.getLocalString(getClass().getName()+".warning",
"WARNING [AS-EJB cmp-resource] : The jndi-name is {0}, the preferred jndi-name should start with jdbc/ or jdo/"
, new Object[]{jndiName}));
}
}
ResourcePrincipal defPrincipal = cmpResource.getResourcePrincipal();
if(defPrincipal!=null){
// String name = defPrincipal.getName();
String name = getXPathValue("sun-ejb-jar/enterprise-beans/cmp-resource/default-resource-principal/name");
if( name == null || name.length()==0){
oneFailed=true; //4698046