CriteriaQuery using isNotNull with other conditions results in InternalException

#1

When I try to execute the following criteria query

        CriteriaBuilder builder = em.getCriteriaBuilder();
        CriteriaQuery criteria = builder.createQuery(relationshipClass);
        Root root = criteria.from(relationshipClass);
        criteria.select(root);

        List<Predicate> predicates = new ArrayList<Predicate>();

        predicates.add(builder.equal(root.get("to"), identityObject));
        predicates.add(builder.equal(root.get("relationshipType"), relationshipTypeObject));
        predicates.add(builder.isNotNull(root.get("name")));

        criteria.where(predicates.toArray(new Predicate[predicates.size()]));

        List results = em.createQuery(criteria).getResultList();

i get the exception

java.lang.RuntimeException: com.objectdb.o.InternalException
at org.jboss.seam.security.IdentityImpl.authenticate(IdentityImpl.java:304)
at org.jboss.seam.security.IdentityImpl.login(IdentityImpl.java:223)
at org.jboss.seam.security.org$jboss$weld$bean-WEB-INF$lib$seam-security-impl-ManagedBean-class_org$jboss$seam$security$IdentityImpl_$$_WeldClientProxy.login(org$jboss$weld$bean-WEB-INF$lib$seam-security-impl-ManagedBean-class_org$jboss$seam$security$IdentityImpl_$$_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 com.sun.el.parser.AstValue.invoke(AstValue.java:234)
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.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:409)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
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:326)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
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)
Caused by: com.objectdb.o.InternalException
at com.objectdb.o.InternalException.f(InternalException.java:236)
at com.objectdb.o.QNF.k(QNF.java:295)
at com.objectdb.o.QNF.q(QNF.java:493)
at com.objectdb.o.QNF.k(QNF.java:195)
at com.objectdb.o.QNF.t(QNF.java:580)
at com.objectdb.o.QNF.t(QNF.java:574)
at com.objectdb.o.QNF.k(QNF.java:214)
at com.objectdb.o.QNF.j(QNF.java:134)
at com.objectdb.o.QRC.y(QRC.java:287)
at com.objectdb.o.QRC.v(QRC.java:206)
at com.objectdb.o.QRC.u(QRC.java:163)
at com.objectdb.o.QRM.UR(QRM.java:242)
at com.objectdb.o.MST.UR(MST.java:878)
at com.objectdb.o.WRA.UR(WRA.java:286)
at com.objectdb.o.WSM.UR(WSM.java:113)
at com.objectdb.o.QRR.g(QRR.java:220)
at com.objectdb.o.QRR.b(QRR.java:143)
at com.objectdb.jpa.JpaQuery.getResultList(JpaQuery.java:586)
at org.jboss.seam.security.management.picketlink.JpaIdentityStore.resolveRelationships(JpaIdentityStore.java:1502)
at org.picketlink.idm.impl.repository.WrapperIdentityStoreRepository.resolveRelationships(WrapperIdentityStoreRepository.java:239)
at org.picketlink.idm.impl.api.session.managers.RoleManagerImpl.findRoles(RoleManagerImpl.java:870)
at com.asalsolutions.security.auth.TijAuthenticator.authenticate(TijAuthenticator.java:96)
at org.jboss.seam.security.IdentityImpl.authenticate(IdentityImpl.java:284)
... 45 more

The only time I get the exception is when I combine the isNotNull with other conditions. If I only use isNotNull it works. The other conditions alone also work (both together and individually). 

ObjectDB Version: 2.2.4_04

#2

Thank you for this report. Version 2.2.5 should fix this bug.

ObjectDB Support
#3

2.2.5 does fix the issue. Thanks for the quick fix.

Reply