Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
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 #1993 (closed)

Opened 14 years ago

Closed 14 years ago

BUG: list output param breaks script

Reported by: jamoore Owned by: jamoore
Priority: n.a. Milestone: OMERO-Beta4.2
Component: n.a. Version: n.a.
Keywords: n.a. Cc: wmoore
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: 0.0d
Sprint: 2010-03-05 (4)

Description

[object #0 (::omero::RLong)
{
    _val = 3691
}, object #0 (::omero::RLong)
{
    _val = 3692
}]
14:28
def runAsScript(
    """
    The main entry point of the script, as called by the client via the scripting service, passing the required parameters. 
    """
    client = scripts.client('saveImageAs.py', 'Use EMAN2 to save an image as mrc etc.', 
    scripts.List("imageIds").inout(),        # List of image IDs. 
    scripts.String("extension", optional=True).inout(),  # File type/extension. E.g. "mrc". If not given, will try to use extension of each image name
    scripts.List("originalFileIds").out())
    
    session = client.getSession()
    
    # process the list of args above. 
    parameterMap = {}
    for key in client.getInputKeys(
        if client.getInput(key):
            parameterMap[key] = client.getInput(key).getValue()
    
    fileIds = saveImageAs(session, parameterMap)        # might return None if failed. 
    print fileIds
    client.setOutput("originalFileIds", omero.rtypes.rlist(fileIds))
    
if __name__ == "__main__":
    runAsScript()

produces:

Traceback (most recent call last):
  File "./script", line 240, in <module>
    runAsScript()
  File "./script", line 237, in runAsScript
    client.setOutput("originalFileIds", omero.rtypes.rlist(fileIds))
  File "/Users/will/Documents/workspace/Omero/dist/lib/python/omero/clients.py", line 718, in setOutput
    self._env("setOutput", key, value)
  File "/Users/will/Documents/workspace/Omero/dist/lib/python/omero/clients.py", line 693, in _env
    return apply(m, (u,)+args)
  File "/Users/will/Documents/workspace/Omero/dist/lib/python/omero_API_ice.py", line 1751, in setOutput
    return _M_omero.api.ISession._op_setOutput.invoke(self, ((sess, key, value), _ctx))
omero.ValidationException: exception ::omero::ValidationException
{
    serverStackTrace = ome.conditions.ValidationException: public abstract void ome.api.ISession.setOutput(java.lang.String,java.lang.String,java.lang.Object) is missing a required @ome.annotations.Validate annotation. This should be added to one of the  implemented interfaces. Refusing to proceed...
    at ome.annotations.ApiConstraintChecker.errorOnViolation(ApiConstraintChecker.java:116)
    at ome.services.util.ServiceHandler.invoke(ServiceHandler.java:89)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy72.setOutput(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor985.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:592)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    at ome.security.basic.BasicSecurityWiring.invoke(BasicSecurityWiring.java:78)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at ome.services.blitz.fire.AopContextInitializer.invoke(AopContextInitializer.java:35)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

and after turning off consistency checks:

File "runSaveAsScript.py", line 34, in <module>
    run()
  File "runSaveAsScript.py", line 27, in run
    returnMap = scriptService.runScript(scriptId, map)
  File "/Users/will/Documents/workspace/Omero/dist/lib/python/omero_api_IScript_ice.py", line 145, in runScript
    return _M_omero.api.IScript._op_runScript.invoke(self, ((id, map), _ctx))
Ice.UnknownException: exception ::Ice::UnknownException
{
    unknown = java.lang.ClassCastException: java.lang.Long
    at omero.RTypeSeqHelper.write(RTypeSeqHelper.java:26)
    at omero.RCollection.__write(RCollection.java:250)
    at omero.RList.__write(RList.java:155)
    at IceInternal.BasicStream.writeInstance(BasicStream.java:1809)
    at IceInternal.BasicStream.writePendingObjects(BasicStream.java:1712)
    at omero.grid._InteractiveProcessorDisp.___getResults(_InteractiveProcessorDisp.java:199)
    at omero.grid._InteractiveProcessorDisp.__dispatch(_InteractiveProcessorDisp.java:290)
    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)

}

Change History (3)

comment:1 Changed 14 years ago by jmoore

  • Status changed from new to assigned

comment:2 Changed 14 years ago by jmoore

  • Cc wmoore added

comment:3 Changed 14 years ago by jmoore

  • Remaining Time changed from 0.5 to 0
  • Resolution set to fixed
  • Status changed from assigned to closed

(In [6265]) fix #1993 - Allowing Object.class and fixing toRType for lists and maps

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.69134 sec.)

We're Hiring!