簡體   English   中英

Tomcat部署上的Openshift錯誤

[英]Openshift error on Tomcat deployment

我正在嘗試將應用程序部署到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)

這個錯誤怎么可能? 我怎樣才能解決這個問題?

發生這種情況的原因之一是因為您的web.xml和注釋有重復的條目。

嘗試從web.xml中刪除<servlet-mapping>部分,看看是否可以解決您的問題。

參考:

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

  2. 名為[create_subscription]和[servlet.create]的servlet都映射到url-pattern [/ create],這是不允許的

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM