2016-04-25 4 views
0

Ich versuche, Jetty Server und Servlet von Version 9.2.2 auf Version 9.3.8 zu aktualisieren, nachdem ich meine pom.xml Datei aktualisiert habe, bekomme ich einige Fehler wie ServletContextHandler und ServletHolder sind nicht gefunden !Aktualisierung von Jetty Servlet 9.2.2 bis 9.3.8

hier ist mein pom.xml

<dependency> 
      <groupId>org.eclipse.jetty</groupId> 
      <artifactId>jetty-server</artifactId> 
      <version>9.3.8.v20160314</version> 
    </dependency> 

    <dependency> 
     <groupId>org.eclipse.jetty</groupId> 
     <artifactId>jetty-servlets</artifactId> 
     <version>9.3.8.v20160314</version> 
    </dependency> 

und das ist mein JettyServer Klasse

public static void start() throws Exception 
{ 
    Server server = new Server(Configuration.getInstance().getPortServer()); 

    ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS); 
    context.setContextPath("/"); 

    ServletHolder h = new ServletHolder(new HttpServletDispatcher()); 
    h.setInitParameter("javax.ws.rs.Application", "de.jettyserver.Services"); 
    context.addServlet(h, "/*"); 

    server.setHandler(context); 

    server.start(); 
    server.join(); 

    LOGGER.debug("JettyServer started"); 
} 

und die Fehler

[ERROR] /C:/..../jettyserver/JettyServer.java:[4,33] package org.eclipse.jetty.servlet does not exist 

[ERROR]/C:/../jettyserver/JettyServer.java:[5,33] package org.eclipse.jetty.servlet does not exist 
[ERROR] /C:/../jettyserver/JettyServer.java:[27,17] cannot find symbol symbol: class ServletContextHandler location: class de.tuberlin.snet.sonic.jettyserver.JettyServer 

    [ERROR] /C:/../jettyserver/JettyServer.java:[27,53] cannot find symbol symbol: class ServletContextHandler location: class de.tuberlin.snet.sonic.jettyserver.JettyServer 
[ERROR] /C:/../jettyserver/JettyServer.java:[27,75] cannot find symbol symbol: variable ServletContextHandler location: class de.tuberlin.snet.sonic.jettyserver.JettyServer 

Antwort

1

Sie einen Tippfehler in Ihre Abhängigkeit haben.

<dependency> 
    <groupId>org.eclipse.jetty</groupId> 
    <artifactId>jetty-servlet</artifactId> <!-- not plural! --> 
    <version>9.3.8.v20160314</version> 
</dependency> 
+0

vielen Dank. eigentlich kopiere ich es von der Steg-Website http://mvnrepository.com/artifect/org.eclipse.jetty/jetty-servlets/9.3.8.v20160314 – SenanSharhan

+0

das ist nicht Jetty's Website. Das Eclipse Jetty Projekt empfiehlt die Verwendung von [search.maven.org] (https://search.maven.org/) über mvnrepository.com (was sehr ungenau und irreführend ist) –

+0

oh ok! Wenn ich es google, war die erste Website mvnrepository.com. Danke für die Information – SenanSharhan

Verwandte Themen