private void isValidReference(Method method) throws NoSuchObjectException {
if (isInvalidReference) {
if (interfaceType.isComponent() && interfaceType.isLocal()){
throw new NoSuchObjectLocalException("reference is invalid");
} else if (interfaceType.isComponent() || java.rmi.Remote.class.isAssignableFrom(method.getDeclaringClass())) {
throw new NoSuchObjectException("reference is invalid");
} else {
throw new NoSuchEJBException("reference is invalid");
}
}
getDeploymentInfo(); // will throw an exception if app has been undeployed.