I think that I needn't to a debug because this is my code:
1ThemeDisplay theme= (ThemeDisplay)req.getAttribute(WebKeys.THEME_DISPLAY);
2 long creatorUserId = theme.getUserId(); // default liferay user
3 long companyId = theme.getCompanyId(); // default company
4 boolean autoPassword = true;
5 boolean autoScreenName = true;
6 long facebookId = 0;
7 String openId = "";
8 Locale locale = theme.getLocale();
9 String middleName = "";
10 int prefixId = 0;
11 int suffixId = 0;
12 boolean male = true;
13 int birthdayMonth = 10;
14 int birthdayDay = 10;
15 int birthdayYear = 2010;
16 String jobTitle = "";
17 long[] groupIds = null;
18 long[] organizationIds = null;
19 long[] roleIds = null;
20 long[] userGroupIds = null;
21 boolean sendEmail = false;
22 UserLocalServiceUtil.addUser(creatorUserId,companyId,autoPassword, psw,psw,autoScreenName,u,e,facebookId,openId,locale,n,middleName,c,prefixId,suffixId,male,birthdayMonth,birthdayDay,birthdayYear,jobTitle,groupIds,organizationIds,roleIds,userGroupIds,sendEmail,ServiceContextFactory.getInstance(req));
If I delete this:
1UserLocalServiceUtil.addUser(creatorUserId,companyId,autoPassword, psw,psw,autoScreenName,u,e,facebookId,openId,locale,n,middleName,c,prefixId,suffixId,male,birthdayMonth,birthdayDay,birthdayYear,jobTitle,groupIds,organizationIds,roleIds,userGroupIds,sendEmail,ServiceContextFactory.getInstance(req));
portlet work correctly but obiouvsly don't add user in database.
So I have tried to do this:
1
2long id=CounterLocalServiceUtil.increment();
3 User utente=UserLocalServiceUtil.createUser(id);
4 utente.setFirstName(n);
5 utente.setLastName(c);
6 utente.setScreenName(u);
7 utente.setPassword(psw);
8 utente.setEmailAddress(e);
9 UserLocalServiceUtil.addUser(utente);
portlet work correctly but don't add user in database. Work the same that code before but in this case it would be add a new user but it don't made this
So I tried with try/cath:
1
2long id=CounterLocalServiceUtil.increment();
3 User utente=UserLocalServiceUtil.createUser(id);
4 utente.setFirstName(n);
5 utente.setLastName(c);
6 utente.setScreenName(u);
7 utente.setPassword(psw);
8 utente.setEmailAddress(e);
9try {
10 UserLocalServiceUtil.addUser(utente);
11 }
12 catch (SystemException e2) {
13 e2.printStackTrace();
14 }
The same!
What I have to do? Why user don't is added in database?
Firmi prego dentro per inbandierare questo come inadeguato.