开发者

unable to find com.sun.grizzly.tcp.http11.GrizzlyAdapter.setResourcesContextPath(String)

开发者 https://www.devze.com 2023-01-19 16:05 出处:网络
I trying to expose some groovy service with jersey and girzzly. but i got a wierd error when i\'m launching my servlet container.

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()
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号