• Views
  • Iteration Report
  • My Iteration Report
  •  
OMERO.server
  • Login
  • Help/Guide
  • About Trac
  • Preferences
  • Wiki
  • Timeline
  • Roadmap
  • Browse Source
  • View Tickets
  • Search

Context Navigation

  • ← Previous Ticket
  • Next Ticket →

Ticket #894 (closed defect: fixed)

Opened 6 months ago

Last modified 4 months ago

Blitz API Mapping Failures

Reported by: callan Owned by: callan
Priority: critical Milestone: 3.0-Beta3
Component: API Version:
Keywords: Cc: donald, jmoore, atarkowska

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

Changed 6 months ago by callan

  • 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)

}

Changed 6 months ago by callan

  • cc jmoore, atarkowska added
  • status changed from assigned to closed
  • resolution set to fixed

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?

Changed 6 months ago by callan

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.

Changed 4 months 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.

Download in other formats:

  • Comma-delimited Text
  • Tab-delimited Text
  • RSS Feed

Trac Powered

Powered by Trac 0.11
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/