ref.setJndiName(ejbRef.getJndiName());
} catch (IllegalArgumentException iae) {
DOLUtils.getDefaultLogger().warning(iae.getMessage());
}
} else if (newDescriptor instanceof ResourceRef) {
ResourceRef resourceRef = (ResourceRef) newDescriptor;
descriptor.getSipApplication().getSunSipDescriptor().
addResourceRef(resourceRef);
try {
ResourceReferenceDescriptor rrd = descriptor.getSipApplication().
getResourceReferenceByName(resourceRef.getResRefName());
if( rrd == null) {
descriptor.getResourceReferenceByName(resourceRef.getResRefName());
}
rrd.setJndiName(resourceRef.getJndiName());
DefaultResourcePrincipal drp = resourceRef.getDefaultResourcePrincipal();
if (drp != null) {
ResourcePrincipal rp = new ResourcePrincipal(drp.getName(),
drp.getPassword());
rrd.setResourcePrincipal(rp);