{
UserPrefererences up = new UserPrefererences();
try {
InitialContext ic = CVUtility.getInitialContext();
PreferenceLocalHome home = (PreferenceLocalHome) ic.lookup("local/Preference");
PreferenceLocal remote = home.create();
remote.setDataSource(this.dataSource);
up = remote.getUserPreferences(individualId);
} catch (Exception e) {
logger.error("[getUserObject]: Exception", e);
}
UserObject userObj = new UserObject(individualId, firstName, lastName, up, userType);
if (individualId != 0) {
userObj.setIndividualID(individualId);
try {
InitialContext ic = CVUtility.getInitialContext();
ContactFacadeLocalHome home = (ContactFacadeLocalHome) ic.lookup("local/ContactFacade");
ContactFacadeLocal remote = home.create();
remote.setDataSource(this.dataSource);
int entityID = remote.getEntityIDForIndividual(individualId);
EntityVO entityVO = remote.getEntity(entityID);
AddressVO primaryAdd = entityVO.getPrimaryAddress();
userObj.setEntityName(entityVO.getName());
userObj.setEntityId(entityID);
userObj.setAddressVO(primaryAdd);
} catch (Exception e) {