Myeclipse中使用tomcat無法發布工程

來源:互聯網
上載者:User

問題:在Myeclipse下開發時,無法使用tomcat發布web工程?產生該情況的原因可能有很多種,我目前碰到的是由於,在發布工程的同時啟動tomcat伺服器

運行環境:Myeclipse8.5

tomcat:6.0.29

今天使用myeclipse開發項目,由於對工程重新進行了修改,所以重新發布了工程,但是在發布的時候,報了很多的錯誤,而且myeclipse還提示說不能夠在發布工程的時候同時啟動伺服器。

具體解決方案:

       1.在工程目錄(你的工程放在什麼地方,找到這個工程然後找該目錄下的.mymetadata檔案)下的.mymetadata檔案中可能webrootdir被改無效了(把下面內容拷到你的.mymetadate檔案中的相應位置上);或者有可能少了這context-root這個屬性;添加上這個屬性即可,內容如下:
  context-root="/上面的name屬性值"
  2.關掉Eclipse,再啟動Eclipse,接著發布工程,發布成功!
詳細例子:
.mymetadata檔案
<?xml version="1.0" encoding="UTF-8"?>
<project-module
  type="WEB"
 
name="myweb"
  id="myeclipse.1202968712015"
 context-root="/myweb"     //注意:這地方的名稱跟上面的名稱要相同,

  j2ee-spec="1.4"

  archive="personnel.war">
  <attributes>
  <attribute name="webrootdir" value="WebRoot" />
  </attributes>
</project-module>

我在解決這個問題的時候,去相應的目錄下找這個檔案,發現 context-root="/myweb"
 消失了

按照上面的例子添加即可!

祝你好運!

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.