We're Hiring!

bug in changeActiveGroup

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

bug in changeActiveGroup

Postby Manz » Tue Dec 06, 2011 8:31 am

Hey Guys,

I'm trying to get the function conn.changeActiveGroup to work and I keep coming up with the following error. It works sometimes in one group that the user has created but not the others, despite the settings for the groups and the users being the exact same. I found the bug report on http://trac.openmicroscopy.org/ome/ticket/2339 that corresponds to it but I don't understand how I can work around it. Do I need to shut down the current session, and how do i do that (function/library)? I get it also when I try to change the session using the omero CLI using the same session as given in conn._getSessionId()


My code looks like (in webtest/views.py)
conn = kwargs['conn']
theAdminofGroup=conn._getSessionId()
ExImvar=conn.changeActiveGroup(154)
#ExImvar=dbconnect.mvImgtoDsPublicUsingexim(imgid,theAdminofGroup)
return HttpResponse(ExImvar)


The error is :-

Code: Select all

Traceback (most recent call last):

  File "/opt/OmeroServer/lib/python/django/core/handlers/base.py", line 92, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/opt/OmeroServer/lib/python/omeroweb/webclient/views.py", line 165, in wrapped
    return f(request, *args, **kwargs)

  File "/opt/OmeroServer/lib/python/omeroweb/webtest/views.py", line 212, in publishimage
    ExImvar=conn.setGroupNameForSession('Amandas Test Group_public')

  File "/opt/OmeroServer/lib/python/omero/gateway/__init__.py", line 1708, in setGroupNameForSession
    return self.setGroupForSession(g.getId().val)

  File "/opt/OmeroServer/lib/python/omero/gateway/__init__.py", line 1726, in setGroupForSession
    self.c.sf.setSecurityContext(omero.model.ExperimenterGroupI(groupid, False))

  File "/opt/OmeroServer/lib/python/omero_API_ice.py", line 198, in setSecurityContext
    return _M_omero.api.ServiceFactory._op_setSecurityContext.invoke(self, ((obj, ), _ctx))

SecurityViolation: exception ::omero::SecurityViolation
{
    serverStackTrace = ome.conditions.SecurityViolation: SecurityContext change cancelled:
Client e89d7076-5862-44c7-bfce-213293e4a4bd has active stateful services:

84:ea:dd:c2:3981bbbb:133fcef8140:-7a2comero.api.RenderingEngine
Client 9a243304-9877-4261-bde0-5fe15fecb658 has active stateful services:

84:ea:dd:c2:3981bbbb:133fcef8140:-7a2comero.api.RenderingEngine
Client 41dc15a8-6c08-4770-8c0f-a0728e2f6ecd has active stateful services:

84:ea:dd:c2:3981bbbb:133fcef8140:-7a2comero.api.RenderingEngine
Client e1d324d5-e185-4f43-a0c8-38624ff19f41 has active stateful services:

84:ea:dd:c2:3981bbbb:133fcef8140:-7a2comero.api.RenderingEngine
Client 054ee2c1-80fc-4f1c-afd4-bc7da516ab82 has active stateful services:

84:ea:dd:c2:3981bbbb:133fcef8140:-7a2comero.api.RenderingEngine
Client fc6d99e3-ccf8-4be2-8fc6-098f69f3aea0 has active stateful services:

84:ea:dd:c2:3981bbbb:133fcef8140:-7a2comero.api.RenderingEngine

   at ome.services.sessions.events.ChangeSecurityContextEvent.throwIfCancelled(ChangeSecurityContextEvent.java:61)
   at ome.services.sessions.SessionManagerImpl.setSecurityContext(SessionManagerImpl.java:1114)
   at ome.services.blitz.impl.ServiceFactoryI.setSecurityContext(ServiceFactoryI.java:318)
   at omero.api._ServiceFactoryDisp.___setSecurityContext(_ServiceFactoryDisp.java:393)
   at omero.api._ServiceFactoryDisp.__dispatch(_ServiceFactoryDisp.java:1379)
   at IceInternal.Incoming.invoke(Incoming.java:159)
   at Ice.ConnectionI.invokeAll(ConnectionI.java:2037)
   at Ice.ConnectionI.message(ConnectionI.java:972)
   at IceInternal.ThreadPool.run(ThreadPool.java:577)
   at IceInternal.ThreadPool.access$100(ThreadPool.java:12)
   at IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:971)

    serverExceptionClass = ome.conditions.SecurityViolation
    message = SecurityContext change cancelled:
