Foren
AddUser
Krzysztof Rudz, geändert vor 15 Jahren.
AddUser
New Member Beiträge: 9 Beitrittsdatum: 13.11.08 Neueste Beiträge
I am writing portlet that adds new user to liferay (5.1.1, tomcat 6, oracle 10).
I am using UserServiceUtil.addUser(companyId, autoPassword, password1, password2, autoScreenName, screenName,
emailAddress, locale, firstName, middleName, lastName, prefixId, suffixId, male,
birthdayMonth, birthdayDay, birthdayYear, jobTitle,
organizationIds, sendEmail)
It worked... but after few users added sucessfully it stopped working.
The result is:
Error:
com.liferay.portal.kernel.dao.orm.ORMException: Could not execute JDBC batch update
Error Type:
com.liferay.portal.SystemException
Stacktrace:
com.liferay.portal.service.persistence.impl.BasePersistenceImpl.processException(BasePersistenceImpl.java:75)
com.liferay.portal.service.persistence.LayoutSetPersistenceImpl.updateImpl(LayoutSetPersistenceImpl.java:223)
com.liferay.portal.service.persistence.LayoutSetPersistenceImpl.update(LayoutSetPersistenceImpl.java:184)
com.liferay.portal.service.impl.LayoutSetLocalServiceImpl.addLayoutSet(LayoutSetLocalServiceImpl.java:77)
com.liferay.portal.service.impl.GroupLocalServiceImpl.addGroup(GroupLocalServiceImpl.java:144)
com.liferay.portal.service.impl.GroupLocalServiceImpl.addGroup(GroupLocalServiceImpl.java:96)
com.liferay.portal.service.impl.UserLocalServiceImpl.addUser(UserLocalServiceImpl.java:335)
com.liferay.portal.service.impl.UserServiceImpl.addUser(UserServiceImpl.java:168)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
$Proxy91.addUser(Unknown Source)
com.liferay.portal.service.UserServiceUtil.addUser(UserServiceUtil.java:108) [...]
The problem is that, original liferay portlet for creating users does not work too..
I did not touch database manually, using only UserServiceUtil.addUser, nothing more.
Anyone tackled with that issue?
I am using UserServiceUtil.addUser(companyId, autoPassword, password1, password2, autoScreenName, screenName,
emailAddress, locale, firstName, middleName, lastName, prefixId, suffixId, male,
birthdayMonth, birthdayDay, birthdayYear, jobTitle,
organizationIds, sendEmail)
It worked... but after few users added sucessfully it stopped working.
The result is:
Error:
com.liferay.portal.kernel.dao.orm.ORMException: Could not execute JDBC batch update
Error Type:
com.liferay.portal.SystemException
Stacktrace:
com.liferay.portal.service.persistence.impl.BasePersistenceImpl.processException(BasePersistenceImpl.java:75)
com.liferay.portal.service.persistence.LayoutSetPersistenceImpl.updateImpl(LayoutSetPersistenceImpl.java:223)
com.liferay.portal.service.persistence.LayoutSetPersistenceImpl.update(LayoutSetPersistenceImpl.java:184)
com.liferay.portal.service.impl.LayoutSetLocalServiceImpl.addLayoutSet(LayoutSetLocalServiceImpl.java:77)
com.liferay.portal.service.impl.GroupLocalServiceImpl.addGroup(GroupLocalServiceImpl.java:144)
com.liferay.portal.service.impl.GroupLocalServiceImpl.addGroup(GroupLocalServiceImpl.java:96)
com.liferay.portal.service.impl.UserLocalServiceImpl.addUser(UserLocalServiceImpl.java:335)
com.liferay.portal.service.impl.UserServiceImpl.addUser(UserServiceImpl.java:168)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
$Proxy91.addUser(Unknown Source)
com.liferay.portal.service.UserServiceUtil.addUser(UserServiceUtil.java:108) [...]
The problem is that, original liferay portlet for creating users does not work too..
I did not touch database manually, using only UserServiceUtil.addUser, nothing more.
Anyone tackled with that issue?
jigs vachhani, geändert vor 15 Jahren.
query execution
Liferay Master Beiträge: 803 Beitrittsdatum: 10.03.08 Neueste Beiträge
hi budddy
can you check your finderimpl.java class fro query execution
because its a problem of query execution
can you check your finderimpl.java class fro query execution
because its a problem of query execution
Krzysztof Rudz, geändert vor 15 Jahren.
RE: query execution
New Member Beiträge: 9 Beitrittsdatum: 13.11.08 Neueste Beiträge
Hi.
What do you mean by finderimpl.java?
I did not write any finders and did not change any liferay code, just call addUser. It worked only few times.
I think it is not finder problem. I see in tomcat logs that constraint exception is thrown. Constraint is connected with LAYOUT_ table. (pllid cannot be null), what is very strange for me.
EDIT:
After few calls of addUser method, another exception is thrown:
Error
No row with the given identifier exists: [com.liferay.portal.model.impl.UserImpl#24001]
Error Type
com.liferay.portal.kernel.dao.orm.ObjectNotFoundException
Stacktrace
com.liferay.portal.dao.orm.hibernate.ExceptionTranslator.translate(ExceptionTranslator.java:38)
com.liferay.portal.dao.orm.hibernate.SessionImpl.load(SessionImpl.java:124)
com.liferay.portal.dao.orm.hibernate.FinderCacheImpl._primaryKeyToResult(FinderCacheImpl.java:212)
com.liferay.portal.dao.orm.hibernate.FinderCacheImpl._primaryKeyToResult(FinderCacheImpl.java:220)
com.liferay.portal.dao.orm.hibernate.FinderCacheImpl.getResult(FinderCacheImpl.java:89)
com.liferay.portal.kernel.dao.orm.FinderCacheUtil.getResult(FinderCacheUtil.java:51)
com.liferay.portal.service.persistence.UserPersistenceImpl.fetchByC_SN(UserPersistenceImpl.java:1824)
com.liferay.portal.service.impl.UserLocalServiceImpl.validateScreenName(UserLocalServiceImpl.java:2645)
com.liferay.portal.service.impl.UserLocalServiceImpl.validate(UserLocalServiceImpl.java:2531)
com.liferay.portal.service.impl.UserLocalServiceImpl.addUser(UserLocalServiceImpl.java:222)
com.liferay.portal.service.impl.UserServiceImpl.addUser(UserServiceImpl.java:168)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
$Proxy91.addUser(Unknown Source)
What is totally strange. Please help.
What do you mean by finderimpl.java?
I did not write any finders and did not change any liferay code, just call addUser. It worked only few times.
I think it is not finder problem. I see in tomcat logs that constraint exception is thrown. Constraint is connected with LAYOUT_ table. (pllid cannot be null), what is very strange for me.
EDIT:
After few calls of addUser method, another exception is thrown:
Error
No row with the given identifier exists: [com.liferay.portal.model.impl.UserImpl#24001]
Error Type
com.liferay.portal.kernel.dao.orm.ObjectNotFoundException
Stacktrace
com.liferay.portal.dao.orm.hibernate.ExceptionTranslator.translate(ExceptionTranslator.java:38)
com.liferay.portal.dao.orm.hibernate.SessionImpl.load(SessionImpl.java:124)
com.liferay.portal.dao.orm.hibernate.FinderCacheImpl._primaryKeyToResult(FinderCacheImpl.java:212)
com.liferay.portal.dao.orm.hibernate.FinderCacheImpl._primaryKeyToResult(FinderCacheImpl.java:220)
com.liferay.portal.dao.orm.hibernate.FinderCacheImpl.getResult(FinderCacheImpl.java:89)
com.liferay.portal.kernel.dao.orm.FinderCacheUtil.getResult(FinderCacheUtil.java:51)
com.liferay.portal.service.persistence.UserPersistenceImpl.fetchByC_SN(UserPersistenceImpl.java:1824)
com.liferay.portal.service.impl.UserLocalServiceImpl.validateScreenName(UserLocalServiceImpl.java:2645)
com.liferay.portal.service.impl.UserLocalServiceImpl.validate(UserLocalServiceImpl.java:2531)
com.liferay.portal.service.impl.UserLocalServiceImpl.addUser(UserLocalServiceImpl.java:222)
com.liferay.portal.service.impl.UserServiceImpl.addUser(UserServiceImpl.java:168)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
$Proxy91.addUser(Unknown Source)
What is totally strange. Please help.
Maulin Rathod, geändert vor 15 Jahren.
RE: query execution
Junior Member Beiträge: 61 Beitrittsdatum: 06.11.08 Neueste Beiträge
Try using UserLocalServiceUtil.adduser method. It is working for me.
Ziggy ., geändert vor 14 Jahren.
RE: query execution
Expert Beiträge: 293 Beitrittsdatum: 08.06.08 Neueste BeiträgeMaulin Rathod:
Try using UserLocalServiceUtil.adduser method. It is working for me.
HI,
Could you give me some more information on this UserLocalServiceUtil?
What i would like to do is when a user creates an account i want to automatically add them to the community to which they are creating the account from.
zahid khan, geändert vor 14 Jahren.
RE: query execution
Regular Member Beiträge: 116 Beitrittsdatum: 30.07.08 Neueste Beiträge
check this post thsi might help
http://www.liferay.com/web/guest/community/forums/-/message_boards/message/797009
Zahi khan
http://www.liferay.com/web/guest/community/forums/-/message_boards/message/797009
Zahi khan
Naga Surya Dhanunjaya Rao Sriapthy, geändert vor 13 Jahren.
RE: query execution
New Member Beiträge: 14 Beitrittsdatum: 25.04.09 Neueste Beiträge
Hi I am facing the same issues but i have used UserLocalServiceUtil.addUser(User user) method to create a user. Due to version compatability . It should work for 5.2.3 and 6.0.3.
5.2.3 it is able to creating the user, but in 6.0.3 it is giving the same exception..
If any one is having solution plz share it....
Thanks in advance..
5.2.3 it is able to creating the user, but in 6.0.3 it is giving the same exception..
If any one is having solution plz share it....
Thanks in advance..
Nagendra Kumar Busam, geändert vor 13 Jahren.
RE: query execution
Liferay Master Beiträge: 678 Beitrittsdatum: 07.07.09 Neueste Beiträge
Hi,
You just have to pass one more extra parameter for faccBookId which is of long type
Check the method signature addUser in Liferay 6.0.4
You just have to pass one more extra parameter for faccBookId which is of long type
Check the method signature addUser in Liferay 6.0.4
public static com.liferay.portal.model.User addUser(long creatorUserId,
long companyId, boolean autoPassword, java.lang.String password1,
java.lang.String password2, boolean autoScreenName,
java.lang.String screenName, java.lang.String emailAddress,
[color=#DE1B1B]long facebookId[/color], java.lang.String openId, java.util.Locale locale,
java.lang.String firstName, java.lang.String middleName,
java.lang.String lastName, int prefixId, int suffixId, boolean male,
int birthdayMonth, int birthdayDay, int birthdayYear,
java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
long[] roleIds, long[] userGroupIds, boolean sendEmail,
com.liferay.portal.service.ServiceContext serviceContext)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException {
Naga Surya Dhanunjaya Rao Sriapthy, geändert vor 13 Jahren.
RE: query execution
New Member Beiträge: 14 Beitrittsdatum: 25.04.09 Neueste Beiträge
Thanks for reply..
Yes Correct, But i need a common solution for liferay5.2.3 and 6.0.4.
So i am trying to achieve with addUser(User user) method. But this is creating user properly in 5.2.3. but it is giving exception in 6.0.3 version. in 5.2.3 version facebookId parameter is not there. So while building it is giving problems..
Yes Correct, But i need a common solution for liferay5.2.3 and 6.0.4.
So i am trying to achieve with addUser(User user) method. But this is creating user properly in 5.2.3. but it is giving exception in 6.0.3 version. in 5.2.3 version facebookId parameter is not there. So while building it is giving problems..
Krzysztof Rudz, geändert vor 15 Jahren.
RE: query execution
New Member Beiträge: 9 Beitrittsdatum: 13.11.08 Neueste Beiträge
Problem closed. I had wrong Oracle drivers (for jdk 1.2/3, not 1.5).
However it is strange, that I could add some users using these drivers.
However it is strange, that I could add some users using these drivers.
marwan amin sabri, geändert vor 12 Jahren.
RE: AddUser
Junior Member Beiträge: 34 Beitrittsdatum: 18.03.09 Neueste Beiträge
Hi dears
i'm facing the same issue with UserLocalServiceUtil.addUser() it works fine for sometime and after that it keep thrown ugly exception
i'm using MS-SQL server (jtds drivers) with Liferay (5.2.3) jboss (4.2.2).
any idea please! this issue is impacting our production environment.
many thanks
Marwan Sabri
i'm facing the same issue with UserLocalServiceUtil.addUser() it works fine for sometime and after that it keep thrown ugly exception
i'm using MS-SQL server (jtds drivers) with Liferay (5.2.3) jboss (4.2.2).
any idea please! this issue is impacting our production environment.
many thanks
Marwan Sabri
Danial Habibi, geändert vor 12 Jahren.
RE: AddUser
Regular Member Beiträge: 141 Beitrittsdatum: 01.11.11 Neueste Beiträgemarwan amin sabri:
Hi dears
i'm facing the same issue with UserLocalServiceUtil.addUser() it works fine for sometime and after that it keep thrown ugly exception
i'm using MS-SQL server (jtds drivers) with Liferay (5.2.3) jboss (4.2.2).
any idea please! this issue is impacting our production environment.
many thanks
Marwan Sabri
hi there can u post your error logs? in control panel ,for hibernate and jdbc log level set to all, maybe it can help if you want to see complete error log when exception happen..
regards
Danial