Запустив учебник RESTlet, я получаю java.lang.NoClassDefFoundError - PullRequest
7 голосов
/ 11 января 2011

Я пытаюсь запустить первый серверный урок по RESTlet docs , но я получаю ошибки, даже несмотря на то, что я добавил файлы jar в мой путь к классам.Я добавил org.restlet.jar и org.restlet.ext. *

Код сервера:

package test;

import org.restlet.Server;
import org.restlet.data.Protocol;
import org.restlet.resource.Get;
import org.restlet.resource.ServerResource;

public class Test extends ServerResource {  

    public static void main(String[] args) throws Exception {  
        // Create the HTTP server and listen on port 8182  
        new Server(Protocol.HTTP, 8182, Test.class).start();  
    }  

    @Get  
    public String toString() {  
        return "hello, world";  
    }  

}

И ошибки, которые я получаю:

    11/01/2011 1:22:08 PM org.restlet.engine.Engine registerHelper
INFO: Unable to register the helper org.restlet.ext.httpclient.HttpClientHelper
java.lang.NoClassDefFoundError: org/apache/http/conn/scheme/SocketFactory
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    at java.lang.Class.getConstructor0(Class.java:2699)
    at java.lang.Class.getConstructor(Class.java:1657)
    at org.restlet.engine.Engine.registerHelper(Engine.java:716)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:749)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:789)
    at org.restlet.engine.Engine.discoverConnectors(Engine.java:488)
    at org.restlet.engine.Engine.<init>(Engine.java:333)
    at org.restlet.engine.Engine.register(Engine.java:248)
    at org.restlet.engine.Engine.register(Engine.java:237)
    at org.restlet.engine.Engine.getInstance(Engine.java:149)
    at org.restlet.Restlet.<init>(Restlet.java:99)
    at org.restlet.resource.Finder.<init>(Finder.java:147)
    at org.restlet.Server.<init>(Server.java:313)
    at test.Test.main(Test.java:12)
Caused by: java.lang.ClassNotFoundException: org.apache.http.conn.scheme.SocketFactory
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    ... 16 more
11/01/2011 1:22:08 PM org.restlet.engine.Engine registerHelper
INFO: Unable to register the helper org.restlet.ext.javamail.JavaMailClientHelper
java.lang.NoClassDefFoundError: javax/mail/MessagingException
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    at java.lang.Class.getConstructor0(Class.java:2699)
    at java.lang.Class.getConstructor(Class.java:1657)
    at org.restlet.engine.Engine.registerHelper(Engine.java:716)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:749)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:789)
    at org.restlet.engine.Engine.discoverConnectors(Engine.java:488)
    at org.restlet.engine.Engine.<init>(Engine.java:333)
    at org.restlet.engine.Engine.register(Engine.java:248)
    at org.restlet.engine.Engine.register(Engine.java:237)
    at org.restlet.engine.Engine.getInstance(Engine.java:149)
    at org.restlet.Restlet.<init>(Restlet.java:99)
    at org.restlet.resource.Finder.<init>(Finder.java:147)
    at org.restlet.Server.<init>(Server.java:313)
    at test.Test.main(Test.java:12)
Caused by: java.lang.ClassNotFoundException: javax.mail.MessagingException
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    ... 16 more
11/01/2011 1:22:08 PM org.restlet.engine.Engine registerHelper
INFO: Unable to register the helper org.restlet.ext.jdbc.JdbcClientHelper
java.lang.NoClassDefFoundError: org/apache/commons/dbcp/ConnectionFactory
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    at java.lang.Class.getConstructor0(Class.java:2699)
    at java.lang.Class.getConstructor(Class.java:1657)
    at org.restlet.engine.Engine.registerHelper(Engine.java:716)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:749)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:789)
    at org.restlet.engine.Engine.discoverConnectors(Engine.java:488)
    at org.restlet.engine.Engine.<init>(Engine.java:333)
    at org.restlet.engine.Engine.register(Engine.java:248)
    at org.restlet.engine.Engine.register(Engine.java:237)
    at org.restlet.engine.Engine.getInstance(Engine.java:149)
    at org.restlet.Restlet.<init>(Restlet.java:99)
    at org.restlet.resource.Finder.<init>(Finder.java:147)
    at org.restlet.Server.<init>(Server.java:313)
    at test.Test.main(Test.java:12)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.dbcp.ConnectionFactory
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    ... 16 more
11/01/2011 1:22:08 PM org.restlet.engine.Engine registerHelper
INFO: Unable to register the helper org.restlet.ext.lucene.SolrClientHelper
java.lang.NoClassDefFoundError: org/apache/solr/request/SolrRequestHandler
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    at java.lang.Class.getConstructor0(Class.java:2699)
    at java.lang.Class.getConstructor(Class.java:1657)
    at org.restlet.engine.Engine.registerHelper(Engine.java:716)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:749)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:789)
    at org.restlet.engine.Engine.discoverConnectors(Engine.java:488)
    at org.restlet.engine.Engine.<init>(Engine.java:333)
    at org.restlet.engine.Engine.register(Engine.java:248)
    at org.restlet.engine.Engine.register(Engine.java:237)
    at org.restlet.engine.Engine.getInstance(Engine.java:149)
    at org.restlet.Restlet.<init>(Restlet.java:99)
    at org.restlet.resource.Finder.<init>(Finder.java:147)
    at org.restlet.Server.<init>(Server.java:313)
    at test.Test.main(Test.java:12)
