tags:

views:

39

answers:

2

I use Eclipse and want to import UniProtJAPI to use in my code

I import UniProtJAPI.jar as library in Eclipse that I got out of the zip from http://www.ebi.ac.uk/uniprot/remotingAPI/ .

In my code I want to use the API the following way:

import uk.ac.ebi.kraken.uuw.services.remoting.UniProtJAPI;

System.out.println("UniProt Version = " + UniProtJAPI.factory.getVersion());

Before I added the library eclipse showed that a class was missing with a icon even before running the code.

Now Ecplise gives me the following error when I try to run my code:

Caused by: java.lang.ClassNotFoundException: org.springframework.core.io.Resource
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:303)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)

What's wrong?

+1  A: 

You must have spring on your classpath

Bozho
+2  A: 

The UniProtJAPI has dependencies that you need to provide too, spring-core.jar is one of them. Actually, all dependencies are provided in the lib directory of the uniprotjapi.zip distribution:

lib/
|-- aopalliance.jar
|-- commons-codec.jar
|-- commons-httpclient.jar
|-- commons-logging.jar
|-- log4j.jar
|-- spring-aop.jar
|-- spring-beans.jar
|-- spring-core.jar
|-- spring-remoting.jar
`-- uniprotjapi.jar

Unzip uniprotjapi.zip somewhere and to add all jars of the lib directory to your eclipse project.

Pascal Thivent