[ome-devel] Developing a Java Client

Josh Moore josh.moore at gmx.de
Wed Oct 20 16:43:02 BST 2010


On Oct 20, 2010, at 5:05 PM, Galli Vanni wrote:
> Dear All,

Hi Vanni,

> I'm currently trying to develop an example of an OMERO Java client. I would like simply to connect to an OMERO server and view some data.
> 
> As starting point I have downloaded the OMERO source using svn and, if I have currently understood, I have:
> - some examples in the server source 
> - the jar files in the client source (in particular the omero_client.jar)
> 
> I was able to compile and run the unloaded.java example (which simply creates some objects and make some asserts), but I'm not able to run, for example, the sudo.java example:
> 
> Exception in thread "main" Ice.EndpointParseException
>    str = "ssl -p 4064 -h <"omero.host" not set>"
> 
> Is this related to the argument passed from command line? I tried to investigate how to pass the arguments, but I'm always getting the same error.

All of the examples are run by Hudson using the SConstruct build file. Scons sets the environment variable ICE_CONFIG pointing to a simple configuration file like the one under etc/ice.config, which explains configuration in depth. This would also work in your case.

To put it briefly, you can get sudo.java to work by doing any of the following:
 * java sudo --Ice.Config=your_ice.config
 * ICE_CONFIG=your_ice.config java sudo
 * java sudo --omero.user=you --omero.pass=secret --omero.host=localhost
 * OR by hard-coding those values in the file itself:

        omero.client client = new omero.client("localhost");
        omero.client sudoClient = new omero.client("localhost");
        try {
            ServiceFactoryPrx sf = client.createSession("root", "ome");
            ...


> Is there an example showing a simple connection to an OMERO server (using username and password) which can be used with the jar files?

Try looking at http://trac.openmicroscopy.org.uk/omero/browser/trunk/examples/OmeroClients/configuration.javafor examples of each of these methods.

> Thank you!

Cheers,
~Josh.

> Best regards,
> Vanni
> 



More information about the ome-devel mailing list