1 Reply Latest reply on Mar 17, 2006 11:24 AM by Roy Russo

    some things about RoleModule ...

    Mario Tschursch Newbie

      Hi all,

      our company is developing a portal for our customers.
      This portal is based on:

      * jboss-4.0.3SP1
      * jboss-portal-2.2.0

      downloaded from jboss.org.

      Some days ago we experienced a problem while playing around with user and role modules. When this code was executed:

      RoleModule roleModule = (RoleModule) getPortletContext().getAttribute("RoleModule");
      int roleCount = roleModule.getRolesCount();
      


      we got following exception:

      12:03:58,486 ERROR [RoleModuleImpl] Cannot count roles
      org.hibernate.QueryException: could not resolve property: ID of: org.jboss.portal.core.impl.role.RoleImpl [select count(g.ID) from org.jboss.
      le.RoleImpl as g]
      at org.hibernate.persister.entity.AbstractPropertyMapping.throwPropertyException(AbstractPropertyMapping.java:43)
      at org.hibernate.persister.entity.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:37)
      at org.hibernate.persister.entity.AbstractEntityPersister.toType(AbstractEntityPersister.java:1264)
      at org.hibernate.hql.ast.tree.FromElementType.getPropertyType(FromElementType.java:278)
      at org.hibernate.hql.ast.tree.FromElement.getPropertyType(FromElement.java:372)
      at org.hibernate.hql.ast.tree.DotNode.getDataType(DotNode.java:528)
      at org.hibernate.hql.ast.tree.DotNode.prepareLhs(DotNode.java:221)
      at org.hibernate.hql.ast.tree.DotNode.resolve(DotNode.java:172)
      at org.hibernate.hql.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:94)
      at org.hibernate.hql.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:90)
      at org.hibernate.hql.ast.HqlSqlWalker.resolve(HqlSqlWalker.java:626)
      at org.hibernate.hql.antlr.HqlSqlBaseWalker.expr(HqlSqlBaseWalker.java:1215)
      at org.hibernate.hql.antlr.HqlSqlBaseWalker.aggregateExpr(HqlSqlBaseWalker.java:2883)
      at org.hibernate.hql.antlr.HqlSqlBaseWalker.count(HqlSqlBaseWalker.java:2477)
      at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectExpr(HqlSqlBaseWalker.java:1967)
      at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectExprList(HqlSqlBaseWalker.java:1821)
      at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectClause(HqlSqlBaseWalker.java:1392)
      at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:553)
      at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
      at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
      at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:216)
      at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:156)
      at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:103)
      at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:473)
      at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1060)
      at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1010)
      at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
      at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:650)
      at org.jboss.portal.core.impl.role.RoleModuleImpl.getRolesCount(RoleModuleImpl.java:330)
      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:324)
      at org.jboss.mx.interceptor.AttributeDispatcher.invoke(AttributeDispatcher.java:84)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.interceptor.ModelMBeanAttributeInterceptor.invoke(ModelMBeanAttributeInterceptor.java:182)
      at org.jboss.mx.interceptor.PersistenceInterceptor.invoke(PersistenceInterceptor.java:61)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.server.AbstractMBeanInvoker.getAttribute(AbstractMBeanInvoker.java:343)
      at org.jboss.mx.server.MBeanServerImpl.getAttribute(MBeanServerImpl.java:541)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:106)
      at $Proxy128.getRolesCount(Unknown Source)
      at de.ic3s.portlets.jboss.Helloworld.doView(Helloworld.java:66)
      at org.jboss.portlet.JBossPortlet.doDispatch(JBossPortlet.java:217)
      at org.jboss.portlet.JBossPortlet.render(JBossPortlet.java:204)
      at org.jboss.portlet.JBossPortlet.render(JBossPortlet.java:347)
      at org.jboss.portal.portlet.PortletContainer.invokeRender(PortletContainer.java:499)
      at org.jboss.portal.portlet.PortletContainer.dispatch(PortletContainer.java:416)
      at org.jboss.portal.server.app.ComponentInvocation.dispatch(ComponentInvocation.java:66)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:127)
      at org.jboss.portal.core.aspects.component.TransactionInterceptor.invoke(TransactionInterceptor.java:59)
      at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:25)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:117)
      at org.jboss.portal.core.aspects.component.HeaderInterceptor.invoke(HeaderInterceptor.java:37)
      at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:25)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:117)
      at org.jboss.portal.server.aspects.component.NavigationInterceptor.invoke(NavigationInterceptor.java:63)
      at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:25)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:117)
      at org.jboss.portal.server.aspects.component.CacheInterceptor.invoke(CacheInterceptor.java:154)
      at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:25)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:117)
      at org.jboss.portal.server.aspects.component.ModesInterceptor.invoke(ModesInterceptor.java:38)
      at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:25)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:117)
      at org.jboss.portal.server.aspects.component.WindowStatesInterceptor.invoke(WindowStatesInterceptor.java:32)
      at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:25)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:117)
      at org.jboss.portal.bridge.BridgeInterceptor.invoke(BridgeInterceptor.java:36)
      at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:25)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:117)
      at org.jboss.portal.portlet.aspects.component.SessionPostDispatchInterceptor.invoke(SessionPostDispatchInterceptor.java:71)
      at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:25)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:117)
      at org.jboss.portal.server.aspects.component.ContextDispatcherInterceptor$InvokeNextCommand.execute(ContextDispatcherInterceptor.java
      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:324)
      at org.jboss.portal.server.servlet.CommandServlet.doGet(CommandServlet.java:88)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
      at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:539)
      at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
      at org.jboss.portal.server.app.impl.AbstractRequestContext.include(AbstractRequestContext.java:234)
      at org.jboss.portal.server.aspects.component.ContextDispatcherInterceptor$1.include(ContextDispatcherInterceptor.java:60)
      at org.jboss.portal.server.servlet.CommandServlet.include(CommandServlet.java:68)
      at org.jboss.portal.server.aspects.component.ContextDispatcherInterceptor.invoke(ContextDispatcherInterceptor.java:66)
      at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:25)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:117)
      at org.jboss.portal.portlet.aspects.component.SessionPreDispatchInterceptor.invoke(SessionPreDispatchInterceptor.java:97)
      at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:25)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:117)
      at org.jboss.portal.server.aspects.component.ContextTrackerInterceptor.invoke(ContextTrackerInterceptor.java:36)
      at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:25)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:117)
      at org.jboss.portal.portlet.aspects.component.SecureTransportInterceptor.invoke(SecureTransportInterceptor.java:56)
      at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:25)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:117)
      at org.jboss.portal.portlet.aspects.component.ValveInterceptor.invoke(ValveInterceptor.java:51)
      at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:25)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:117)
      at org.jboss.portal.server.invocation.Invocation.invoke(Invocation.java:162)
      at org.jboss.portal.core.command.RenderWindowCommand.execute(RenderWindowCommand.java:71)
      at org.jboss.portal.core.command.ControllerCommand.dispatch(ControllerCommand.java:65)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:127)
      at org.jboss.portal.core.aspects.controller.EventBroadcasterInterceptor.invoke(EventBroadcasterInterceptor.java:72)
      at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:25)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:117)
      at org.jboss.portal.core.aspects.controller.PolicyEnforcementInterceptor.invoke(PolicyEnforcementInterceptor.java:156)
      at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:25)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:117)
      at org.jboss.portal.core.aspects.controller.PortalNodeInterceptor.invoke(PortalNodeInterceptor.java:48)
      at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:25)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:117)
      at org.jboss.portal.core.aspects.controller.NavigationInterceptor.invoke(NavigationInterceptor.java:55)
      at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:25)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:117)
      at org.jboss.portal.server.invocation.Invocation.invoke(Invocation.java:162)
      at org.jboss.portal.core.command.CommandContext.execute(CommandContext.java:94)
      at org.jboss.portal.core.command.CommandContext.chain(CommandContext.java:128)
      at org.jboss.portal.core.command.RenderPageCommand.renderPortlets(RenderPageCommand.java:218)
      at org.jboss.portal.core.command.RenderPageCommand.execute(RenderPageCommand.java:151)
      at org.jboss.portal.core.command.ControllerCommand.dispatch(ControllerCommand.java:65)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:127)
      at org.jboss.portal.core.aspects.controller.EventBroadcasterInterceptor.invoke(EventBroadcasterInterceptor.java:72)
      at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:25)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:117)
      at org.jboss.portal.core.aspects.controller.PolicyEnforcementInterceptor.invoke(PolicyEnforcementInterceptor.java:156)
      at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:25)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:117)
      at org.jboss.portal.core.aspects.controller.PortalNodeInterceptor.invoke(PortalNodeInterceptor.java:48)
      at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:25)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:117)
      at org.jboss.portal.core.aspects.controller.NavigationInterceptor.invoke(NavigationInterceptor.java:45)
      at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:25)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:117)
      at org.jboss.portal.server.invocation.Invocation.invoke(Invocation.java:162)
      at org.jboss.portal.core.command.CommandContext.execute(CommandContext.java:94)
      at org.jboss.portal.core.command.ExecutionContext.execute(ExecutionContext.java:80)
      at org.jboss.portal.core.command.ExecutionContext.execute(ExecutionContext.java:64)
      at org.jboss.portal.core.CoreController.handle(CoreController.java:177)
      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:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.JMXInvocationHandler.invoke(JMXInvocationHandler.java:273)
      at $Proxy131.handle(Unknown Source)
      at org.jboss.portal.server.ServerInvocation.dispatch(ServerInvocation.java:63)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:127)
      at org.jboss.portal.core.aspects.server.SubjectAssociationInterceptor.invoke(SubjectAssociationInterceptor.java:35)
      at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:25)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:117)
      at org.jboss.portal.core.aspects.server.PolicyAssociationInterceptor.invoke(PolicyAssociationInterceptor.java:40)
      at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:25)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:117)
      at org.jboss.portal.server.aspects.server.ContentTypeInterceptor.invoke(ContentTypeInterceptor.java:55)
      at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:25)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:117)
      at org.jboss.portal.core.aspects.server.LocaleInterceptor.invoke(LocaleInterceptor.java:56)
      at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:25)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:117)
      at org.jboss.portal.core.aspects.server.UserInterceptor.invoke(UserInterceptor.java:171)
      at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:25)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:117)
      at org.jboss.portal.server.aspects.server.SessionInvalidatorInterceptor.invoke(SessionInvalidatorInterceptor.java:74)


      after some hours of browsing sourcecode we identified the problem in class
      core/main/org/jboss/portal/core/impl/role/RoleModuleImpl at line 342

      Query query = session.createQuery("select count( g.ID) from RoleImpl as g");
      

      this query was wrong (ID in uppercase, instead lowercase).

      Later on we realized that this problem is fixed in the latest 2.2.1RC3 Release.

      This is only an information for people that might have the same problem yet but havent realized that this problem has been fixed.