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"

Bug #894 (closed)

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

Blitz API Mapping Failures

Reported by: cxallan Owned by: cxallan
Priority: critical Cc: dzmacdonald, jamoore, atarkowska
Sprint: n.a.
Total Remaining Time: n.a.

Description

While putting in the logic required for #891, the following was added to API.ice:

omero::RLong copyAndResizePixels(long pixelsId,
                                 omero::RInt sizeX,
                                 omero::RInt sizeY,
                                 omero::RInt sizeZ,
                                 omero::RInt sizeT,
                                 string methodology);

It would appear that somehow, the nullable omero::RInt is not mapped correctly by the API consistency check to java.lang.Integer.

Now ignoring the obvious missing throws ServerError checked exception declaration, this method miraculously causes an ApiConsistencyException even though it appears to match perfectly with the following interface declaration:

public Long copyAndResizePixels(long pixelsId, Integer sizeX, Integer sizeY,
                                Integer sizeZ, Integer sizeT,
                                String methodology);

Specifically, the following ApiConsistencyException stack trace is generated:

Method mismatch between:
native Java:[public abstract void ome.api.IPixels.saveRndSettings(ome.model.display.RenderingDef), public abstract ome.model.IObject ome.api.IPixels.getEnumeration(java.lang.Class,java.lang.String), public abstract ome.model.core.Pixels ome.api.IPixels.retrievePixDescription(long), public abstract java.lang.Long ome.api.IPixels.copyAndResizePixels(long,java.lang.Integer,java.lang.Integer,java.lang.Integer,java.lang.Integer,java.lang.String), public abstract ome.model.display.RenderingDef ome.api.IPixels.retrieveRndSettings(long), public abstract int ome.api.IPixels.getBitDepth(ome.model.enums.PixelsType), public abstract java.util.List ome.api.IPixels.getAllEnumerations(java.lang.Class)]
and Blitz:[public abstract void omero.api._IPixelsOperations.saveRndSettings(omero.model.RenderingDef,Ice.Current) throws omero.ServerError, public abstract omero.RObject omero.api._IPixelsOperations.getEnumeration(java.lang.String,java.lang.String,Ice.Current) throws omero.ServerError, public abstract omero.model.Pixels omero.api._IPixelsOperations.retrievePixDescription(long,Ice.Current) throws omero.ServerError, public abstract omero.RLong omero.api._IPixelsOperations.copyAndResizePixels(long,omero.RInt,omero.RInt,omero.RInt,omero.RInt,java.lang.String,Ice.Current) throws omero.ServerError, public abstract omero.model.RenderingDef omero.api._IPixelsOperations.retrieveRndSettings(long,Ice.Current) throws omero.ServerError, public abstract int omero.api._IPixelsOperations.getBitDepth(omero.model.PixelsType,Ice.Current) throws omero.ServerError, public abstract java.util.List omero.api._IPixelsOperations.getAllEnumerations(java.lang.String,Ice.Current) throws omero.ServerError]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:485)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:170)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:413)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:735)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:369)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:122)
        at ome.system.OmeroContext.<init>(OmeroContext.java:88)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:83)
        ... 17 more
Caused by: ome.services.blitz.util.ApiConsistencyException:
Parameter type mismatch: class java.lang.Integer & class omero.RInt
Parameter type mismatch: class java.lang.Integer & class omero.RInt
Parameter type mismatch: class java.lang.Integer & class omero.RInt
Parameter type mismatch: class java.lang.Integer & class omero.RInt

