I currently attach file to dataset using matlab code (similar to the one given on omero website). This code worked for years now. I recently updated to omero 5.2.5 and face a permission issue. I create the annotation from a tif file with the code below
- Code: Select all
iUpdate = session.getUpdateService(); % service used to write object
fa= writeFileAnnotation(session, nameOfFile);
nameOfFile = '{matlab}_mask_2'
(this is a tif file)
However, when I try to link the annotation to the dataset (owned by Z, member of group C), I already did that on the very same dataset from the same user (let's call it J, within the same group C and owner of group C), and connected with group C as security context, I now get the error below. The command is
- Code: Select all
link = linkAnnotation(session,fa,'dataset',str2num(candidateDatasetID));
By the way, I usually finish by
- Code: Select all
iUpdate.saveObject(link);
but it is no longer mentioned on the website https://www.openmicroscopy.org/site/support/omero5.2/developers/Matlab.html. Does that mean that it is dispensable now ?
The created annotation looks to have different permission from psql even if I have no clue how to interpret the figure I got in the permission field (-8 now, -40 before). This is likely a change in the default behaviour, isn't it ?
I used command
- Code: Select all
psql -h localhost -U omero omero -c "select * from annotation where id=237239"
indeed, annotation create in the exemple reads
discriminator | id | description | permissions | ns | version | timevalue | textvalue | boolvalue | termvalue | longvalue | doublevalue | creation_id | external_id | group_id | owner_id | update_id | file | name
---------------------+--------+-------------+-------------+----+---------+-----------+-----------+-----------+-----------+-----------+-------------+-------------+-------------+----------+----------+-----------+---------+------
/type/OriginalFile/ | 237239 | | -8 | | | | | | | | | 154466595 | | 3 | 2 | 154466595 | 1162142 |
An old annotation created by the same code reads
discriminator | id | description | permissions | ns | version | timevalue | textvalue | boolvalue | termvalue | longvalue | doublevalue | creation_id | external_id | group_id | owner_id | update_id | file | name
---------------------+--------+-------------+-------------+----+---------+-----------+-----------+-----------+-----------+-----------+-------------+-------------+-------------+----------+----------+-----------+---------+------
/type/OriginalFile/ | 235851 | | -40 | | | | | | | | | 66313652 | | 3 | 2 | 66313652 | 1011728 |
Could you help me to solve the weird permission issue ?
Thank you so much
Best
Jacques
------------------------- error obtained when linking the annotation ---------------------
Error using linkAnnotation (line 58)
Java exception occurred:
omero.SecurityViolation
serverStackTrace = "ome.conditions.SecurityViolation: Cannot read ome.model.annotations.FileAnnotation:Id_237239
at ome.security.basic.BasicACLVoter.throwLoadViolation(BasicACLVoter.java:167)
at ome.security.CompositeACLVoter.throwLoadViolation(CompositeACLVoter.java:91)
at ome.security.ACLEventListener.onPostLoad(ACLEventListener.java:102)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:250)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:898)
at org.hibernate.loader.Loader.doQuery(Loader.java:773)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1953)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:86)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:76)
at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3270)
at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:496)
at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:477)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:227)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:285)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1082)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:999)
at org.hibernate.event.def.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:453)
at ome.security.basic.MergeEventListener.entityIsDetached(MergeEventListener.java:184)
at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:255)
at ome.security.basic.MergeEventListener.onMerge(MergeEventListener.java:90)
at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:871)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:853)
at org.hibernate.engine.CascadingAction$6.cascade(CascadingAction.java:279)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:392)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:335)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204)
at org.hibernate.engine.Cascade.cascade(Cascade.java:161)
at org.hibernate.event.def.AbstractSaveEventListener.cascadeBeforeSave(AbstractSaveEventListener.java:451)
at org.hibernate.event.def.DefaultMergeEventListener.mergeTransientEntity(DefaultMergeEventListener.java:336)
at org.hibernate.event.def.DefaultMergeEventListener.entityIsTransient(DefaultMergeEventListener.java:303)
at org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener.entityIsTransient(IdTransferringMergeEventListener.java:59)
at ome.security.basic.MergeEventListener.entityIsTransient(MergeEventListener.java:157)
at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:258)
at ome.security.basic.MergeEventListener.onMerge(MergeEventListener.java:90)
at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:84)
at ome.security.basic.MergeEventListener.onMerge(MergeEventListener.java:76)
at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:861)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:845)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:849)
at ome.logic.UpdateImpl.internalMerge(UpdateImpl.java:274)
at ome.logic.UpdateImpl$2.run(UpdateImpl.java:121)
at ome.logic.UpdateImpl$2.run(UpdateImpl.java:118)
at ome.logic.UpdateImpl.doAction(UpdateImpl.java:310)
at ome.logic.UpdateImpl.doAction(UpdateImpl.java:302)
at ome.logic.UpdateImpl.saveAndReturnObject(UpdateImpl.java:118)
at sun.reflect.GeneratedMethodAccessor514.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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 ome.security.basic.EventHandler.invoke(EventHandler.java:154)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.orm.hibernate3.HibernateInterceptor.invoke(HibernateInterceptor.java:111)
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:249)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at ome.services.util.ServiceHandler.invoke(ServiceHandler.java:121)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at com.sun.proxy.$Proxy91.saveAndReturnObject(Unknown Source)
at sun.reflect.GeneratedMethodAccessor514.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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 ome.security.basic.BasicSecurityWiring.invoke(BasicSecurityWiring.java:93)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at ome.services.blitz.fire.AopContextInitializer.invoke(AopContextInitializer.java:43)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at com.sun.proxy.$Proxy91.saveAndReturnObject(Unknown Source)
at sun.reflect.GeneratedMethodAccessor537.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at ome.services.blitz.util.IceMethodInvoker.invoke(IceMethodInvoker.java:172)
at ome.services.throttling.Callback.run(Callback.java:56)
at ome.services.throttling.InThreadThrottlingStrategy.callInvokerOnRawArgs(InThreadThrottlingStrategy.java:56)
at ome.services.blitz.impl.AbstractAmdServant.callInvokerOnRawArgs(AbstractAmdServant.java:140)
at ome.services.blitz.impl.UpdateI.saveAndReturnObject_async(UpdateI.java:62)
at sun.reflect.GeneratedMethodAccessor536.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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:78)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at com.sun.proxy.$Proxy92.saveAndReturnObject_async(Unknown Source)
at omero.api._IUpdateTie.saveAndReturnObject_async(_IUpdateTie.java:92)
at omero.api._IUpdateDisp.___saveAndReturnObject(_IUpdateDisp.java:180)
at omero.api._IUpdateDisp.__dispatch(_IUpdateDisp.java:351)
at IceInternal.Incoming.invoke(Incoming.java:222)
at Ice.ConnectionI.invokeAll(ConnectionI.java:2482)
at Ice.ConnectionI.dispatch(ConnectionI.java:1258)
at Ice.ConnectionI.message(ConnectionI.java:1213)
at IceInternal.ThreadPool.run(ThreadPool.java:321)
at IceInternal.ThreadPool.access$300(ThreadPool.java:12)
at IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:693)
at java.lang.Thread.run(Thread.java:745)
"
serverExceptionClass = "ome.conditions.SecurityViolation"
message = "Cannot read ome.model.annotations.FileAnnotation:Id_237239"
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at IceInternal.BasicStream.createUserException(BasicStream.java:2615)
at IceInternal.BasicStream.access$300(BasicStream.java:12)
at IceInternal.BasicStream$EncapsDecoder10.throwException(BasicStream.java:3099)
at IceInternal.BasicStream.throwException(BasicStream.java:2077)
at IceInternal.Outgoing.throwUserException(Outgoing.java:538)
at omero.api._IUpdateDelM.saveAndReturnObject(_IUpdateDelM.java:260)
at omero.api.IUpdatePrxHelper.saveAndReturnObject(IUpdatePrxHelper.java:802)
at omero.api.IUpdatePrxHelper.saveAndReturnObject(IUpdatePrxHelper.java:780)