Bug #894 (closed)
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
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
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.
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: