unable to find com.sun.grizzly.tcp.http11.GrizzlyAdapter.setResourcesContextPath(String)
I trying to expose some groovy service with jersey and girzzly. but i got a wierd error when i'm launching my servlet container. Here is the snippet w开发者_如何学Pythonhich lauch it:
ServletAdapter adapter = new ServletAdapter();
Injector injector = Guice.createInjector(new GmediaModule());
GuiceContainer container = new GuiceContainer(injector);
adapter.setServletInstance(container);
adapter.setContextPath("gmedia")
adapter.addInitParameter("com.sun.jersey.config.property.packages",
"gmedia.api.music.resources");
threadSelector = GrizzlyServerFactory.create(BASE_URI, adapter);
Here is the error:
java.lang.NoSuchMethodError: com.sun.grizzly.tcp.http11.GrizzlyAdapter.setResourcesContextPath(Ljava/lang/String;)V
The error occurs at the grizzlyServeletFactory.create. I'm wordering why this error occurs since this metod exist on this oject?
sorry i was an idiot. Here is what i'm using now GrizzlyWebServer ws = new GrizzlyWebServer(9999);
ServletAdapter adapter = new ServletAdapter();
Injector injector = Guice.createInjector(new GmediaModule());
GuiceContainer container = new GuiceContainer(injector);
adapter.setServletInstance(container);
adapter.addInitParameter("com.sun.jersey.config.property.packages",
"gmedia.api.music.resources");
ws.addGrizzlyAdapter(adapter);
ws.start()
精彩评论