3
나는 웹 컨테이너로 그리즐리를 사용하여 저지 튜토리얼의 첫 번째 부분을 따르려고 노력하고 있습니다. 나는 단지 에있다 "Hello World!" 부분과 내 코드를 실행하려고합니다. 이것은 배치하려는 웹 서비스의 주요 부분입니다.다음 저지 튜토리얼
public class Main {
public static void main(String [] args) throws IOException {
final String baseUri = "http://localhost:9998";
final Map<String, String > initParams = new HashMap<String, String>();
initParams.put("com.sun.jersey.config.property.packages", "com.sun.ws.rest.samples.helloworld.resources");
System.out.println("Starting grizzly");
SelectorThread threadSelector = GrizzlyWebContainerFactory.create(baseUri,initParams);
System.out.println(String.format("Jersey app started with WADL available at %sapplication.wadl Try out %shelloworld. Hit enter to stop it...", baseUri, baseUri));
System.in.read();
threadSelector.stopEndpoint();
System.exit(0);
}
}
나는이 프로그램을 실행할 때, 난 항상 얻을
Exception in thread "main" java.lang.IllegalArgumentException: The URI path, of the URI http://localhost:9998, must be present
at com.sun.jersey.api.container.grizzly.GrizzlyWebContainerFactory.create(GrizzlyWebContainerFactory.java:236)
at com.sun.jersey.api.container.grizzly.GrizzlyWebContainerFactory.create(GrizzlyWebContainerFactory.java:138)
at com.sun.jersey.api.container.grizzly.GrizzlyWebContainerFactory.create(GrizzlyWebContainerFactory.java:105)
at Main.main(Main.java:29)
사람이 무슨 일이 일어나고 있는지 알고 있나요? 내 패키지가 모두 정확한지 확인했습니다. 나는 회색을 구성하는 방법을 알고 그냥 끝에 뉴저지