【トラブル】【Eclips】【Tomcat】Eclipse + Tomcatのトラブルシューティング ~その1 ~

■「Java compiler level does not match ...」が表示される

詳細

 * Eclipse でエラーアイコンが出ていたので、
   [windows]-[Show View]-[Problems]でみたところ、以下のエラーが表示されていた

エラー表示内容

Java compiler level does not match the version of the installed Java project facet

解決方法

 * Eclipse で[Properties]-[Project Facets]-[Java]で適切なJava Versionに変更
 (今回は1.7で解決していたので、「1.7」に変更したところ、問題解決)

参考文献

http://ysmt.blog21.fc2.com/blog-entry-370.html

■「Server Tomcat vX.0 Server at localhost was unable to start within 45 seconds ...」が表示される

詳細

 * Eclipse + Tomcat 上でServerを開始した際に、以下のエラーが表示された

エラー表示内容

Server Tomcat vX.0 Server at localhost was unable to start within 45 seconds.
If the server requires more time, try increasing the timeout in the server editor

解決方法

以下の手順を行う
[1] Eclipseでservers viewを開く
[2] 対象のサーバをダブルクリック
[3] Timeout値をあげる 

■「Could not load the Tomcat server configuration」が表示される

解決方法

[1] Project Explorer の [Servers] 内のServerを削除する
[2] [File]-[New]-[Other]-[Server]で再作成する

参考文献

http://clocker.hatenablog.com/entry/2012/04/15/021229

■「cannot create a server using the selected type」が表示される

詳細

cannot create a server using the selected type
(日本語:選択されたタイプを使用してサーバーを作成できません)
が表示される

解決方法

以下の手順を行う
[1] Eclipseで[Windows]-[Preferences]-[Server]-[Runtime Enviroments]を選択
[2] 該当するTomcat のインストールフォルダを指定し直す 

参考文献

http://d.hatena.ne.jp/kzk-y/20090317

■「The server cannot be started because one or more of the ports are invalid」が表示される

詳細

 * Eclipse + Tomcatで、JSPを実行したところ、以下のエラー内容が表示される

エラー内容

The server cannot be started because one or more of the ports are invalid.
Open the server editor and correct the invalid ports.

原因

 * server.xml のshutdownポートを「-1」に
 「<Server port="-1" shutdown="SHUTDOWN">」としていた

解決方法

 * ポート番号を利用していない1~65535の整数値を設定する
 例:「<Server port="8005" shutdown="SHUTDOWN">」。

補足

 * なお、「-1」にすること自体は間違ってない。詳細は下記の関連記事を参照のこと。
http://blogs.yahoo.co.jp/dk521123/33578498.html

EclipseTomcatの設定を入れなおした際にビルドエラーになる

詳細

 * EclipseTomcatの設定を一度削除し、再度、設定しなおした際に
 Servlet系のクラスが赤波線になり「HttpServlet cannot be resolved to a type」などの
 エラーとなり実行できない。

原因

 * 対象のプロジェクトを右クリックし、[Properties]-[Targeted runtimes]で
  サーバにチェックが何もついてなかった

解決方法

 [1] 対象のプロジェクトを右クリックし、[Properties]-[Targeted runtimes] を選択
 [2] 対象のサーバにチェックを付け、「OK」を押下

* 長くなったので、以下に移行
http://blogs.yahoo.co.jp/dk521123/34691085.html