servlet-api.jarはコンパイル時にするだけでwarファイルには含めないものです。
実行時にはtomcatなどのAPサーバのライブラリを使用するようになっています。
Tomcat/エラー:jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class | Tipi
【参考】
以下のスクリプトは、テスト環境にpayara-embeddedを使用しているビルドツリーのgradleのライブラリ依存関係設定です。javaee-apiはコンパイル時のみで使用する設定になっています。
groovy
1dependencies {
2 //プロダクト用(コンパイル、実行、配布)
3 compile 'org.slf4j:slf4j-api:1.7.25'
4 compile 'com.google.guava:guava:22.0'
5 compile 'com.google.inject:guice:4.1.0'
6 compile 'com.ancientprogramming.fixedformat4j:fixedformat4j:1.2.2'
7
8 //プロダクト用(コンパイル)
9 compileOnly 'javax:javaee-api:7.0'
10 compileOnly 'org.projectlombok:lombok:1.16.16'
11
12 //プロダクト用(実行、配布)
13 runtime 'ch.qos.logback:logback-classic:1.2.3'
14
15 //テスト用(コンパイル、実行)
16 testCompile 'junit:junit:4.12'
17 testCompile 'org.assertj:assertj-core:3.8.0'
18 testCompile 'org.mockito:mockito-core:2.8.9'
19 testCompile 'org.jboss.arquillian.junit:arquillian-junit-container:1.1.13.Final'
20 testCompile 'org.jboss.arquillian.container:arquillian-glassfish-embedded-3.1:1.0.0.Final'
21
22 //テスト用(コンパイル)
23 testCompileOnly 'javax:javaee-api:7.0'
24
25 //テスト用(実行)
26 testRuntime 'fish.payara.api:payara-api:4.1.2.172'
27 testRuntime 'fish.payara.extras:payara-embedded-all:4.1.2.172'
28}
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/09/06 23:25