Client e89d7076-5862-44c7-bfce-213293e4a4bd has active stateful services:

84:ea:dd:c2:3981bbbb:133fcef8140:-7a2comero.api.RenderingEngine
Client 9a243304-9877-4261-bde0-5fe15fecb658 has active stateful services:

84:ea:dd:c2:3981bbbb:133fcef8140:-7a2comero.api.RenderingEngine
Client 41dc15a8-6c08-4770-8c0f-a0728e2f6ecd has active stateful services:

84:ea:dd:c2:3981bbbb:133fcef8140:-7a2comero.api.RenderingEngine
Client e1d324d5-e185-4f43-a0c8-38624ff19f41 has active stateful services:

84:ea:dd:c2:3981bbbb:133fcef8140:-7a2comero.api.RenderingEngine
Client 054ee2c1-80fc-4f1c-afd4-bc7da516ab82 has active stateful services:

84:ea:dd:c2:3981bbbb:133fcef8140:-7a2comero.api.RenderingEngine
Client fc6d99e3-ccf8-4be2-8fc6-098f69f3aea0 has active stateful services:

84:ea:dd:c2:3981bbbb:133fcef8140:-7a2comero.api.RenderingEngine

}


<WSGIRequest
GET:<QueryDict: {}>,
POST:<QueryDict: {u'userId': [u'True'], u'imageIds': [u'3431'], u'isOwned': [u'True'], u'publish': [u'Publish']}>,
COOKIES:{'PHPSESSID': 'u4h1spls3sh63cooglie4p0re3',
'_#srchist': '',
'_#uid': '1310509963109.1002834041.2414.468737780',
'__utma': '43582067.747350716.1310509960.1323143287.1323150442.53',
'__utmc': '43582067',
'__utmz': '43582067.1322784305.49.37.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=eskitis',
'dActual': 'desktop',
'dVice': 'desktop',
'device': 'theme-standard',
'sessionid': 'bcdfed70488953c94b12ddbffaab9c8a',
'setSSO': '',
'text-size': '2'},
META:{'CONTENT_LENGTH': '54',
'CONTENT_TYPE': 'application/x-www-form-urlencoded',
'DOCUMENT_ROOT': '/var/www/html',
'GATEWAY_INTERFACE': 'CGI/1.1',
'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
'HTTP_ACCEPT_ENCODING': 'gzip,deflate,sdch',
'HTTP_ACCEPT_LANGUAGE': 'en-US,en;q=0.8',
'HTTP_CACHE_CONTROL': 'max-age=0',
'HTTP_CONNECTION': 'keep-alive',
'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.1 (KHTML, like Gecko) Ubuntu/11.04 Chromium/14.0.835.202 Chrome/14.0.835.202 Safari/535.1',
'PATH': '/sbin:/usr/sbin:/bin:/usr/bin',
'PATH_INFO': u'/webtest/publishimage/',
'PATH_TRANSLATED': '/opt/OmeroServer/var/omero.fcgi/webtest/publishimage/',
'QUERY_STRING': '',
'REQUEST_METHOD': 'POST',
'REQUEST_URI': '/webtest/publishimage/',


Manz
 
Posts: 72
Joined: Wed Jun 29, 2011 11:48 pm

Re: bug in changeActiveGroup

Postby jmoore » Tue Dec 06, 2011 9:00 am

Hi,

what's happening is that stateful services which could still be in use are still active and therefore the group can't be changed. You will need to get a list of such services and then close them but only if you know that they are finished executing:
Code: Select all
services = g.c.getStatefulServices()
for service in services:
    service.close()


A full example is below.
Cheers,
~Josh

Code: Select all
import omero
import omero.gateway as og

g = og.BlitzGateway(username="root", group="system") # Your login here
g.connect()

g.c.sf.createRenderingEngine()
services = g.c.getStatefulServices()

def test():
    old = g.c.sf.setSecurityContext(omero.model.ExperimenterGroupI(1, False))
    print "Set group to 1. Old group was: %s" % old.id.val

try:
    test()
    print "will never reach here"
except:
    print "Stateful services:", len(services)
    for service in services:
        try:
            service.close()
        except:
            print "Failed to close %s" % service
    test()
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: bug in changeActiveGroup

Postby Manz » Tue Dec 06, 2011 10:52 pm

Thanks! That has closed the sessions, but now I cannot import an image. I'm using the following, the image is an image that I have imported before without issues and can again if I delete the lines you gave me.

Code: Select all
/opt/OmeroServer/bin/omero -s localhost -k 8deb1905-b277-4810-8455-c2cc364c1af3 import /OMERO/OMERODropbox/s2686739/Merged.tif -d 859




Code: Select all

                        "
    serverExceptionClass = "ome.conditions.ValidationException"
    message = "could not insert: [ome.model.containers.DatasetImageLink]; SQL [insert into datasetimagelink (child, creation_id, external_id, group_id, owner_id, permissions, update_id, parent, version, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [datasetimagelink_pkey]; nested exception is org.hibernate.exception.ConstraintViolationException: could not insert: [ome.model.containers.DatasetImageLink]"
        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:513)
        at java.lang.Class.newInstance0(Class.java:355)
        at java.lang.Class.newInstance(Class.java:308)
        at IceInternal.BasicStream$DynamicUserExceptionFactory.createAndThrow(BasicStream.java:2243)
        at IceInternal.BasicStream.throwException(BasicStream.java:1632)
        at IceInternal.Outgoing.throwUserException(Outgoing.java:442)
        at omero.api._MetadataStoreDelM.saveToDB(_MetadataStoreDelM.java:162)
        at omero.api.MetadataStorePrxHelper.saveToDB(MetadataStorePrxHelper.java:254)
        at omero.api.MetadataStorePrxHelper.saveToDB(MetadataStorePrxHelper.java:226)
        at ome.formats.OMEROMetadataStoreClient.saveToDB(OMEROMetadataStoreClient.java:2148)
        ... 5 more
