diff --git a/server/src/com/cloud/tags/TaggedResourceManagerImpl.java b/server/src/com/cloud/tags/TaggedResourceManagerImpl.java index 075ca489a84..bfadb783cfc 100644 --- a/server/src/com/cloud/tags/TaggedResourceManagerImpl.java +++ b/server/src/com/cloud/tags/TaggedResourceManagerImpl.java @@ -282,14 +282,14 @@ public class TaggedResourceManagerImpl implements TaggedResourceService, Manager if (tableName == null) { throw new InvalidParameterValueException("Unable to find resource of type " + resourceType + " in the database"); } - identiyUUId = _identityDao.getIdentityUuid(tableName, resourceId); - if (identiyUUId != null) { - break; - } + + claz = claz.getSuperclass(); + if (claz == Object.class) { + identiyUUId = _identityDao.getIdentityUuid(tableName, resourceId); + } } catch (Exception ex) { //do nothing here, it might mean uuid field is missing and we have to search further } - claz = claz.getSuperclass(); } if (identiyUUId == null) {