フォーラム

ホーム » Liferay Portal » English » 3. Development

構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
toggle
Omkar Khandare
addUser method with custom role from CreateAccountAction gives exception
2013/02/14 1:43
答え

Omkar Khandare

ランク: Junior Member

投稿: 40

参加年月日: 2012/03/06

最近の投稿

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)
Nicolas Tamayo
RE: addUser method with custom role from CreateAccountAction gives exceptio
2013/02/14 14:38
答え

Nicolas Tamayo

ランク: Junior Member

投稿: 29

参加年月日: 2012/10/03

最近の投稿

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
Omkar Khandare
RE: addUser method with custom role from CreateAccountAction gives exceptio
2013/02/14 22:52
答え

Omkar Khandare

ランク: Junior Member

投稿: 40

参加年月日: 2012/03/06

最近の投稿

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
RE: addUser method with custom role from CreateAccountAction gives exceptio
2013/02/15 2:12
答え

Siby Mathew

ランク: Expert

投稿: 265

参加年月日: 2011/03/04

最近の投稿

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