We're Hiring!

OmeroJava examples: errors

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.

OmeroJava examples: errors

Postby dasesan » Tue Dec 20, 2011 4:14 pm

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!
dasesan
 
Posts: 10
Joined: Tue Dec 20, 2011 4:03 pm

Re: OmeroJava examples: errors

Postby jburel » Tue Dec 20, 2011 5:29 pm

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
User avatar
jburel
Team Member
 
Posts: 348
Joined: Thu May 21, 2009 6:38 pm
Location: dundee

Re: OmeroJava examples: errors

Postby dasesan » Thu Dec 22, 2011 11:32 am

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.
dasesan
 
Posts: 10
Joined: Tue Dec 20, 2011 4:03 pm


Return to Developer Discussion

Who is online

Users browsing this forum: No registered users and 0 guests