Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com.liferay.portal.NoSuchRoleException #305

Closed
ebruchez opened this issue Jun 11, 2012 · 0 comments

Comments

Projects
None yet
1 participant
@ebruchez
Copy link
Collaborator

commented Jun 11, 2012

Testing with Liferay 6.0.6. The default roles are like this:

<property
  as="xs:string" 
  name="oxf.fr.authentication.container.roles"
  value="orbeon admin user"/>

We get this exception e.g. for the user role:

com.liferay.portal.NoSuchRoleException: No Role exists with the key {companyId=1, name=user}
at com.liferay.portal.service.persistence.RolePersistenceImpl.findByC_N(RolePersistenceImpl.java:1520)
at com.liferay.portal.service.impl.RoleLocalServiceImpl.hasUserRole(RoleLocalServiceImpl.java:373)
at sun.reflect.GeneratedMethodAccessor210.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:82)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy75.hasUserRole(Unknown Source)
at com.liferay.portal.service.RoleLocalServiceUtil.hasUserRole(RoleLocalServiceUtil.java:372)
at com.liferay.portlet.PortletRequestImpl.isUserInRole(PortletRequestImpl.java:483)
at sun.reflect.GeneratedMethodAccessor227.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.orbeon.oxf.fr.FormRunner$$anonfun$1.apply(FormRunner.scala:67)
at org.orbeon.oxf.fr.FormRunner$$anonfun$1.apply(FormRunner.scala:66)
at scala.collection.TraversableLike$WithFilter$$anonfun$map$2.apply(TraversableLike.scala:697)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:34)
at scala.collection.mutable.ArrayOps.foreach(ArrayOps.scala:38)
at scala.collection.TraversableLike$WithFilter.map(TraversableLike.scala:696)
at org.orbeon.oxf.fr.FormRunner$.getUserRoles(FormRunner.scala:66)
at org.orbeon.oxf.fr.FormRunner$.getUserRolesAsHeaders(FormRunner.scala:110)
at org.orbeon.oxf.portlet.FormRunnerRequestFilter.amendRequest(FormRunnerRequestFilter.scala:77)
at org.orbeon.oxf.portlet.FormRunnerRequestFilter.amendRequest(FormRunnerRequestFilter.scala:35)
at org.orbeon.oxf.portlet.Portlet2ExternalContext.<init>(Portlet2ExternalContext.java:65)
at org.orbeon.oxf.portlet.OrbeonPortlet.org$orbeon$oxf$portlet$OrbeonPortlet$$directContext(OrbeonPortlet.scala:120)
at org.orbeon.oxf.portlet.OrbeonPortlet$$anonfun$processAction$1$$anonfun$apply$mcV$sp$2$$anonfun$apply$mcV$sp$8.apply(OrbeonPortlet.scala:103)
at org.orbeon.oxf.portlet.OrbeonPortlet$$anonfun$processAction$1$$anonfun$apply$mcV$sp$2$$anonfun$apply$mcV$sp$8.apply(OrbeonPortlet.scala:103)
at org.orbeon.oxf.portlet.BufferedPortlet$class.bufferedProcessAction(BufferedPortlet.scala:65)
at org.orbeon.oxf.portlet.OrbeonPortlet.bufferedProcessAction(OrbeonPortlet.scala:50)
at org.orbeon.oxf.portlet.OrbeonPortlet$$anonfun$processAction$1$$anonfun$apply$mcV$sp$2.apply$mcV$sp(OrbeonPortlet.scala:103)
at org.orbeon.oxf.portlet.OrbeonPortlet$$anonfun$processAction$1$$anonfun$apply$mcV$sp$2.apply(OrbeonPortlet.scala:103)
at org.orbeon.oxf.portlet.OrbeonPortlet$$anonfun$processAction$1$$anonfun$apply$mcV$sp$2.apply(OrbeonPortlet.scala:103)
at org.orbeon.oxf.util.ScalaUtils$.withRootException(ScalaUtils.scala:101)
at org.orbeon.oxf.portlet.OrbeonPortlet$$anonfun$processAction$1.apply$mcV$sp(OrbeonPortlet.scala:102)
at org.orbeon.oxf.portlet.OrbeonPortlet$$anonfun$processAction$1.apply(OrbeonPortlet.scala:102)
at org.orbeon.oxf.portlet.OrbeonPortlet$$anonfun$processAction$1.apply(OrbeonPortlet.scala:102)
at org.orbeon.oxf.util.DynamicVariable.withValue(DynamicVariable.scala:34)
at org.orbeon.oxf.portlet.OrbeonPortlet.processAction(OrbeonPortlet.scala:101)

Questions:

  • why do we have orbeon admin user as default users?
  • why do we get this exception yet things continue working?
  • does this occur with LR 6.1 as well?
  • is it ok to just catch exceptions (maybe log) around userRoles.isUserInRole?

@ghost ghost assigned ebruchez Jun 11, 2012

@ebruchez ebruchez closed this in 9c501ec Dec 17, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.