Tomcat部署中的Openshift错误

时间:2016-02-21 22:37:42

标签: java tomcat7 openshift

我试图将应用程序部署到Openshift服务器,但我在那里遇到一个奇怪的错误,并且它不想部署我的war文件。错误说明:

Caused by: java.lang.IllegalArgumentException: The servlets named [AdminUIServlet] and [GalleryUIServlet] are both mapped to the url-pattern [/admin/*] which is not permitted

事情是我的映射是不同的,当我运行项目localy这工作。以下是代码中的mymappings:

@WebServlet(urlPatterns = "/*", name = "GalleryUIServlet", asyncSupported = true)

@WebServlet(urlPatterns = "/admin/*", name = "AdminUIServlet", asyncSupported = true)

这个错误怎么可能?我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

发生这种情况的原因之一是因为您的web.xml和注释有重复的条目。

尝试从您的web.xml中删除<servlet-mapping>部分,看看是否能解决您的问题。

参考:

  1. http://examples.javacodegeeks.com/enterprise-java/tomcat/tomcat-web-xml-configuration-example/

  2. The servlets named [create_subscription] and [servlet.create] are both mapped to the url-pattern [/create] which is not permitted