2013年7月30日星期二

Exception: Servlet class X is not a javax.servlet.Servlet

using Maven command mvn archetype: create created a simple web project. Importing Eclipse runtime, reported this exception:

Servlet class X is not a javax.servlet.Serv < span style = "word-wrap: break-word; font-family: 'Microsoft YaHei'; font-size: 14px; color: # e53333;"> let

online search, search, jar package conflicts that may be, the result is not checked off.

later point that, look for, actually found the problem: There are two classes directory under the project, so there are two different class files.

one is Maven generated, target / classes directory.

a is generated by Eclipse, src / main / webapp / WEB-INF / classes directory.

delete src / main / webapp / WEB-INF classes directory under the project to normal operation .

没有评论:

发表评论