2011-12-07 08:18:57,964 4021       [      main] INFO         ome.formats.importer.ImportLibrary  - Exiting on error
[omero@omero OmeroServer]$ tail var/log/Blitz-0.log
2011-12-07 08:45:31,351 INFO  [                 org.perf4j.TimingLogger] (2-thread-8) start[1323211531341] time[10] tag[omero.call.success.ome.services.sessions.SessionManagerImpl$6.doWork]
2011-12-07 08:45:31,352 INFO  [        ome.services.util.ServiceHandler] (2-thread-8)  Rslt:    (ome.model.meta.Experimenter:Id_102, ome.model.meta.ExperimenterGroup:Id_153, [3, 4, 5, 153, 154, 0, 53, 1], ... 4 more)
2011-12-07 08:45:31,352 INFO  [                 org.perf4j.TimingLogger] (l.Server-3) start[1323211531340] time[12] tag[omero.call.success.ome.logic.AdminImpl.getEventContext]
2011-12-07 08:45:31,352 INFO  [        ome.services.util.ServiceHandler] (l.Server-3)  Rslt:    ome.system.SimpleEventContext@7dc377b2
2011-12-07 08:45:31,354 INFO  [        ome.services.util.ServiceHandler] (l.Server-4)  Meth:    interface ome.api.IAdmin.lookupGroup
2011-12-07 08:45:31,354 INFO  [        ome.services.util.ServiceHandler] (l.Server-4)  Args:    [Amandas Test Group_public]
2011-12-07 08:45:31,355 INFO  [         ome.security.basic.EventHandler] (l.Server-4)  Auth:    user=102,group=153,event=null(User),sess=cc60b7bc-782b-4874-835f-41fe4b579aee
2011-12-07 08:45:31,358 INFO  [                 org.perf4j.TimingLogger] (l.Server-4) start[1323211531354] time[4] tag[omero.call.success.ome.logic.AdminImpl.lookupGroup]
2011-12-07 08:45:31,358 INFO  [        ome.services.util.ServiceHandler] (l.Server-4)  Rslt:    ome.model.meta.ExperimenterGroup:Id_154
2011-12-07 08:45:31,362 INFO  [e.services.sessions.SessionContext$Count] (l.Server-7) -Reference count: cc60b7bc-782b-4874-835f-41fe4b579aee=5



and from the CLI importer:

Code: Select all

