[ome-devel] Hibernate PropertyAccessExcpetion when creating WellSamples in 4.0.1

josh.moore at gmx.de josh.moore at gmx.de
Mon Apr 27 13:48:42 BST 2009


Bernhard Holländer writes:
 > Dear developers,

Hi Bernhard,

The change moving to 4.0.x is that the relation Well->WelSample is now
ordered, so that users can change the display of an entire Plate to
use the same field.

Though this exception is an abomination, Hibernate is telling you that
it's not possible to save the WellSample without it's Well instance
loaded. This makes sense since the Well.wellSamples List needs to be
loaded so that the "WellSample.well_index" column can be properly
initialized.

To do so, re-order your saves to save the Wells rather than the
WellSamples. This is the same situation as saving Images rather then
Pixels.

Best wishes,
~Josh.

P.S. made mention of such in OmeroClients. Thanks.

 > I've migrated my client sources from 3.1 to 4.0.1, which went
 > rather smoth, but I have a problem with the creation of
 > WellSamples. The following code that worked in 3.1 yields a
 > Hibernate PropertyAccessException (pasted below) when working with
 > the 4.0.1 library:
 > 
 > # python code, given are WellI and ImageI objects fetched from the db
 > ws = WellSampleI()
 > ws.well = WellI(well.id, False)
 > ws.image = ImageI(image.id, False)
 > ws.timepoint = rint(timepoint)
 > ws.posX = rdouble(posX)
 > ws.posY = rdouble(posY)
 > ws = self.updates.saveAndReturnObject(ws)
 > 
 > Here's the exception thrown by the saveAndReturnObject call:
 > 
 > <snip.... python traceback>
 >    552         ws.posX = rdouble(posX)
 >     553         ws.posY = rdouble(posY)
 > --> 554         ws = self.updates.saveAndReturnObject(ws)
 >     555
 >     556         l = ScreenAcquisitionWellSampleLinkI()
 > 
 > /opt/omero-4.0.1/lib/python/omero_API_ice.pyc in
 > saveAndReturnObject(self, obj, _ctx)
 >    2284
 >    2285         def saveAndReturnObject(self, obj, _ctx=None):
 > -> 2286             return
 > _M_omero.api.IUpdate._op_saveAndReturnObject.invoke(self, ((obj, ),
 > _ctx))
 >    2287
 >    2288         def saveAndReturnObject_async(self, _cb, obj,
 > _ctx=None):
 > 
 > InternalException: exception ::omero::InternalException
 > {
 >     serverStackTrace = ome.conditions.InternalException:  Wrapped
 > Exception: (org.springframework.orm.hibernate3.HibernateSystemException):
 > Exception occurred inside getter of ome.model.screen.Well.wellSamples;
 > nested exception is org.hibernate.PropertyAccessException: Exception
 > occurred inside getter of ome.model.screen.Well.wellSamples
 >         at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:661)
 >         at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
 >         at org.springframework.orm.hibernate3.HibernateInterceptor.invoke(HibernateInterceptor.java:117)
 >         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
 >         at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
 >         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
 >         at ome.tools.hibernate.ProxyCleanupFilter$Interceptor.invoke(ProxyCleanupFilter.java:169)
 >         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
 >         at ome.services.util.ServiceHandler.invoke(ServiceHandler.java:97)
 >         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
 >         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
 >         at $Proxy70.saveAndReturnObject(Unknown Source)
 >         at sun.reflect.GeneratedMethodAccessor284.invoke(Unknown
 > Source)
 >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 >         at java.lang.reflect.Method.invoke(Method.java:597)
 >         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)
 >         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
 >         at $Proxy70.saveAndReturnObject(Unknown Source)
 >         at sun.reflect.GeneratedMethodAccessor361.invoke(Unknown Source)
 >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 >         at java.lang.reflect.Method.invoke(Method.java:597)
 >         at ome.services.blitz.util.IceMethodInvoker.callOrClose(IceMethodInvoker.java:257)
 >         at ome.services.blitz.util.IceMethodInvoker.invoke(IceMethodInvoker.java:179)
 >         at ome.services.throttling.Callback.run(Callback.java:55)
 >         at ome.services.throttling.InThreadThrottlingStrategy.callInvokerOnRawArgs(InThreadThrottlingStrategy.java:37)
 >         at ome.services.blitz.impl.AbstractAmdServant.callInvokerOnRawArgs(AbstractAmdServant.java:114)
 >         at ome.services.blitz.impl.UpdateI.saveAndReturnObject_async(UpdateI.java:63)
 >         at omero.api._IUpdateTie.saveAndReturnObject_async(_IUpdateTie.java:85)
 >         at omero.api._IUpdateDisp.___saveAndReturnObject(_IUpdateDisp.java:178)
 >         at omero.api._IUpdateDisp.__dispatch(_IUpdateDisp.java:331)
 >         at IceInternal.Incoming.invoke(Incoming.java:166)
 >         at Ice.ConnectionI.invokeAll(ConnectionI.java:2045)
 >         at Ice.ConnectionI.message(ConnectionI.java:977)
 >         at IceInternal.ThreadPool.run(ThreadPool.java:575)
 >         at IceInternal.ThreadPool.access$100(ThreadPool.java:12)
 >         at IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:951)
 > 
 >     serverExceptionClass = ome.conditions.InternalException
 >     message =  Wrapped Exception:
 > (org.springframework.orm.hibernate3.HibernateSystemException):
 > Exception occurred inside getter of ome.model.screen.Well.wellSamples;
 > nested exception is org.hibernate.PropertyAccessException: Exception
 > occurred inside getter of ome.model.screen.Well.wellSamples
 > }
 > 
 > Is this a problem in the server lib, or do I have to change the way
 > how I create the WellSample?
 > 
 > Thanks for help! Bernhard


More information about the ome-devel mailing list