Seam Security
  1. Seam Security
  2. SEAMSECURITY-91

cannot delete user/role/group in idmconsole example on glassfish3.1.1

    Details

    • Type: Bug Bug
    • Status: Reopened Reopened (View Workflow)
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.1.0.Final
    • Fix Version/s: Future
    • Labels:
      None
    • Environment:
      glassfish3.1.1
    • Similar Issues:
      Show 10 results 

      Description

      deletion fails:
      Exception [EclipseLink-6089] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.QueryException
      Exception Description: The expression has not been initialized correctly. Only a single ExpressionBuilder should be used for a query.
      For parallel expressions, the query class must be provided to the ExpressionBuilder constructor, and the query's ExpressionBuilder must
      always be on the left side of the expression.
      Expression: [
      Base org.jboss.seam.security.examples.idmconsole.model.IdentityObjectRelationship]
      Query: ReadAllQuery(referenceClass=IdentityObjectRelationship )
      at org.eclipse.persistence.exceptions.QueryException.noExpressionBuilderFound(QueryException.java:877)
      at org.eclipse.persistence.expressions.ExpressionBuilder.getDescriptor(ExpressionBuilder.java:195)
      at org.eclipse.persistence.internal.expressions.DataExpression.getMapping(DataExpression.java:214)
      at org.eclipse.persistence.internal.expressions.QueryKeyExpression.getMapping(QueryKeyExpression.java:388)
      at org.eclipse.persistence.internal.expressions.RelationExpression.isObjectComparison(RelationExpression.java:452)
      at org.eclipse.persistence.internal.expressions.RelationExpression.normalize(RelationExpression.java:517)
      at org.eclipse.persistence.internal.expressions.SQLSelectStatement.normalize(SQLSelectStatement.java:1300)
      at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.buildNormalSelectStatement(ExpressionQueryMechanism.java:516)
      at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.prepareSelectAllRows(ExpressionQueryMechanism.java:1602)
      at org.eclipse.persistence.queries.ReadAllQuery.prepareSelectAllRows(ReadAllQuery.java:705)
      at org.eclipse.persistence.queries.ReadAllQuery.prepare(ReadAllQuery.java:642)
      at org.eclipse.persistence.queries.DatabaseQuery.checkPrepare(DatabaseQuery.java:598)
      at org.eclipse.persistence.queries.ObjectLevelReadQuery.checkPrepare(ObjectLevelReadQuery.java:839)
      at org.eclipse.persistence.queries.DatabaseQuery.checkPrepare(DatabaseQuery.java:560)
      at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:797)
      at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1056)
      at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:390)
      at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1144)
      at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2863)
      at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1501)
      at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1483)
      at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1457)
      at org.eclipse.persistence.internal.jpa.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:485)
      at org.eclipse.persistence.internal.jpa.EJBQueryImpl.getResultList(EJBQueryImpl.java:742)
      at org.jboss.seam.security.management.picketlink.JpaIdentityStore.removeRelationships(JpaIdentityStore.java:1404)
      at org.jboss.seam.security.management.picketlink.JpaIdentityStore.removeIdentityObject(JpaIdentityStore.java:1243)
      at org.picketlink.idm.impl.repository.WrapperIdentityStoreRepository.removeIdentityObject(WrapperIdentityStoreRepository.java:158)
      at org.picketlink.idm.impl.api.session.managers.PersistenceManagerImpl.removeUser(PersistenceManagerImpl.java:231)
      at org.jboss.seam.security.management.action.UserAction.deleteUser(UserAction.java:116)
      at org.jboss.seam.security.management.action.org$jboss$weld$bean-WEB-INF$lib$seam-security-3$1$0$Beta2-ManagedBean-org$jboss$seam$security$management$action$UserAction$@javax$enterprise$context$ConversationScoped()@javax$inject$Named(value=)$

      {org$jboss$seam$security$management$action$UserAction$conversation$@javax$inject$Inject()$$org$jboss$seam$security$management$action$UserAction$identitySession$@javax$inject$Inject()$$org$jboss$seam$security$management$action$UserAction$deleteUser$@org$jboss$seam$transaction$Transactional(value=REQUIRED)@org$jboss$seam$transaction$TransactionalInterceptorBinding()$(java$lang$String)$org$jboss$seam$security$management$action$UserAction$save$@org$jboss$seam$transaction$Transactional(value=REQUIRED)@org$jboss$seam$transaction$TransactionalInterceptorBinding()$()$}_$$_WeldClientProxy.deleteUser(org$jboss$weld$bean-WEB-INF$lib$seam-security-3$1$0$Beta2-ManagedBean-org$jboss$seam$security$management$action$UserAction$@javax$enterprise$context$ConversationScoped()@javax$inject$Named(value=)${org$jboss$seam$security$management$action$UserAction$conversation$@javax$inject$Inject()$$org$jboss$seam$security$management$action$UserAction$identitySession$@javax$inject$Inject()$$org$jboss$seam$security$management$action$UserAction$deleteUser$@org$jboss$seam$transaction$Transactional(value=REQUIRED)@org$jboss$seam$transaction$TransactionalInterceptorBinding()$(java$lang$String)$org$jboss$seam$security$management$action$UserAction$save$@org$jboss$seam$transaction$Transactional(value=REQUIRED)@org$jboss$seam$transaction$TransactionalInterceptorBinding()$()$}

      _$$_WeldClientProxy.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:597)
      at javax.el.BeanELResolver.invokeMethod(BeanELResolver.java:737)
      at javax.el.BeanELResolver.invoke(BeanELResolver.java:467)
      at javax.el.CompositeELResolver.invoke(CompositeELResolver.java:254)
      at com.sun.el.parser.AstValue.invoke(AstValue.java:228)
      at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
      at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:43)
      at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:56)
      at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
      at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
      at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
      at javax.faces.component.UICommand.broadcast(UICommand.java:315)
      at javax.faces.component.UIData.broadcast(UIData.java:1093)
      at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
      at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
      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:118)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
      at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
      at org.jboss.seam.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:62)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
      at org.jboss.seam.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:72)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
      at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
      at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
      at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
      at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
      at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
      at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
      at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
      at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
      at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
      at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
      at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
      at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
      at java.lang.Thread.run(Thread.java:662)

        Activity

        Hide
        Richard Barabe
        added a comment -

        Oh ... uh ... What a shame

        You are totally right. An esoteric bunch of circumstances made me think it was working ok when in fact it wasn't working at all. And I just learned that we didn't have any integrity constraint in database while testing. So my database would have filled itself with dead relashionship over time.

        I'm sorry Thomas, this obvious error took your time. Thank you

        Show
        Richard Barabe
        added a comment - Oh ... uh ... What a shame You are totally right. An esoteric bunch of circumstances made me think it was working ok when in fact it wasn't working at all. And I just learned that we didn't have any integrity constraint in database while testing. So my database would have filled itself with dead relashionship over time. I'm sorry Thomas, this obvious error took your time. Thank you
        Hide
        Tomas Remes
        added a comment - - edited

        No worry Richard. It's my job and you helped to Seam. I learn everyday. Thank's

        Show
        Tomas Remes
        added a comment - - edited No worry Richard. It's my job and you helped to Seam. I learn everyday. Thank's
        Hide
        Richard Barabe
        added a comment -

        I just tried it with the 3.2.0-SNAPSHOT (containing the fix) and got the dreadful "Only a single ExpressionBuilder should be used for a query" again.

        My use case is simple : deleting a user.

        In the removeRelationships method that is called, there is two queries that are executed for the same entity class (relationshipClass) using JPA Criteria API. The exception occurs when executing the second one, as if the first one had not finished yet (but it has).

        Strangely, if I put a breakpoint between the two queries, and then proceed with execution, the exception is not raised.
        Removing the breakpoint to have normal execution brings back the exception.

        I tried, by curiosity, to put a Thread.sleep(200) after the execution of the first query. With that, no problem, the two queries are executed ...

        That seems to be some sort of timing in eclipselink making it think the first query haven't finished ...
        I replaced my Thread.sleep with a em.flush and still no exception, but I'm sure the flush itself is not what correct the problem.

        I'm using glassfish 3.1.2.

        Anyone can confirm the problem ? If so maybe that issue should be re-opened.

        Show
        Richard Barabe
        added a comment - I just tried it with the 3.2.0-SNAPSHOT (containing the fix) and got the dreadful "Only a single ExpressionBuilder should be used for a query" again. My use case is simple : deleting a user. In the removeRelationships method that is called, there is two queries that are executed for the same entity class (relationshipClass) using JPA Criteria API. The exception occurs when executing the second one, as if the first one had not finished yet (but it has). Strangely, if I put a breakpoint between the two queries, and then proceed with execution, the exception is not raised. Removing the breakpoint to have normal execution brings back the exception. I tried, by curiosity, to put a Thread.sleep(200) after the execution of the first query. With that, no problem, the two queries are executed ... That seems to be some sort of timing in eclipselink making it think the first query haven't finished ... I replaced my Thread.sleep with a em.flush and still no exception, but I'm sure the flush itself is not what correct the problem. I'm using glassfish 3.1.2. Anyone can confirm the problem ? If so maybe that issue should be re-opened.
        Hide
        Tomas Remes
        added a comment -

        I will check it as soon as possible. Thank's

        Show
        Tomas Remes
        added a comment - I will check it as soon as possible. Thank's
        Hide
        Tomas Remes
        added a comment -

        Confirmed. It really seems to be some strange timing issue.

        Show
        Tomas Remes
        added a comment - Confirmed. It really seems to be some strange timing issue.

          People

          • Assignee:
            Shane Bryzak
            Reporter:
            Tomas Remes
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: