[ome-users] QueryService
josh.moore at gmx.de
josh.moore at gmx.de
Mon Nov 9 08:51:16 GMT 2009
Hi Mark,
would you mind sending your server log in which the exception gets
thrown? I'm not sure where the "o_id" parameter would be coming from.
Testing briefly I see:
josh at mac:~/code/omero.git/dist$ java -cp lib/client/omero_client.jar:. mark
102
josh at mac:~/code/omero.git/dist$ cat mark.java
import omero.sys.*;
import omero.model.*;
import omero.api.*;
public class mark {
public static void main(String[] args) throws Exception {
omero.client c = new omero.client("localhost");
ServiceFactoryPrx sf = c.createSession("root","ome");
IQueryPrx iQuery = sf.getQueryService();
IObject image = sf.getQueryService().findByQuery(
"select i from Image i join fetch i.pixels where i.id = :id",
new ParametersI().add("id", omero.rtypes.rlong(401)));
System.out.println(image.getDetails().getOwner().getId().getValue());
}
}
but you're right, that the error should definitely not be happening,
so it would be good to track it down.
Cheers,
~J.
Woodbridge, Mark R writes:
> Well, yes. The actual code I'm running is:
>
> IObject image = factory.getQueryService().findByQuery("select i
> from Image i join fetch i.pixels where i.id = :id", new
> ParametersI().add("id", rlong(id)));
>
> The problem is that it won't in a session owned by root (it returns
> the aforementioned error). It works fine in a session owned by the
> owner of the image, but this means sudo-ing. Just wondered why I
> can't do it as the super user...
>
> -----Original Message-----
> From: Chris Allan [mailto:callan at lifesci.dundee.ac.uk]
> Sent: 06 November 2009 14:25
> To: Woodbridge, Mark R
> Cc: ome-users at lists.openmicroscopy.org.uk
> Subject: Re: [ome-users] QueryService
>
> Something that looks like this:
>
> Parameters p = new Parameters();
> p.setId(1L)
> List<Image = iQuery.findAllByQuery(select i from Image i join fetch
> i.pixels where i.id = :id);
>
> ??
>
> -Chris
> On 6 Nov 2009, at 14:02, Woodbridge, Mark R wrote:
>
> > Hi,
> >
> > I'm using the client API from Java to run the query:
> >
> > select i from Image i join fetch i.pixels where i.id = :id
> >
> > I'm doing this in order to get pixels IDs to pass to the thumbnail
> > service. When I run it as the OMERO super user I get the message:
> >
> > "Null parameters not allowed: o_id"
> >
> > I assumed that image Ids would be unique, but it looks like a need
> > to pass the ID of the owner, as well as the image ID. Is this
> > correct? Perhaps I have misunderstood...
> >
> > Mark.
More information about the ome-users
mailing list