lomboz eclipse + tomcat8.0 + struts2.3 添加新project,run on server出現錯誤的解決方案

在添加了新的項目之後,run on server的時候,會出現找不到資源的問題或者無法啓動server的問題。經常的錯誤提示有下面幾個:

run之後提示HTTP Status 404

several ports (8005, 8080, 8009) required by Tomcat v7.0 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s)

Server Tomcat v8.0 Server at localhost failed to start

Publishing failed with multiple errors[...] May be locked by another process

主要的問題是運行server時,WEB-INF裏面的lib目錄裏面的jar,會被放置到一個臨時文件夾裏,並且被lock住。


最開始的解決方法是每起一個項目,就把原來的server刪掉,重新new一個新的server。


發現這樣的解決方案實在是太崩潰了,後來查找了一些資料,並且結合自己的猜想,發現了下面的解決方案,雖然還不是很理想,但是暫時也還找不到更好的解決方案,所以先將就用,以後有時間再去找更深層的原因和解決方案。

把reference->server下的launching下的“when a restart may be required,restart the server”,選擇always。

在每次需要在server上運行新項目時,把原來server上的項目刪除掉,並且clean和publish幾次,這個過程server會自動重啓。出錯不管,多clean和publish幾次就是了。

然後在server上添加要運行的項目,然後publish,再運行即可。



提醒:出錯了一定一定要注意看console的出錯信息!!!

有些問題可能是自己不注意出的小問題導致的,console上會有詳細的錯誤信息讓你找到問題根源!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章