Here is my code:
boolean male = true;
String password="testtest", companyId="liferay.com", jobTitle = "", organizationId = "", locationId = "";
String password1=password, password2=password;
String nickName="", prefixId = "", suffixId = "";
Calendar birthday = Calendar.getInstance();
boolean autoUserId = false;
boolean autoPassword = false;
boolean passwordReset = false;
UserLocalServiceUtil.addUser("liferay.com.1",companyId, autoUserId, userId, autoPassword, password1, password2, passwordReset, user.getEmail(), Locale.US,user.getFirstName(), "", user.getLastName(), nickName, prefixId, suffixId, male, birthday.get(Calendar.MONTH), birthday.get(Calendar.DATE), birthday.get(Calendar.YEAR), jobTitle, organizationId, locationId);
It took me some time to debug it - liferay doesn't like some of the emails, companyId should be registered in Liferay db, etc.
This code worked for 4.1 it might be that something changed in later versions.
Por favor, identifíquese para poder marcar esto como inapropiado