我试图将应用程序部署到Openshift服务器,但我在那里遇到一个奇怪的错误,它不想部署我的战争文件。 错误指出:
Caused by: java.lang.IllegalArgumentException: The servlets named [AdminUIServlet] and [GalleryUIServlet] are both mapped to the url-pattern [/admin/*] which is not permitted
问题是我的映射是不同的,当我在本地运行项目时,这是有效的。以下是代码中的 mymapping:
@WebServlet(urlPatterns = "/*", name = "GalleryUIServlet", asyncSupported = true)
@WebServlet(urlPatterns = "/admin/*", name = "AdminUIServlet", asyncSupported = true)
这个错误怎么可能?我该如何解决这个问题?
的原因之一是因为您的网络.xml和注释有重复的条目。
尝试从您的网站上删除<servlet-mapping>
部分.xml看看是否可以解决您的问题。
裁判:
http://examples.javacodegeeks.com/enterprise-java/tomcat/tomcat-web-xml-configuration-example/
名为 [create_subscription] 和 [servlet.create] 的 servlet 都映射到 url-pattern [/create],这是不允许的