Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Bug #1027 (closed)

Opened 16 years ago

Closed 16 years ago

Mapping exception ::Ice::UnknownException = java.lang.ClassCastException: java.util.ArrayList

Reported by: atarkowska Owned by: jamoore
Priority: minor Cc:
Sprint: n.a.
Total Remaining Time: n.a.

Description

LdapUtil?

public static List<Map<String, Object>> lookupLdapAuthExperimenters(SimpleJdbcOperations jdbc) {
	return jdbc.queryForList("select dn, experimenter_id from password where dn is not null ");
	}

IAdmin:

    @Transactional(readOnly = true)
    @RolesAllowed("user")
    public List<Map<String, Object>> lookupLdapAuthExperimenters() {
        return LdapUtil.lookupLdapAuthExperimenters(jdbc);
    }

API.ice

idempotent RList lookupLdapAuthExperimenters() throws ServerError;

When I call

c = omero.client(['--Ice.Config='+ICE_CONFIG])
sf = c.createSession("root", "ome")
uuid = sf.getAdminService().getEventContext().sessionUuid
print uuid
try:
    print sf.getAdminService().lookupLdapAuthExperimenters()
except Exception ,x:
    print traceback.format_exc()
c.closeSession()

server console gives:

9138118    [l.Server-6] INFO    ome.services.blitz.impl.ServiceFactoryI  - Created servant:e9e1eb39-5b40-4d97-9df3-85894383a350/omero.api.IAdmin(omero.api._IAdminTie@14806471)
9138119    [l.Server-1] INFO           ome.services.util.ServiceHandler  -  Meth:       getEventContext
9138119    [l.Server-1] INFO           ome.services.util.ServiceHandler  -  Args:       ()
9138127    [l.Server-1] INFO            ome.security.basic.EventHandler  -   Auth:      user=0,group=0,event=18238(User)
9138129    [l.Server-1] INFO           ome.services.util.ServiceHandler  -  Rslt:       ome.system.SimpleEventContext@9b293
9138129    [l.Server-1] DEBUG  eptor.JamonPerformanceMonitorInterceptor  - JAMon performance statistics for method [ome.api.IAdmin.getEventContext]:
JAMon Label=ome.api.IAdmin.getEventContext, Units=ms.: (LastValue=10.0, Hits=32.0, Avg=40.4375, Total=1294.0, Min=10.0, Max=736.0, Active=0.0, Avg Active=1.0, Max Active=1.0, First Access=Mon Jun 09 08:43:23 BST 2008, Last Access=Mon Jun 09 11:10:44 BST 2008)
9138133    [l.Server-4] INFO    ome.services.blitz.impl.ServiceFactoryI  - Created servant:e9e1eb39-5b40-4d97-9df3-85894383a350/omero.api.IAdmin(omero.api._IAdminTie@14806471)
9138135    [l.Server-4] INFO           ome.services.util.ServiceHandler  -  Meth:       lookupLdapAuthExperimenters
9138135    [l.Server-4] INFO           ome.services.util.ServiceHandler  -  Args:       ()
9138136    [l.Server-4] INFO            ome.security.basic.EventHandler  -   Auth:      user=0,group=0,event=null(User)
9138137    [l.Server-4] INFO           ome.services.util.ServiceHandler  -  Rslt:       []
9138137    [l.Server-4] DEBUG  eptor.JamonPerformanceMonitorInterceptor  - JAMon performance statistics for method [ome.api.IAdmin.lookupLdapAuthExperimenters]:
JAMon Label=ome.api.IAdmin.lookupLdapAuthExperimenters, Units=ms.: (LastValue=2.0, Hits=95.0, Avg=4.336842105263158, Total=412.0, Min=1.0, Max=69.0, Active=0.0, Avg Active=1.0, Max Active=1.0, First Access=Mon Jun 09 09:14:17 BST 2008, Last Access=Mon Jun 09 11:10:44 BST 2008)
9138139    [l.Server-7] INFO           ome.services.util.ServiceHandler  -  Meth:       lookupLdapAuthExperimenters
9138139    [l.Server-7] INFO           ome.services.util.ServiceHandler  -  Args:       ()
9138140    [l.Server-7] INFO            ome.security.basic.EventHandler  -   Auth:      user=0,group=0,event=null(User)
9138141    [l.Server-7] INFO           ome.services.util.ServiceHandler  -  Rslt:       []
9138141    [l.Server-7] DEBUG  eptor.JamonPerformanceMonitorInterceptor  - JAMon performance statistics for method [ome.api.IAdmin.lookupLdapAuthExperimenters]:
JAMon Label=ome.api.IAdmin.lookupLdapAuthExperimenters, Units=ms.: (LastValue=2.0, Hits=96.0, Avg=4.3125, Total=414.0, Min=1.0, Max=69.0, Active=0.0, Avg Active=1.0, Max Active=1.0, First Access=Mon Jun 09 09:14:17 BST 2008, Last Access=Mon Jun 09 11:10:44 BST 2008)
9138164    [l.Server-5] INFO    ome.services.blitz.impl.ServiceFactoryI  - Closing ome.services.blitz.impl.ServiceFactoryI@f6a701 session
9138164    [l.Server-5] INFO    ome.services.blitz.impl.ServiceFactoryI  - Unregistered servant:e9e1eb39-5b40-4d97-9df3-85894383a350/omero.api.IAdmin(omero.api._IAdminTie@14806471)
9138165    [l.Server-5] INFO           ome.services.util.ServiceHandler  -  Meth:       doWork
9138165    [l.Server-5] INFO           ome.services.util.ServiceHandler  -  Args:       [null, null, ome.tools.spring.InternalServiceFactory@4e4cca]
9138178    [l.Server-5] INFO            ome.security.basic.EventHandler  -   Auth:      user=0,group=0,event=18239(Sessions)
9138179    [l.Server-5] INFO           ome.services.util.ServiceHandler  -  Rslt:       ome.model.meta.ExperimenterGroup:Id_0
9138179    [l.Server-5] DEBUG  eptor.JamonPerformanceMonitorInterceptor  - JAMon performance statistics for method [ome.services.util.Executor$Work.doWork]:
JAMon Label=ome.services.util.Executor$Work.doWork, Units=ms.: (LastValue=14.0, Hits=428.0, Avg=57.58177570093458, Total=24645.0, Min=10.0, Max=1494.0, Active=0.0, Avg Active=1.0023364485981308, Max Active=2.0, First Access=Mon Jun 09 08:39:01 BST 2008, Last Access=Mon Jun 09 11:10:44 BST 2008)