Method mismatch between:
native Java:[public abstract void ome.api.IPixels.saveRndSettings(ome.model.display.RenderingDef), public abstract ome.model.IObject ome.api.IPixels.getEnumeration(java.lang.Class,java.lang.String), public abstract ome.model.core.Pixels ome.api.IPixels.retrievePixDescription(long), public abstract java.lang.Long ome.api.IPixels.copyAndResizePixels(long,java.lang.Integer,java.lang.Integer,java.lang.Integer,java.lang.Integer,java.lang.String), public abstract ome.model.display.RenderingDef ome.api.IPixels.retrieveRndSettings(long), public abstract int ome.api.IPixels.getBitDepth(ome.model.enums.PixelsType), public abstract java.util.List ome.api.IPixels.getAllEnumerations(java.lang.Class)]
and Blitz:[public abstract void omero.api._IPixelsOperations.saveRndSettings(omero.model.RenderingDef,Ice.Current) throws omero.ServerError, public abstract omero.RObject omero.api._IPixelsOperations.getEnumeration(java.lang.String,java.lang.String,Ice.Current) throws omero.ServerError, public abstract omero.model.Pixels omero.api._IPixelsOperations.retrievePixDescription(long,Ice.Current) throws omero.ServerError, public abstract omero.RLong omero.api._IPixelsOperations.copyAndResizePixels(long,omero.RInt,omero.RInt,omero.RInt,omero.RInt,java.lang.String,Ice.Current) throws omero.ServerError, public abstract omero.model.RenderingDef omero.api._IPixelsOperations.retrieveRndSettings(long,Ice.Current) throws omero.ServerError, public abstract int omero.api._IPixelsOperations.getBitDepth(omero.model.PixelsType,Ice.Current) throws omero.ServerError, public abstract java.util.List omero.api._IPixelsOperations.getAllEnumerations(java.lang.String,Ice.Current) throws omero.ServerError]
        at ome.services.blitz.util.ApiConsistencyCheck.postProcessAfterInitialization(ApiConsistencyCheck.java:107)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:334)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1368)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:540)
        ... 34 more

Change History (4)

comment:1 Changed 16 years ago by cxallan

  • Cc donald added
  • Owner changed from jmoore to callan
  • Status changed from new to assigned

Adjusting ApiConsistencyCheck to allow the RInt to Integer mapping seems to uncover a slightly more sinister problem with the way nullable return types are mapped as well:

>>> ipixels.copyAndResizePixels(50L, omero.RInt(256), omero.RInt(256), omero.RInt(20), omero.RInt(20), "Python Test")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/home/callan/OMERO3/dist/lib/omero_API_ice.py", line 733, in copyAndResizePixels
    return _M_omero.api.IPixels._op_copyAndResizePixels.invoke(self, (pixelsId, sizeX, sizeY, sizeZ, sizeT, methodology), _ctx)
Ice.UnknownException: exception ::Ice::UnknownException
{
    unknown = java.lang.ClassCastException: java.lang.Long
        at $Proxy68.copyAndResizePixels(Unknown Source)
        at omero.api._IPixelsTie.copyAndResizePixels(_IPixelsTie.java:64)
        at omero.api._IPixelsDisp.___copyAndResizePixels(_IPixelsDisp.java:275)
        at omero.api._IPixelsDisp.__dispatch(_IPixelsDisp.java:315)
        at IceInternal.Incoming.invoke(Incoming.java:147)
        at Ice.ConnectionI.invokeAll(ConnectionI.java:2249)
        at Ice.ConnectionI.message(ConnectionI.java:1362)
        at IceInternal.ThreadPool.run(ThreadPool.java:782)
        at IceInternal.ThreadPool.access$100(ThreadPool.java:12)
        at IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:1242)

}

comment:2 Changed 16 years ago by cxallan

  • Cc jmoore atarkowska added
  • Resolution set to fixed
  • Status changed from assigned to closed

r2302 resolves this in principal by ensuring that Integer, Long, Float and Double are not treated by the IceMapper as primitives. I'm a bit concerned about so fundamental a change, Josh can you have a look at this and see what you think?

comment:3 Changed 16 years ago by cxallan

r2303 (minus the idiocy introduced by yours truly reverted by r2304) re-introduces some mappings that ensure the existing Slice definitions do not break. We probably should review some of the methods, specifically in the thumbnail store, that use nullable types and rectify API mismatches.

comment:4 Changed 16 years ago by jmoore

r2362 tightens up the consistency check (add return value checks) as well as changes the nullability semantics of several methods.

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

We're Hiring!