Caused by: java.lang.ClassNotFoundException: org.apache.solr.request.SolrRequestHandler
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    ... 16 more
11/01/2011 1:22:08 PM org.restlet.engine.Engine registerHelper
INFO: Unable to register the helper org.restlet.ext.grizzly.HttpServerHelper
java.lang.NoClassDefFoundError: com/sun/grizzly/SelectorHandler
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    at java.lang.Class.getConstructor0(Class.java:2699)
    at java.lang.Class.getConstructor(Class.java:1657)
    at org.restlet.engine.Engine.registerHelper(Engine.java:716)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:749)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:789)
    at org.restlet.engine.Engine.discoverConnectors(Engine.java:490)
    at org.restlet.engine.Engine.<init>(Engine.java:333)
    at org.restlet.engine.Engine.register(Engine.java:248)
    at org.restlet.engine.Engine.register(Engine.java:237)
    at org.restlet.engine.Engine.getInstance(Engine.java:149)
    at org.restlet.Restlet.<init>(Restlet.java:99)
    at org.restlet.resource.Finder.<init>(Finder.java:147)
    at org.restlet.Server.<init>(Server.java:313)
    at test.Test.main(Test.java:12)
Caused by: java.lang.ClassNotFoundException: com.sun.grizzly.SelectorHandler
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    ... 16 more
11/01/2011 1:22:08 PM org.restlet.engine.Engine registerHelper
INFO: Unable to register the helper org.restlet.ext.grizzly.HttpsServerHelper
java.lang.NoClassDefFoundError: com/sun/grizzly/SelectorHandler
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    at java.lang.Class.getConstructor0(Class.java:2699)
    at java.lang.Class.getConstructor(Class.java:1657)
    at org.restlet.engine.Engine.registerHelper(Engine.java:716)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:749)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:789)
    at org.restlet.engine.Engine.discoverConnectors(Engine.java:490)
    at org.restlet.engine.Engine.<init>(Engine.java:333)
    at org.restlet.engine.Engine.register(Engine.java:248)
    at org.restlet.engine.Engine.register(Engine.java:237)
    at org.restlet.engine.Engine.getInstance(Engine.java:149)
    at org.restlet.Restlet.<init>(Restlet.java:99)
    at org.restlet.resource.Finder.<init>(Finder.java:147)
    at org.restlet.Server.<init>(Server.java:313)
    at test.Test.main(Test.java:12)
