IntelliJ想法-码头,报告异常 [英] IntelliJ idea - Jetty, report an exception

查看:128
本文介绍了IntelliJ想法-码头,报告异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我用码头启动服务器时,控制台将显示以下错误信息:

When I start server with jetty, the console will display this error information:

有人可以帮助我吗? 3Q.

Can someone help me ? 3Q.

[2014-10-26 14:11:02  WARN org.eclipse.jetty.util.component.AbstractLifeCycle:204] FAILED org.eclipse.jetty.server.handler.HandlerCollection@3bbbbafc:
java.lang.NoSuchMethodError:    javax.servlet.ServletContext.getServletRegistration(Ljava/lang/String;)Ljavax/servlet/ServletRegistration;
java.lang.NoSuchMethodError: javax.servlet.ServletContext.getServletRegistration(Ljava/lang/String;)Ljavax/servlet/ServletRegistration;
at org.apache.jasper.runtime.TldScanner.onStartup(TldScanner.java:231)
at org.eclipse.jetty.plus.annotation.ContainerInitializer.callStartup(ContainerInitializer.java:106)
at org.eclipse.jetty.annotations.ServletContainerInitializerListener.contextInitialized(ServletContainerInitializerListener.java:107)
at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:775)
at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424)
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:767)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:710)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:172)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
at org.eclipse.jetty.server.Server.doStart(Server.java:280)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.mortbay.jetty.runner.Runner.run(Runner.java:512)
at org.mortbay.jetty.runner.Runner.main(Runner.java:633)
[2014-10-26 14:11:02  WARN org.eclipse.jetty.util.component.AbstractLifeCycle:204] FAILED org.eclipse.jetty.server.Server@549b6220: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getServletRegistration(Ljava/lang/String;)Ljavax/servlet/ServletRegistration;
java.lang.NoSuchMethodError: javax.servlet.ServletContext.getServletRegistration(Ljava/lang/String;)Ljavax/servlet/ServletRegistration;
at org.apache.jasper.runtime.TldScanner.onStartup(TldScanner.java:231)
at org.eclipse.jetty.plus.annotation.ContainerInitializer.callStartup(ContainerInitializer.java:106)
at org.eclipse.jetty.annotations.ServletContainerInitializerListener.contextInitialized(ServletContainerInitializerListener.java:107)
at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:775)
at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424)
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:767)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:710)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:172)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
at org.eclipse.jetty.server.Server.doStart(Server.java:280)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.mortbay.jetty.runner.Runner.run(Runner.java:512)
at org.mortbay.jetty.runner.Runner.main(Runner.java:633)
Exception in thread "main" java.lang.NoSuchMethodError: javax.servlet.ServletContext.getServletRegistration(Ljava/lang/String;)Ljavax/servlet/ServletRegistration;
at org.apache.jasper.runtime.TldScanner.onStartup(TldScanner.java:231)
at org.eclipse.jetty.plus.annotation.ContainerInitializer.callStartup(ContainerInitializer.java:106)
at org.eclipse.jetty.annotations.ServletContainerInitializerListener.contextInitialized(ServletContainerInitializerListener.java:107)
at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:775)
at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424)
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:767)
at  org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:710)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:172)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
at org.eclipse.jetty.server.Server.doStart(Server.java:280)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.mortbay.jetty.runner.Runner.run(Runner.java:512)
at org.mortbay.jetty.runner.Runner.main(Runner.java:633)
Disconnected from the target VM, address: '127.0.0.1:50852', transport: 'socket'

推荐答案

我是您正在使用的插件的开发人员. :)
这是插件/项目的GitHub链接: IDEA Jetty Runner

I am the developer of the plugin that you're using. :)
Here is the GitHub link to the plugin / project: IDEA Jetty Runner

正如您在命令行"实现中所看到的那样,我将使用提供的jetty-runner jar插件来启动jetty服务器.这是该类的链接:

As you can see on the "Command Line" implementation I will use the plugin provided jetty-runner jar to start up the jetty server. Here is the link to the class: Jetty Runner Command Line

之所以这样做,是因为IntelliJ已经提供了一个出色的内置插件,可以在其企业版IDE上支持多个版本的Jetty.另外,他们背后还有一个团队来处理可能导致的各种错误/问题.

The reason why I did that is because IntelliJ already provides a great built in plugin that supports multiple versions of Jetty on their Enterprise edition version of the IDE. Also, they have a team behind it to deal with all sorts of bugs / problems that this may cause.

与此同时,我在业余时间开发了该插件,并免费提供了该插件,以便人们至少可以在IDE的社区版"版本上安装轻量级的Java EE服务器,并且为了公平起见,我决定将其限制为特定版本的jetty/servlet-api.

Meanwhile this plugin has been developed in my spare time and made it available for free so people could at least have a lightweight Java EE server on the "Community Edition" version of the IDE and to keep it fair I've decided to limit it to a specific version of jetty / servlet-api.

所以,回到您的问题; Joakim所说的是正确的,该插件将您的应用程序降级为servlet-api-2.5,换句话说,将您的项目降级为使用servlet-api-2.5,您应该没事.
但是,无论是您的IDEA设置,您的IDEA Jetty Runner插件配置,还是您的项目正在使用其自己的jar(在服​​务器级别)降级Servlet API版本."

So, back to your question; what Joakim said here is correct, the plugin downgrades your app to the servlet-api-2.5, in other words downgrade your project to use the servlet-api-2.5 and you should be fine.
"However, either your IDEA setup, your IDEA Jetty Runner Plugin configuration, or your project is downgrading the Servlet API version with its own jar (at the server level)."

您可以在github上找到有关该插件的更多信息.
顺便说一句,感谢您使用该插件! ;)

You can find a little bit more about the plugin on github.
By the way, thanks for using the plugin! ;)

这篇关于IntelliJ想法-码头,报告异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