[omero@omero OmeroServer]$ /opt/OmeroServer/bin/omero -s localhost -k 3434dea7-7045-47d3-a997-39fababd03f1 import /OMERO/OMERODropbox/s2686739/Merged.tif -d 859
Joined session 3434dea7-7045-47d3-a997-39fababd03f1 (s2686739@localhost:4064). Idle timeout: 10.0 min. Current group: Amandas Test Group_public
2011-12-07 09:31:33,490 0          [      main] INFO          ome.formats.importer.ImportConfig  - OMERO Version: 4.3.1-6d4b8c61-b2602
2011-12-07 09:31:33,499 9          [      main] INFO          ome.formats.importer.ImportConfig  - Bioformats version: 4.3.1 revision: 27e733b date: 7 July 2011
2011-12-07 09:31:33,546 56         [      main] INFO   formats.importer.cli.CommandLineImporter  - Log levels -- Bio-Formats: ERROR OMERO.importer: INFO
2011-12-07 09:31:34,116 626        [      main] INFO      ome.formats.importer.ImportCandidates  - Depth: 4 Metadata Level: MINIMUM
2011-12-07 09:31:37,207 3717       [      main] INFO      ome.formats.importer.ImportCandidates  - 1 file(s) parsed into 1 group(s) with 1 call(s) to setId in 3087ms. (3091ms total) [0 unknowns]
2011-12-07 09:31:37,895 4405       [      main] WARN                    ome.system.UpgradeCheck  - UPGRADE AVAILABLE:<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="https://login?host=upgrade.openmicroscopy.org.uk&amp;url=&amp;params=">here</a>.</p>
<hr>
<address>Apache/2.2.3 (Red Hat) Server at.au </address>
</body></html>

