Foros de discusión

addUser method with custom role from CreateAccountAction gives exception

thumbnail
Omkar Khandare, modificado hace 11 años.

addUser method with custom role from CreateAccountAction gives exception

Junior Member Mensajes: 49 Fecha de incorporación: 7/03/12 Mensajes recientes
Hi I am using EXT plugin to override addUser method of CreateAccountAction in
my own Action

I have used following code.

user = UserLocalServiceUtil.addUserWithWorkflow(0, company.getCompanyId(), autoPassword, password1, password2, autoScreenName, screenName, emailAddress, facebookId, openId, locale, firstName, middleName, lastName, prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear, jobTitle, groupIds, organizationIds, roleIds, userGroupIds, sendEmail, serviceContext);

but gives an exception

com.liferay.portal.GroupFriendlyURLException
at com.liferay.portal.service.impl.UserLocalServiceImpl.validateScreenName(UserLocalServiceImpl.java:5770)
at com.liferay.portal.service.impl.UserLocalServiceImpl.validate(UserLocalServiceImpl.java:5526)
at com.liferay.portal.service.impl.UserLocalServiceImpl.addUserWithWorkflow(UserLocalServiceImpl.java:668)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:122)
at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:211)
at $Proxy97.addUserWithWorkflow(Unknown Source)
at com.liferay.portal.service.UserLocalServiceUtil.addUserWithWorkflow(UserLocalServiceUtil.java:549)
at com.my.portlet.login.action.MyCreateAccountAction.addUser(MyCreateAccountAction.java:239)
at com.liferay.portlet.login.action.CreateAccountAction.processAction(CreateAccountAction.java:119)
at com.liferay.portal.struts.PortletRequestProcessor.process(PortletRequestProcessor.java:169)
at com.liferay.portlet.StrutsPortlet.processAction(StrutsPortlet.java:212)
at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:70)
at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:48)
at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:548)
at com.liferay.portlet.InvokerPortletImpl.invokeAction(InvokerPortletImpl.java:579)
at com.liferay.portlet.InvokerPortletImpl.processAction(InvokerPortletImpl.java:294)
at com.liferay.portal.action.LayoutAction.processPortletRequest(LayoutAction.java:944)
at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:688)
at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:249)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:176)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:560)
at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:537)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)

Please Help.
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
thumbnail
Nicolas Tamayo, modificado hace 11 años.

RE: addUser method with custom role from CreateAccountAction gives exceptio

Junior Member Mensajes: 29 Fecha de incorporación: 3/10/12 Mensajes recientes
Hi,

i used this method too, but you can specify a little more your code? in order of know the all context of functionality

regards
thumbnail
Omkar Khandare, modificado hace 11 años.

RE: addUser method with custom role from CreateAccountAction gives exceptio

Junior Member Mensajes: 49 Fecha de incorporación: 7/03/12 Mensajes recientes
I realized one new thing while using this.

When i am calling addUser method by overriding CreateAccountAction class from my create_account.jsp page from my own machine then
I am facing this above exception.

com.liferay.portal.GroupFriendlyURLException

but if do same process through different machine then
process completed successfully.
User got registered as i want.

I unable understand this issue for creating account through my machine.

as its Ok for me, i don't worry about it.

Thanks.
Siby Mathew, modificado hace 11 años.

RE: addUser method with custom role from CreateAccountAction gives exceptio

Expert Mensajes: 268 Fecha de incorporación: 4/03/11 Mensajes recientes
Hi Omkar,
In Liferay code, the group friendly url is created by appending SLASH to the user screenname.
GroupFriendlyURLException can occur if this is already present in the database OR if it fails validation inside LayoutImpl.validateFriendlyURL()

Check if your user screenname is a valid one.

Thanks,
Siby