Page 1 of 1

OmeroJava examples: errors

PostPosted: Tue Dec 20, 2011 4:14 pm
by dasesan
Hi everyone,

I intend to implement a client in java and turned to the examples at: http://trac.openmicroscopy.org.uk/ome/wiki/OmeroJava to get started.

I seem to connect to the server but cannot read any data as I am getting the following error:

Code: Select all
Exception in thread "main" java.lang.NoClassDefFoundError: Connect (wrong name: ome/client/Connect)
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
   at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: Connect. Program will exit.


I think my Java environment is Ok and the classpath properly set. I do miss some documentation about the necessary "imports" to run the OmeroJava examples. I used the following "imports", but maybe I'm missing something?

Code: Select all
package ome.client;

import ome.system.*;
import omero.api.*;
import omero.model.*;
import omero.sys.*;
import java.util.*;
import omero.*;


Thanks a lot in advance for any help!

Re: OmeroJava examples: errors

PostPosted: Tue Dec 20, 2011 5:29 pm
by jburel
Good evening

Just to be sure you have all the code.
Have a look at
http://github.com/openmicroscopy/openmi ... c/training

You will in that folder all the classes and examples described at
http://trac.openmicroscopy.org.uk/ome/wiki/OmeroJava

The same examples are also available in Python and Matlab.

Regards
Jmarie

Re: OmeroJava examples: errors

PostPosted: Thu Dec 22, 2011 11:32 am
by dasesan
Hi Jmarie,

Thanks a lot for the link!

I am now running the training code and it definitely works. It seems that, after all, there was also something going on with the java configuration.

Cheers.