2011-12-07 09:31:37,962 4472       [      main] INFO       ome.formats.OMEROMetadataStoreClient  - Attempting initial SSL connection to localhost:4064
2011-12-07 09:31:38,564 5074       [      main] INFO       ome.formats.OMEROMetadataStoreClient  - Insecure connection requested, falling back
2011-12-07 09:31:38,953 5463       [      main] INFO       ome.formats.OMEROMetadataStoreClient  - Server: 4.3.1
2011-12-07 09:31:38,953 5463       [      main] INFO       ome.formats.OMEROMetadataStoreClient  - Client: Dev Build
2011-12-07 09:31:38,954 5464       [      main] INFO       ome.formats.OMEROMetadataStoreClient  - Java Version: 1.6.0_25
2011-12-07 09:31:38,954 5464       [      main] INFO       ome.formats.OMEROMetadataStoreClient  - OS Name: Linux
2011-12-07 09:31:38,954 5464       [      main] INFO       ome.formats.OMEROMetadataStoreClient  - OS Arch: amd64
2011-12-07 09:31:38,954 5464       [      main] INFO       ome.formats.OMEROMetadataStoreClient  - OS Version: 2.6.18-194.el5
2011-12-07 09:31:40,851 7361       [      main] INFO         ome.formats.importer.ImportLibrary  - File format: Adobe Photoshop TIFF
2011-12-07 09:31:40,851 7361       [      main] INFO         ome.formats.importer.ImportLibrary  - Metadata only import? false
2011-12-07 09:31:40,852 7362       [      main] INFO         ome.formats.importer.ImportLibrary  - Archiving enabled? false
2011-12-07 09:31:40,852 7362       [      main] INFO         ome.formats.importer.ImportLibrary  - Container metadata only import? false
2011-12-07 09:31:40,852 7362       [      main] INFO         ome.formats.importer.ImportLibrary  - Reader is not of HCS domain, use metafile: true
2011-12-07 09:31:40,929 7439       [      main] WARN       ome.formats.model.ReferenceProcessor  - Unknown target class for LSID: Image:2
2011-12-07 09:31:40,930 7440       [      main] WARN       ome.formats.model.ReferenceProcessor  - Unknown target class for LSID: Image:1
2011-12-07 09:31:40,930 7440       [      main] WARN       ome.formats.model.ReferenceProcessor  - Unknown target class for LSID: Image:0
2011-12-07 09:31:40,930 7440       [      main] WARN       ome.formats.model.ReferenceProcessor  - Unknown target class for LSID: Image:6
2011-12-07 09:31:40,930 7440       [      main] WARN       ome.formats.model.ReferenceProcessor  - Unknown target class for LSID: Image:5
2011-12-07 09:31:40,931 7441       [      main] WARN       ome.formats.model.ReferenceProcessor  - Unknown target class for LSID: Image:4
2011-12-07 09:31:40,931 7441       [      main] WARN       ome.formats.model.ReferenceProcessor  - Unknown target class for LSID: Image:3
2011-12-07 09:31:41,198 7708       [      main] ERROR     ome.formats.importer.cli.ErrorHandler  - INTERNAL_EXCEPTION: /OMERO/OMERODropbox/s2686739/Merged.tif
java.lang.RuntimeException: omero.ValidationException
    serverStackTrace = "ome.conditions.ValidationException: could not insert: [ome.model.containers.DatasetImageLink]; SQL [insert into datasetimagelink (child, creation_id, external_id, group_id, owner_id, permissions, update_id, parent, version, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [datasetimagelink_pkey]; nested exception is org.hibernate.exception.ConstraintViolationException: could not insert: [ome.model.containers.DatasetImageLink]
                                at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:637)
                                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: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:231)
                                at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
                                at ome.services.util.ServiceHandler.invoke(ServiceHandler.java:116)
                                at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
                                at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
                                at $Proxy64.doWork(Unknown Source)
                                at ome.services.util.Executor$Impl.execute(Executor.java:371)
                                at ome.services.throttling.Adapter.run(Adapter.java:51)
                                at ome.services.throttling.InThreadThrottlingStrategy.runnableCall(InThreadThrottlingStrategy.java:89)
                                at ome.services.blitz.impl.AbstractAmdServant.runnableCall(AbstractAmdServant.java:150)
                                at ome.services.blitz.impl.MetadataStoreI.saveToDB_async(MetadataStoreI.java:190)
                                at omero.api._MetadataStoreTie.saveToDB_async(_MetadataStoreTie.java:85)
                                at omero.api._MetadataStoreDisp.___saveToDB(_MetadataStoreDisp.java:218)
                                at omero.api._MetadataStoreDisp.__dispatch(_MetadataStoreDisp.java:366)
                                at IceInternal.Incoming.invoke(Incoming.java:159)
                                at Ice.ConnectionI.invokeAll(ConnectionI.java:2037)
                                at Ice.ConnectionI.message(ConnectionI.java:972)
                                at IceInternal.ThreadPool.run(ThreadPool.java:577)
                                at IceInternal.ThreadPool.access$100(ThreadPool.java:12)
                                at IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:971)
                        "
    serverExceptionClass = "ome.conditions.ValidationException"
    message = "could not insert: [ome.model.containers.DatasetImageLink]; SQL [insert into datasetimagelink (child, creation_id, external_id, group_id, owner_id, permissions, update_id, parent, version, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [datasetimagelink_pkey]; nested exception is org.hibernate.exception.ConstraintViolationException: could not insert: [ome.model.containers.DatasetImageLink]"
        at ome.formats.OMEROMetadataStoreClient.saveToDB(OMEROMetadataStoreClient.java:2163)
        at ome.formats.importer.ImportLibrary.importMetadata(ImportLibrary.java:293)
        at ome.formats.importer.ImportLibrary.importImage(ImportLibrary.java:452)
        at ome.formats.importer.ImportLibrary.importCandidates(ImportLibrary.java:226)
        at ome.formats.importer.cli.CommandLineImporter.start(CommandLineImporter.java:141)
        at ome.formats.importer.cli.CommandLineImporter.main(CommandLineImporter.java:395)
