2015-09-01 57 views
0

每當我想在Tomcat7.0上從eclipse運行servlet時,服務器啓動失敗。我一直在練習jsp和servlet,一切都很順利,直到今天早上,突然間我的系統意外關閉,然後我面臨這個問題。我嘗試了所有可能的方式,如刪除服務器並創建一個新的等,但最終This instruction helps me在eclipse中運行servlet無法啓動服務器

You need to copy the required commons jars into your /WEB-INF/lib folder as well. 

commons-io-2.4.jar 
commons-fileupload-1.3.1.jar 
The reason is that just adding the jar dependencies to your Eclipse project's build path does not make them automatically available on Tomcat. Since, the dependencies are missing (not found in the lib folder) your web app's deployment fails. 

不過我有一個問題,一個question.The問題是,我必須添加上面提到的兩個罐所有項目的/ WEB-INF/lib文件夾中的文件?和問題是,雖然我的服務器運行沒有任何錯誤,它無法運行該servlet文件。我得到這個錯誤。它只發生在servlet中,jsp或html文件沒有問題。我嘗試創建三個以上的新項目來測試,但結果與下面相同。

HTTP Status 404 - /Register 

-------------------------------------------------------------------------------- 

type Status report 

message /Register 

description The requested resource is not available. 
+0

您使用了錯誤的關鍵字搜索。這是否可以接受爲愚蠢? http://stackoverflow.com/questions/11731377/how-to-call-servlet-from-html-form-in-jsp-file-without-getting-http-404-error – BalusC

回答

0

上市的JAR文件(公地IO-2.4.jar和commons-文件上傳-1.3.1.jar)添加到項目的WEB-INF/lib目錄文件夾(如果它不存在,創建文件夾)。您僅在該servlet中出現錯誤的原因可能是您從該特定servlet中的jar文件運行代碼。

+0

你正在談論哪些jar文件。請多說明一下 –

+0

列出的(commons-io-2.4.jar和commons-fileupload-1.3.1.jar) –

相關問題