Caused by: java.lang.ClassNotFoundException: com.sun.grizzly.SelectorHandler
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    ... 16 more
11/01/2011 1:22:08 PM org.restlet.engine.Engine registerHelper
INFO: Unable to register the helper org.restlet.ext.jetty.AjpServerHelper
java.lang.NoClassDefFoundError: org/eclipse/jetty/server/Connector
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    at java.lang.Class.getConstructor0(Class.java:2699)
    at java.lang.Class.getConstructor(Class.java:1657)
    at org.restlet.engine.Engine.registerHelper(Engine.java:716)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:749)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:789)
    at org.restlet.engine.Engine.discoverConnectors(Engine.java:490)
    at org.restlet.engine.Engine.<init>(Engine.java:333)
    at org.restlet.engine.Engine.register(Engine.java:248)
    at org.restlet.engine.Engine.register(Engine.java:237)
    at org.restlet.engine.Engine.getInstance(Engine.java:149)
    at org.restlet.Restlet.<init>(Restlet.java:99)
    at org.restlet.resource.Finder.<init>(Finder.java:147)
    at org.restlet.Server.<init>(Server.java:313)
    at test.Test.main(Test.java:12)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.Connector
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    ... 16 more
11/01/2011 1:22:08 PM org.restlet.engine.Engine registerHelper
INFO: Unable to register the helper org.restlet.ext.jetty.HttpServerHelper
java.lang.NoClassDefFoundError: org/eclipse/jetty/server/Connector
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    at java.lang.Class.getConstructor0(Class.java:2699)
    at java.lang.Class.getConstructor(Class.java:1657)
    at org.restlet.engine.Engine.registerHelper(Engine.java:716)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:749)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:789)
    at org.restlet.engine.Engine.discoverConnectors(Engine.java:490)
    at org.restlet.engine.Engine.<init>(Engine.java:333)
    at org.restlet.engine.Engine.register(Engine.java:248)
    at org.restlet.engine.Engine.register(Engine.java:237)
    at org.restlet.engine.Engine.getInstance(Engine.java:149)
    at org.restlet.Restlet.<init>(Restlet.java:99)
    at org.restlet.resource.Finder.<init>(Finder.java:147)
    at org.restlet.Server.<init>(Server.java:313)
    at test.Test.main(Test.java:12)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.Connector
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    ... 16 more
11/01/2011 1:22:08 PM org.restlet.engine.Engine registerHelper
INFO: Unable to register the helper org.restlet.ext.jetty.HttpsServerHelper
java.lang.NoClassDefFoundError: org/eclipse/jetty/server/Connector
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    at java.lang.Class.getConstructor0(Class.java:2699)
    at java.lang.Class.getConstructor(Class.java:1657)
    at org.restlet.engine.Engine.registerHelper(Engine.java:716)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:749)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:789)
    at org.restlet.engine.Engine.discoverConnectors(Engine.java:490)
    at org.restlet.engine.Engine.<init>(Engine.java:333)
    at org.restlet.engine.Engine.register(Engine.java:248)
    at org.restlet.engine.Engine.register(Engine.java:237)
    at org.restlet.engine.Engine.getInstance(Engine.java:149)
    at org.restlet.Restlet.<init>(Restlet.java:99)
    at org.restlet.resource.Finder.<init>(Finder.java:147)
    at org.restlet.Server.<init>(Server.java:313)
    at test.Test.main(Test.java:12)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.Connector
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    ... 16 more
11/01/2011 1:22:08 PM org.restlet.engine.Engine registerHelper
INFO: Unable to register the helper org.restlet.ext.netty.HttpServerHelper
java.lang.NoClassDefFoundError: org/jboss/netty/channel/group/ChannelGroup
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    at java.lang.Class.getConstructor0(Class.java:2699)
    at java.lang.Class.getConstructor(Class.java:1657)
    at org.restlet.engine.Engine.registerHelper(Engine.java:716)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:749)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:789)
    at org.restlet.engine.Engine.discoverConnectors(Engine.java:490)
    at org.restlet.engine.Engine.<init>(Engine.java:333)
    at org.restlet.engine.Engine.register(Engine.java:248)
    at org.restlet.engine.Engine.register(Engine.java:237)
    at org.restlet.engine.Engine.getInstance(Engine.java:149)
    at org.restlet.Restlet.<init>(Restlet.java:99)
    at org.restlet.resource.Finder.<init>(Finder.java:147)
    at org.restlet.Server.<init>(Server.java:313)
    at test.Test.main(Test.java:12)
