Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #9507 (closed)

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

BUG: API usage exception on python unittest

Reported by: cneves Owned by: jamoore
Priority: major Milestone: OMERO-4.4.4
Component: OmeroPy Version: n.a.
Keywords: n.a. Cc:
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: 0.0d
Sprint: 2012-08-28 (3)

Description

And Josh already took responsibility for this one :)

The usual combo of develop + https://github.com/cneves/openmicroscopy/tree/postdecorators/7202_unittest_review is throwing the following error on running the test.gatewaytest.multi_group.HistoryTest?.testCreateHistory unittest:

======================================================================
ERROR: testCreateHistory (test.gatewaytest.multi_group.HistoryTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/weblitz/GlencoeSoftware.git/git/omero.git/components/tools/OmeroPy/test/gatewaytest/multi_group.py", line 82, in testCreateHistory
    self.searchHistory(start, end)
  File "/data/weblitz/GlencoeSoftware.git/git/omero.git/components/tools/OmeroPy/test/gatewaytest/multi_group.py", line 41, in searchHistory
    count = tm.countByPeriod([dtype], rtime(long(start)), rtime(long(end)), None, self.gateway.SERVICE_OPTS)
  File "/data/weblitz/GlencoeSoftware.git/git/omero.git/components/tools/OmeroPy/target/omero/gateway/__init__.py", line 3314, in __call__
    return self.handle_exception(e, *args, **kwargs)
  File "/data/weblitz/GlencoeSoftware.git/git/omero.git/components/tools/OmeroPy/target/omero/gateway/__init__.py", line 3311, in __call__
    return self.f(*args, **kwargs)
  File "/data/weblitz/GlencoeSoftware.git/git/omero.git/components/tools/OmeroPy/target/omero_api_ITimeline_ice.py", line 109, i
n countByPeriod
    return _M_omero.api.ITimeline._op_countByPeriod.invoke(self, ((types, start, end, p), _ctx))
ApiUsageException: exception ::omero::ApiUsageException
{
    serverStackTrace = ome.conditions.ApiUsageException: unexpected token: where near line 1, column 320 [select count(obj) from
 ome.model.containers.Dataset obj join  obj.details.creationEvent join  obj.details.owner join  obj.details.group where    (obj.
details.creationEvent.time >= :start   or obj.details.updateEvent.time  >= :start) and (obj.details.creationEvent.time <= :end o
r obj.details.updateEvent.time <= :end ) where obj.details.owner.id = :owner_id ]; nested exception is org.hibernate.hql.ast.Que
rySyntaxException: unexpected token: where near line 1, column 320 [select count(obj) from ome.model.containers.Dataset obj join
  obj.details.creationEvent join  obj.details.owner join  obj.details.group where    (obj.details.creationEvent.time >= :start  
 or obj.details.updateEvent.time  >= :start) and (obj.details.creationEvent.time <= :end or obj.details.updateEvent.time <= :end
 ) where obj.details.owner.id = :owner_id ]
        at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:660)
        at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
        at org.springframework.orm.hibernate3.HibernateInterceptor.invoke(HibernateInterceptor.java:117)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:108)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at ome.tools.hibernate.ProxyCleanupFilter$Interceptor.invoke(ProxyCleanupFilter.java:241)        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)        at ome.services.util.ServiceHandler.invoke(ServiceHandler.java:116)        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)        at $Proxy65.doWork(Unknown Source)        at ome.services.util.Executor$Impl.execute(Executor.java:406)
        at ome.services.util.Executor$Impl.execute(Executor.java:350)
        at ome.services.throttling.Adapter.run(Adapter.java:51)
        at ome.services.throttling.InThreadThrottlingStrategy.runnableCall(InThreadThrottlingStrategy.java:89)
        at ome.services.blitz.impl.AbstractAmdServant.runnableCall(AbstractAmdServant.java:164)
        at ome.services.blitz.impl.TimelineI.countByPeriod_async(TimelineI.java:181)
        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 org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
        at omero.cmd.CallContext.invoke(CallContext.java:59)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
        at $Proxy107.countByPeriod_async(Unknown Source)
        at omero.api._ITimelineTie.countByPeriod_async(_ITimelineTie.java:64)
        at omero.api._ITimelineDisp.___countByPeriod(_ITimelineDisp.java:239)
        at omero.api._ITimelineDisp.__dispatch(_ITimelineDisp.java:301)
        at IceInternal.Incoming.invoke(Incoming.java:159)
        at Ice.ConnectionI.invokeAll(ConnectionI.java:2037)
        at Ice.ConnectionI.message(ConnectionI.java:972)
        at IceInternal.ThreadPool.run(ThreadPool.java:577)
        at IceInternal.ThreadPool.access$100(ThreadPool.java:12)
        at IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:971)

    serverExceptionClass = ome.conditions.ApiUsageException
    message = unexpected token: where near line 1, column 320 [select count(obj) from ome.model.containers.Dataset obj join  obj.details.creationEvent join  obj.details.owner join  obj.details.group where    (obj.details.creationEvent.time >= :start   or obj.details.updateEvent.time  >= :start) and (obj.details.creationEvent.time <= :end or obj.details.updateEvent.time <= :end ) where obj.details.owner.id = :owner_id ]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: unexpected token: where near line 1, column 320 [select count(obj) from ome.model.containers.Dataset obj join  obj.details.creationEvent join  obj.details.owner join  obj.details.group where    (obj.details.creationEvent.time >= :start   or obj.details.updateEvent.time  >= :start) and (obj.details.creationEvent.time <= :end or obj.details.updateEvent.time <= :end ) where obj.details.owner.id = :owner_id ]
}

----------------------------------------------------------------------
Ran 1 test in 9.324s

FAILED (errors=1)

Change History (4)

comment:2 Changed 7 years ago by jmoore

  • Sprint set to 2012-08-28 (3)
  • Status changed from new to accepted

Looks like an issue with skipFrom and skipWhere in QueryBuilder. These are only being used from TimelineI

comment:3 Changed 7 years ago by jmoore

  • Resolution set to fixed
  • Status changed from accepted to closed

comment:4 Changed 7 years ago by jmoore <josh@…>

  • Remaining Time set to 0

(In [08488961f3c65c152306ba0e14c798328f874878/ome.git] on branch develop) Fix TimelineI's use of QueryBuilder? (Fix #9507)

Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.76507 sec.)

We're Hiring!