-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: portal-3.0.0
-
Fix Version/s: portal-3.0.0
-
Component/s: Liferay Faces Portal / Demos / Tests
-
Labels:None
There are several usages of deprecated exceptions in the jsf-registrant-portlet RegistrantBackingBean.java class such as com.liferay.portal.kernel.exception.DuplicateUserEmailAddressException. The code needs to be refactored to use the new exception handling provided by Liferay Portal 7.0. An example error is found below.
Steps to Reproduce:
1. Deploy the jsf-registration-portlet to Liferay Portal 7.0
2. Click on the "Sign In" link
3. Click on the "Create Account" link
4. Complete the form presented by the jsf-registration-portlet using an existing email address
Expected Results:
RegistrantBackingBean catches com.liferay.portal.kernel.exception.UserScreenNameException$MustNotBeDuplicate and reports a FacesMessage in the portlet's markup that says "The email address you requested is already taken"
Actual Results:
The following error appears in the server log:
com.liferay.portal.kernel.exception.UserScreenNameException$MustNotBeDuplicate: Screen name ngriffin must not be duplicate but is already used by user 48570 at com.liferay.portal.service.impl.UserLocalServiceImpl.validateScreenName(UserLocalServiceImpl.java:6612) at com.liferay.portal.service.impl.UserLocalServiceImpl.validate(UserLocalServiceImpl.java:6310) at com.liferay.portal.service.impl.UserLocalServiceImpl.addUserWithWorkflow(UserLocalServiceImpl.java:700) at com.liferay.portal.service.impl.UserLocalServiceImpl.addUser(UserLocalServiceImpl.java:570) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:153) at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:85) at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:58) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127) at com.liferay.portal.service.ServiceContextAdvice.invoke(ServiceContextAdvice.java:40) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127) at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:173) at com.sun.proxy.$Proxy70.addUser(Unknown Source) at com.liferay.portal.kernel.service.UserLocalServiceUtil.addUser(UserLocalServiceUtil.java:384) at com.liferay.faces.demos.service.RegistrantServiceUtil.add(RegistrantServiceUtil.java:95) at com.liferay.faces.demos.bean.RegistrantBackingBean.submit(RegistrantBackingBean.java:97) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.sun.el.parser.AstValue.invoke(AstValue.java:292) at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:304) at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105) at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:147) at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88) at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:814) at javax.faces.component.UICommand.broadcast(UICommand.java:300) at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790) at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282) at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198) at com.liferay.faces.bridge.internal.BridgePhaseActionImpl.execute(BridgePhaseActionImpl.java:92) at com.liferay.faces.bridge.internal.BridgeImpl.doFacesRequest(BridgeImpl.java:93) at javax.portlet.faces.GenericFacesPortlet.processAction(GenericFacesPortlet.java:501)