无法找到 com.sun.grizzly.tcp.http11.GrizzlyAdapter.setResourcesContextPath(String)
我试图用球衣和女孩来展示一些绝妙的服务。但是当我启动 servlet 容器时出现了一个奇怪的错误。 这是启动它的代码片段:
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);
这是错误:
java.lang.NoSuchMethodError: com.sun.grizzly.tcp.http11.GrizzlyAdapter.setResourcesContextPath(Ljava/lang/String;)V
错误发生在 grizzlyServeletFactory.create 处。我正在解释为什么这个错误会发生,因为这个方法存在于这个对象上?
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 which 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
抱歉我是个白痴。这是我现在使用的
GrizzlyWebServer ws = new GrizzlyWebServer(9999);
sorry i was an idiot. Here is what i'm using now
GrizzlyWebServer ws = new GrizzlyWebServer(9999);