Caused by: java.lang.ClassNotFoundException: org.jboss.netty.channel.group.ChannelGroup
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    ... 16 more
11/01/2011 1:22:08 PM org.restlet.engine.Engine registerHelper
INFO: Unable to register the helper org.restlet.ext.netty.HttpsServerHelper
java.lang.NoClassDefFoundError: org/jboss/netty/channel/group/ChannelGroup
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    at java.lang.Class.getConstructor0(Class.java:2699)
    at java.lang.Class.getConstructor(Class.java:1657)
    at org.restlet.engine.Engine.registerHelper(Engine.java:716)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:749)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:789)
    at org.restlet.engine.Engine.discoverConnectors(Engine.java:490)
    at org.restlet.engine.Engine.<init>(Engine.java:333)
    at org.restlet.engine.Engine.register(Engine.java:248)
    at org.restlet.engine.Engine.register(Engine.java:237)
    at org.restlet.engine.Engine.getInstance(Engine.java:149)
    at org.restlet.Restlet.<init>(Restlet.java:99)
    at org.restlet.resource.Finder.<init>(Finder.java:147)
    at org.restlet.Server.<init>(Server.java:313)
    at test.Test.main(Test.java:12)
Caused by: java.lang.ClassNotFoundException: org.jboss.netty.channel.group.ChannelGroup
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    ... 16 more
11/01/2011 1:22:08 PM org.restlet.engine.Engine registerHelper
INFO: Unable to register the helper org.restlet.ext.simple.HttpServerHelper
java.lang.NoClassDefFoundError: org/simpleframework/http/core/Container
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    at java.lang.Class.getConstructor0(Class.java:2699)
    at java.lang.Class.getConstructor(Class.java:1657)
    at org.restlet.engine.Engine.registerHelper(Engine.java:716)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:749)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:789)
    at org.restlet.engine.Engine.discoverConnectors(Engine.java:490)
    at org.restlet.engine.Engine.<init>(Engine.java:333)
    at org.restlet.engine.Engine.register(Engine.java:248)
    at org.restlet.engine.Engine.register(Engine.java:237)
    at org.restlet.engine.Engine.getInstance(Engine.java:149)
    at org.restlet.Restlet.<init>(Restlet.java:99)
    at org.restlet.resource.Finder.<init>(Finder.java:147)
    at org.restlet.Server.<init>(Server.java:313)
    at test.Test.main(Test.java:12)
Caused by: java.lang.ClassNotFoundException: org.simpleframework.http.core.Container
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    ... 16 more
11/01/2011 1:22:08 PM org.restlet.engine.Engine registerHelper
INFO: Unable to register the helper org.restlet.ext.simple.HttpsServerHelper
java.lang.NoClassDefFoundError: org/simpleframework/http/core/Container
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    at java.lang.Class.getConstructor0(Class.java:2699)
    at java.lang.Class.getConstructor(Class.java:1657)
    at org.restlet.engine.Engine.registerHelper(Engine.java:716)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:749)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:789)
    at org.restlet.engine.Engine.discoverConnectors(Engine.java:490)
    at org.restlet.engine.Engine.<init>(Engine.java:333)
    at org.restlet.engine.Engine.register(Engine.java:248)
    at org.restlet.engine.Engine.register(Engine.java:237)
    at org.restlet.engine.Engine.getInstance(Engine.java:149)
    at org.restlet.Restlet.<init>(Restlet.java:99)
    at org.restlet.resource.Finder.<init>(Finder.java:147)
    at org.restlet.Server.<init>(Server.java:313)
    at test.Test.main(Test.java:12)
Caused by: java.lang.ClassNotFoundException: org.simpleframework.http.core.Container
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    ... 16 more
11/01/2011 1:22:08 PM org.restlet.engine.Engine registerHelper
INFO: Unable to register the helper org.restlet.ext.javamail.JavaMailConverter
java.lang.NoClassDefFoundError: javax/mail/MessagingException
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    at java.lang.Class.getConstructor0(Class.java:2699)
    at java.lang.Class.newInstance0(Class.java:326)
    at java.lang.Class.newInstance(Class.java:308)
    at org.restlet.engine.Engine.registerHelper(Engine.java:714)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:749)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:789)
    at org.restlet.engine.Engine.discoverConverters(Engine.java:501)
    at org.restlet.engine.Engine.<init>(Engine.java:337)
    at org.restlet.engine.Engine.register(Engine.java:248)
    at org.restlet.engine.Engine.register(Engine.java:237)
    at org.restlet.engine.Engine.getInstance(Engine.java:149)
    at org.restlet.Restlet.<init>(Restlet.java:99)
    at org.restlet.resource.Finder.<init>(Finder.java:147)
    at org.restlet.Server.<init>(Server.java:313)
    at test.Test.main(Test.java:12)
