spring mvcバージョン4のトラブル集その1


spring mvcバージョン4のトラブル集

★トラブル1

説明  リソース    パス  ロケーション  型
スーパークラス "javax.servlet.ht
tp.HttpServlet" が Java ビルド・パスで見つかりませんでした    
index.jsp   /OfficeSystem/src/main/webapp   行 1   JSP 問題

解決方法として
下記を追加していな可能性がある。

<!-- Servlet Library -- >
<!-- http://mvnrepository.com/artifact/javax.servlet/javax.servlet-api%20-->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>


上記を追加すると
MAVEN依存関係にJavax.Servlet-api-3.1.0が追加される。


★トラブル2
説明  リソース    パス  ロケーション  型
Java コンパイラー・レベルが、インストールされている Java プロジェクト・ファセットのバージョンと一致しません。  
OfficeSystem        不明  ファセット・プロジェクトの問題 (Java バージョンの不一致)


Javaのバージョン違いの可能性が高いので下記のページを参考に変更する
http://honeycomware.hatenablog.jp/entry/2016/11/24/232340


★トラブル3
説明  リソース    パス  ロケーション  型
必須ライブラリーのアーカイブ:プロジェクト 'OfficeSystem' の 'C:/Users/shimizu/.m2/repository/org/springframework/spring-expression/4.3.1.RELEASE/spring-expression-4.3.1.RELEASE.jar' を読み込めないか、有効な ZIP ファイルではありません OfficeSystem        ビルド・パス  ビルド・パス問題


解決方法
ダウンロードしたクラスライブラリが失敗しているか、古いので再度ライブラリをダウンロードする必要ある
その際に、一度ダウンロードしたデータは削除する。

MAVEN依存関係のspring関連のDLファイル(USERファイルの中にある)を全部消して下記を再度張り付ける
<!-- Spring dependencies -->
<!-- http://mvnrepository.com/artifact/org.springframework/spring-core%20-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.3.1.RELEASE</version>
</dependency>

<!-- http://mvnrepository.com/artifact/org.springframework/spring-web%20-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.3.1.RELEASE</version>
</dependency>

<!-- http://mvnrepository.com/artifact/org.springframework/spring-webmvc%20-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.3.1.RELEASE</version>
</dependency>

<!-- JSTL -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>