Caused by: omero.ValidationException
    serverStackTrace = "ome.conditions.ValidationException: could not insert: [ome.model.containers.DatasetImageLink]; SQL [insert into datasetimagelink (child, creation_id, external_id, group_id, owner_id, permissions, update_id, parent, version, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [datasetimagelink_pkey]; nested exception is org.hibernate.exception.ConstraintViolationException: could not insert: [ome.model.containers.DatasetImageLink]
                                at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:637)
                                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: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:231)
                                at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
                                at ome.services.util.ServiceHandler.invoke(ServiceHandler.java:116)
                                at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
                                at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
                                at $Proxy64.doWork(Unknown Source)
                                at ome.services.util.Executor$Impl.execute(Executor.java:371)
                                at ome.services.throttling.Adapter.run(Adapter.java:51)
                                at ome.services.throttling.InThreadThrottlingStrategy.runnableCall(InThreadThrottlingStrategy.java:89)
                                at ome.services.blitz.impl.AbstractAmdServant.runnableCall(AbstractAmdServant.java:150)
                                at ome.services.blitz.impl.MetadataStoreI.saveToDB_async(MetadataStoreI.java:190)
                                at omero.api._MetadataStoreTie.saveToDB_async(_MetadataStoreTie.java:85)
                                at omero.api._MetadataStoreDisp.___saveToDB(_MetadataStoreDisp.java:218)
                                at omero.api._MetadataStoreDisp.__dispatch(_MetadataStoreDisp.java:366)
                                at IceInternal.Incoming.invoke(Incoming.java:159)
                                at Ice.ConnectionI.invokeAll(ConnectionI.java:2037)
                                at Ice.ConnectionI.message(ConnectionI.java:972)
                                at IceInternal.ThreadPool.run(ThreadPool.java:577)
                                at IceInternal.ThreadPool.access$100(ThreadPool.java:12)
                                at IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:971)
                        "
    serverExceptionClass = "ome.conditions.ValidationException"
    message = "could not insert: [ome.model.containers.DatasetImageLink]; SQL [insert into datasetimagelink (child, creation_id, external_id, group_id, owner_id, permissions, update_id, parent, version, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [datasetimagelink_pkey]; nested exception is org.hibernate.exception.ConstraintViolationException: could not insert: [ome.model.containers.DatasetImageLink]"
        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:513)
        at java.lang.Class.newInstance0(Class.java:355)
        at java.lang.Class.newInstance(Class.java:308)
        at IceInternal.BasicStream$DynamicUserExceptionFactory.createAndThrow(BasicStream.java:2243)
        at IceInternal.BasicStream.throwException(BasicStream.java:1632)
        at IceInternal.Outgoing.throwUserException(Outgoing.java:442)
        at omero.api._MetadataStoreDelM.saveToDB(_MetadataStoreDelM.java:162)
        at omero.api.MetadataStorePrxHelper.saveToDB(MetadataStorePrxHelper.java:254)
        at omero.api.MetadataStorePrxHelper.saveToDB(MetadataStorePrxHelper.java:226)
        at ome.formats.OMEROMetadataStoreClient.saveToDB(OMEROMetadataStoreClient.java:2148)
        ... 5 more

java.lang.RuntimeException: omero.ValidationException
    serverStackTrace = "ome.conditions.ValidationException: could not insert: [ome.model.containers.DatasetImageLink]; SQL [insert into datasetimagelink (child, creation_id, external_id, group_id, owner_id, permissions, update_id, parent, version, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [datasetimagelink_pkey]; nested exception is org.hibernate.exception.ConstraintViolationException: could not insert: [ome.model.containers.DatasetImageLink]
                                at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:637)
                                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: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:231)
                                at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
                                at ome.services.util.ServiceHandler.invoke(ServiceHandler.java:116)
                                at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
                                at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
                                at $Proxy64.doWork(Unknown Source)
                                at ome.services.util.Executor$Impl.execute(Executor.java:371)
                                at ome.services.throttling.Adapter.run(Adapter.java:51)
                                at ome.services.throttling.InThreadThrottlingStrategy.runnableCall(InThreadThrottlingStrategy.java:89)
                                at ome.services.blitz.impl.AbstractAmdServant.runnableCall(AbstractAmdServant.java:150)
                                at ome.services.blitz.impl.MetadataStoreI.saveToDB_async(MetadataStoreI.java:190)
                                at omero.api._MetadataStoreTie.saveToDB_async(_MetadataStoreTie.java:85)
                                at omero.api._MetadataStoreDisp.___saveToDB(_MetadataStoreDisp.java:218)
                                at omero.api._MetadataStoreDisp.__dispatch(_MetadataStoreDisp.java:366)
                                at IceInternal.Incoming.invoke(Incoming.java:159)
                                at Ice.ConnectionI.invokeAll(ConnectionI.java:2037)
                                at Ice.ConnectionI.message(ConnectionI.java:972)
                                at IceInternal.ThreadPool.run(ThreadPool.java:577)
                                at IceInternal.ThreadPool.access$100(ThreadPool.java:12)
                                at IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:971)
                        "
    serverExceptionClass = "ome.conditions.ValidationException"
    message = "could not insert: [ome.model.containers.DatasetImageLink]; SQL [insert into datasetimagelink (child, creation_id, external_id, group_id, owner_id, permissions, update_id, parent, version, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [datasetimagelink_pkey]; nested exception is org.hibernate.exception.ConstraintViolationException: could not insert: [ome.model.containers.DatasetImageLink]"
        at ome.formats.OMEROMetadataStoreClient.saveToDB(OMEROMetadataStoreClient.java:2163)
        at ome.formats.importer.ImportLibrary.importMetadata(ImportLibrary.java:293)
        at ome.formats.importer.ImportLibrary.importImage(ImportLibrary.java:452)
        at ome.formats.importer.ImportLibrary.importCandidates(ImportLibrary.java:226)
        at ome.formats.importer.cli.CommandLineImporter.start(CommandLineImporter.java:141)
        at ome.formats.importer.cli.CommandLineImporter.main(CommandLineImporter.java:395)
