Tomcat部署上的java 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
问题是我的映射是不同的,当我在本地运行项目时,这是有效的。以下是代码中的mymappings:
@WebServlet(urlPatterns = "/*", name = "GalleryUIServlet", asyncSupported = true)
@WebServlet(urlPatterns = "/admin/*", name = "AdminUIServlet", asyncSupported = true)
这个错误怎么可能?我怎样才能解决这个问题
# 1 楼答案
发生这种情况的一个原因是,您的网站有重复的条目。xml和您的注释
试着从你的网站上删除
<servlet-mapping>
部分。xml,看看这是否解决了问题参考:
http://examples.javacodegeeks.com/enterprise-java/tomcat/tomcat-web-xml-configuration-example/
The servlets named [create_subscription] and [servlet.create] are both mapped to the url-pattern [/create] which is not permitted