Object collectionType = null;
Field field = null;
Class<?> clazz = null;
+ String codePart = "1";
try {
String role = getRole();
String fieldName = role.substring(role.lastIndexOf(".") + 1);
LOG.info("--> Remote Lazy Initializing Collection " + getRole() + " , owner : " + getOwner().getClass() + "/" + getKey() + " , field : " + fieldName);
Object owner = getOwner();
CdmBase cdmBase;
+ codePart = "2";
if(owner instanceof CdmBase) {
cdmBase = (CdmBase)owner;
} else {
if(configuration == null) {
throw new HibernateException("CdmApplicationRemoteConfiguration not initialized (null)");
}
+ codePart = "3";
+
ICachedCommonService cachedCommonService = configuration.getCachedCommonService();
if(cachedCommonService == null) {
throw new HibernateException("commonService not initialized (null)");
}
+ codePart = "4";
//Object obj = ProxyUtils.deproxyIfInitialized(cachedCommonService.initializeCollection(this));
Object obj = ProxyUtils.deproxyIfInitialized(cachedCommonService.initializeCollection(cdmBase.getUuid(), fieldName));
if(ProxyUtils.isUninitializedProxy(obj)) {
throw new HibernateException("Persistent Collection initialized but is still a proxy");
}
+ codePart = "5";
afterInitialize();
clazz = getClass();
+ codePart = "6";
if (clazz != null) {
collectionType = ProxyUtils.getCollectionType(obj, clazz);
- field = clazz.getDeclaredField(collectionType.toString());
+ codePart = "7";
+ field = clazz.getDeclaredField(collectionType.toString());
+ codePart = "8";
field.setAccessible(true);
field.set(this, obj);
- ProxyUtils.setRoleValueInOwner(owner, role, obj);
+ codePart = "9";
+ ProxyUtils.setRoleValueInOwner(owner, role, obj);
}
} catch (Exception ex) {
String originalMessage = ex.getMessage();
- String message = originalMessage + "clazz: " + (clazz == null? "" :clazz.getSimpleName())+ "- field: " + field + " - collectionType: " + collectionType;
+ String message = originalMessage + ", clazz: " + (clazz == null? "" :clazz.getSimpleName())+ ", field: " + field + ", collectionType: " + collectionType + ", at code part: " + codePart;
throw new CdmEagerLoadingException(message);
}
}