dimanche 1 mars 2015

Exception in thread "main" com.sun.jersey.api.container.ContainerException: No WebApplication provider is present

I am new to spring and trying to run an simple example from This linkwhile running CalcRESTStartUp.java which contains.



package com.theopentutorials.jaxrs.calc;
import java.io.IOException;

import com.sun.net.httpserver.HttpServer;
import com.sun.jersey.api.container.httpserver.HttpServerFactory;
public class CalcRESTStartUp {

static final String BASE_URI = "http://localhost:9999/calcrest/";
public static void main(String[] args) {
try {
HttpServer server = HttpServerFactory.create(BASE_URI);
server.start();
System.out.println("press enter");
System.in.read();
server.stop(0);
}catch(IllegalArgumentException e ){
e.printStackTrace();
}catch(IOException e){
e.printStackTrace();
}
}

}


I am getting exception Exception in thread "main" com.sun.jersey.api.container.ContainerException: No WebApplication provider is present. Exception details.



INFO: Root resource classes found:
class com.theopentutorials.jaxrs.calc.CalcREST
class org.glassfish.jersey.server.wadl.internal.WadlResource
Mar 01, 2015 2:10:43 PM com.sun.jersey.api.core.ScanningResourceConfig init
INFO: No provider classes found.
Exception in thread "main" com.sun.jersey.api.container.ContainerException: No WebApplication provider is present
at com.sun.jersey.spi.container.WebApplicationFactory.createWebApplication(WebApplicationFactory.java:69)
at com.sun.jersey.api.container.ContainerFactory.createContainer(ContainerFactory.java:160)
at com.sun.jersey.api.container.ContainerFactory.createContainer(ContainerFactory.java:264)
at com.sun.jersey.api.container.ContainerFactory.createContainer(ContainerFactory.java:246)
at com.sun.jersey.api.container.httpserver.HttpServerFactory.create(HttpServerFactory.java:117)
at com.sun.jersey.api.container.httpserver.HttpServerFactory.create(HttpServerFactory.java:92)
at com.theopentutorials.jaxrs.calc.CalcRESTStartUp.main(CalcRESTStartUp.java:11)


please help me. Thanks in advance


Aucun commentaire:

Enregistrer un commentaire