but python console gives:

Traceback (most recent call last):
  File "/Users/Ola/P2EP/omeroweb/webadmin/engine/test1.py", line 17, in <module>
    print sf.getAdminService().lookupLdapAuthExperimenters()
  File "/Users/Ola/J2EP/OMERO/dist/lib/omero_API_ice.py", line 265, in lookupLdapAuthExperimenters
    return _M_omero.api.IAdmin._op_lookupLdapAuthExperimenters.invoke(self, (), _ctx)
UnknownException: exception ::Ice::UnknownException
{
    unknown = java.lang.ClassCastException: java.util.ArrayList
	at $Proxy74.lookupLdapAuthExperimenters(Unknown Source)
	at omero.api._IAdminTie.lookupLdapAuthExperimenters(_IAdminTie.java:232)
	at omero.api._IAdminDisp.___lookupLdapAuthExperimenters(_IAdminDisp.java:530)
	at omero.api._IAdminDisp.__dispatch(_IAdminDisp.java:1215)
	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)

}

Change History (2)

comment:1 Changed 16 years ago by jmoore

  • Status changed from new to assigned
  • Type changed from User Story to defect

comment:2 Changed 16 years ago by jmoore

  • Resolution set to fixed
  • Status changed from assigned to closed

r2762 - The throttling code used for #1036 was also useful here. Ola, can you please check if this now is functional and re-open as necessary? (I've added a minimal test under tickets2000.py).

In general, though, I think the return value you be Map<String, Object> rather than the JDBC List<Map<String, Object>>

Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.66907 sec.)

We're Hiring!