Caused by: java.lang.ClassNotFoundException: javax.mail.MessagingException
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    ... 17 more
11/01/2011 1:22:08 PM org.restlet.engine.Engine registerHelper
INFO: Unable to register the helper org.restlet.ext.jibx.JibxConverter
java.lang.NoClassDefFoundError: org/jibx/runtime/JiBXException
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    at java.lang.Class.getConstructor0(Class.java:2699)
    at java.lang.Class.newInstance0(Class.java:326)
    at java.lang.Class.newInstance(Class.java:308)
    at org.restlet.engine.Engine.registerHelper(Engine.java:714)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:749)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:789)
    at org.restlet.engine.Engine.discoverConverters(Engine.java:501)
    at org.restlet.engine.Engine.<init>(Engine.java:337)
    at org.restlet.engine.Engine.register(Engine.java:248)
    at org.restlet.engine.Engine.register(Engine.java:237)
    at org.restlet.engine.Engine.getInstance(Engine.java:149)
    at org.restlet.Restlet.<init>(Restlet.java:99)
    at org.restlet.resource.Finder.<init>(Finder.java:147)
    at org.restlet.Server.<init>(Server.java:313)
    at test.Test.main(Test.java:12)
Caused by: java.lang.ClassNotFoundException: org.jibx.runtime.JiBXException
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    ... 17 more
11/01/2011 1:22:08 PM org.restlet.engine.Engine registerHelper
INFO: Unable to register the helper org.restlet.ext.json.JsonConverter
java.lang.NoClassDefFoundError: org/json/JSONException
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    at java.lang.Class.getConstructor0(Class.java:2699)
    at java.lang.Class.newInstance0(Class.java:326)
    at java.lang.Class.newInstance(Class.java:308)
    at org.restlet.engine.Engine.registerHelper(Engine.java:714)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:749)
    at org.restlet.engine.Engine.registerHelpers(Engine.java:789)
    at org.restlet.engine.Engine.discoverConverters(Engine.java:501)
    at org.restlet.engine.Engine.<init>(Engine.java:337)
    at org.restlet.engine.Engine.register(Engine.java:248)
    at org.restlet.engine.Engine.register(Engine.java:237)
    at org.restlet.engine.Engine.getInstance(Engine.java:149)
    at org.restlet.Restlet.<init>(Restlet.java:99)
    at org.restlet.resource.Finder.<init>(Finder.java:147)
    at org.restlet.Server.<init>(Server.java:313)
    at test.Test.main(Test.java:12)
Caused by: java.lang.ClassNotFoundException: org.json.JSONException
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    ... 17 more
11/01/2011 1:22:08 PM org.restlet.engine.Engine createHelper
WARNING: No available server connector supports the required protocols: 'HTTP' . Please add the JAR of a matching connector to your classpath.

Чего мне не хватает?

Ответы [ 4 ]

9 голосов
/ 11 января 2011

Это была проблема Eclipse, мне пришлось удалить все банки и только добавить org.restlet.jar, а также очистить проект. После того, как я это сделал, все заработало как положено.

0 голосов
/ 02 января 2014

После запуска /selectableRestWebComponent/src/services/FirstServerResource.java в качестве веб-компонента в Eclipse. Включите только файл org.restlet.jar в библиотеку путей сборки.

Убедитесь, что вы очистили проект и можете проверить «строить автоматически» на вкладке проекта eclipse.

Убедитесь, что у вас есть сервер, работающий в фоновом режиме или подключенный к проекту eclipse, например, Apache tomcat 6.2.

На консоли должно отображаться сообщение «Запуск внутреннего сервера [HTTP / 1.1] через порт 8182» вместо всех тех ошибок, которые вы отображали в своем вопросе.

Откройте браузер и перейдите по URL-адресу http://'localserverIPaddress':8182/test/tutorial, и вы должны увидеть слова «привет, мир отображается».

0 голосов
/ 14 октября 2011

Просто чтобы обновить это, из последней папки restlet-jee-2.0.10/lib скопируйте только org.restlet.ext.servlet.jar и org.restlet.jar. Это решило проблему в Eclipse.

0 голосов
/ 16 февраля 2011

Спасибо.У меня также была такая же проблема в IDE NetBeans.Я удалил файл "org.restlet.ext.httpclient-2.1m1.jar" из lib проекта и с тех пор ошибок не было.

...