Caused by: omero.ValidationException
    serverStackTrace = "ome.conditions.ValidationException: could not insert: [ome.model.containers.DatasetImageLink]; SQL [insert into datasetimagelink (child, creation_id, external_id, group_id, owner_id, permissions, update_id, parent, version, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [datasetimagelink_pkey]; nested exception is org.hibernate.exception.ConstraintViolationException: could not insert: [ome.model.containers.DatasetImageLink]
                                at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:637)
                                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: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:231)
                                at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
                                at ome.services.util.ServiceHandler.invoke(ServiceHandler.java:116)
                                at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
                                at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
                                at $Proxy64.doWork(Unknown Source)
                                at ome.services.util.Executor$Impl.execute(Executor.java:371)
                                at ome.services.throttling.Adapter.run(Adapter.java:51)
                                at ome.services.throttling.InThreadThrottlingStrategy.runnableCall(InThreadThrottlingStrategy.java:89)
                                at ome.services.blitz.impl.AbstractAmdServant.runnableCall(AbstractAmdServant.java:150)
                                at ome.services.blitz.impl.MetadataStoreI.saveToDB_async(MetadataStoreI.java:190)
                                at omero.api._MetadataStoreTie.saveToDB_async(_MetadataStoreTie.java:85)
                                at omero.api._MetadataStoreDisp.___saveToDB(_MetadataStoreDisp.java:218)
                                at omero.api._MetadataStoreDisp.__dispatch(_MetadataStoreDisp.java:366)
                                at IceInternal.Incoming.invoke(Incoming.java:159)
                                at Ice.ConnectionI.invokeAll(ConnectionI.java:2037)
                                at Ice.ConnectionI.message(ConnectionI.java:972)
                                at IceInternal.ThreadPool.run(ThreadPool.java:577)
                                at IceInternal.ThreadPool.access$100(ThreadPool.java:12)
                                at IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:971)
                        "
    serverExceptionClass = "ome.conditions.ValidationException"
    message = "could not insert: [ome.model.containers.DatasetImageLink]; SQL [insert into datasetimagelink (child, creation_id, external_id, group_id, owner_id, permissions, update_id, parent, version, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [datasetimagelink_pkey]; nested exception is org.hibernate.exception.ConstraintViolationException: could not insert: [ome.model.containers.DatasetImageLink]"
        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:513)
        at java.lang.Class.newInstance0(Class.java:355)
        at java.lang.Class.newInstance(Class.java:308)
        at IceInternal.BasicStream$DynamicUserExceptionFactory.createAndThrow(BasicStream.java:2243)
        at IceInternal.BasicStream.throwException(BasicStream.java:1632)
        at IceInternal.Outgoing.throwUserException(Outgoing.java:442)
        at omero.api._MetadataStoreDelM.saveToDB(_MetadataStoreDelM.java:162)
        at omero.api.MetadataStorePrxHelper.saveToDB(MetadataStorePrxHelper.java:254)
        at omero.api.MetadataStorePrxHelper.saveToDB(MetadataStorePrxHelper.java:226)
        at ome.formats.OMEROMetadataStoreClient.saveToDB(OMEROMetadataStoreClient.java:2148)
        ... 5 more
2011-12-07 09:31:41,213 7723       [      main] INFO         ome.formats.importer.ImportLibrary  - Exiting on error


Manz
 
Posts: 72
Joined: Wed Jun 29, 2011 11:48 pm

Re: bug in changeActiveGroup

Postby Manz » Wed Dec 07, 2011 4:09 am

Oh I love you guys right now!! For anyone else having problems, I worked out that if I included

@

Reset=conn._resetOmeroClient
@

That the error went away and it would work every time without fail. Thank you so much for your help!
Manz
 
Posts: 72
Joined: Wed Jun 29, 2011 11:48 pm


Return to Developer Discussion

Who is online

Users browsing this forum: No registered users and 0 guests