###前提・実現したいこと
JavaのWebServiceを使用して、サーバ・クライアントのアプリケーションを作成しております。
開発中であるため、署名には自己証明書を使用したいと考えております。
NetBeans上ではサーバもクライアントも正常動作します。
ところが、Mavenでビルドし、署名したjarファイルを実際にLAN上のサーバに配置すると、
Javaのセキュリティによるブロックで起動することができません。
###発生している問題・エラーメッセージ
LAN環境内の別PC上のTomcatにWebServiceのサーバ側jar、クライアント側.jarをそれぞれ配置し、
jnlpファイルを使って接続を試みたところ、以下のメッセージが出て実行できません。
Ignored exception: ExitException[ 3]com.sun.deploy.security.BlockedException: Javaセキュリティ設定により、このアプリケーションは実行できません。この動作はJavaコントロール・パネルで変更できます。
以前(5月頭くらい?)は同様の方法で自己証明書で署名、
Javaのセキュリティ設定による除外設定にURLを追加することにより、
警告は表示されますが動いておりました。
一字一句覚えているわけではありませんが、
信頼出来ない署名ですがいいですか?といったニュアンスの警告でした。
###該当のソースコード
pom.xml(build部分抜粋、プロジェクト固有名は伏せております) ... <build> <resources> <resource> <targetPath>META-INF</targetPath> <directory>src</directory> <includes> <include>jax-ws-catalog.xml</include> <include>wsdl/**</include> </includes> </resource> <resource> <directory>src/main/resources</directory> </resource> </resources> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.6</version> <executions> <execution> <id>unpack-dependencies</id> <phase>package</phase> <goals> <goal>unpack-dependencies</goal> </goals> <configuration> <excludeScope>system</excludeScope> <excludeGroupIds>junit,org.mockito,org.hamcrest</excludeGroupIds> <outputDirectory>${project.build.directory}/classes</outputDirectory> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.2.1</version> <executions> <execution> <id>unpack-dependencies</id> <phase>package</phase> <goals> <goal>exec</goal> </goals> <configuration> <executable>${java.home}/../bin/javafxpackager</executable> <arguments> <argument>-createjar</argument> <argument>-nocss2bin</argument> <argument>-appclass</argument> <argument>${mainClass}</argument> <argument>-srcdir</argument> <argument>${project.build.directory}/classes</argument> <argument>-outdir</argument> <argument>${project.build.directory}</argument> <argument>-outfile</argument> <argument>${project.build.finalName}.jar</argument> </arguments> </configuration> </execution> <execution> <id>default-cli</id> <goals> <goal>exec</goal> </goals> <configuration> <executable>${java.home}/bin/java</executable> <commandlineArgs>${runfx.args}</commandlineArgs> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.8</source> <target>1.8</target> <compilerArguments> <bootclasspath>${sun.boot.class.path}${path.separator}${java.home}/lib/jfxrt.jar</bootclasspath> </compilerArguments> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.16</version> <configuration> <additionalClasspathElements> <additionalClasspathElement>${java.home}/lib/jfxrt.jar</additionalClasspathElement> </additionalClasspathElements> </configuration> </plugin> <plugin> <groupId>org.jvnet.jax-ws-commons</groupId> <artifactId>jaxws-maven-plugin</artifactId> <version>2.3</version> <executions> <execution> <goals> <goal>wsimport</goal> </goals> <configuration> <vmArgs> <vmArg>-Djavax.xml.accessExternalSchema=all</vmArg> </vmArgs> <wsdlFiles> <wsdlFile>localhost_8080/XXXXXXXXXXXXXXX/XXXXXXXXXXXXXXX.wsdl</wsdlFile> </wsdlFiles> <packageName></packageName> <wsdlLocation>http://localhost:8080/XXXXXXXXXXXXXXX/XXXXXXXXXXXXXXX?wsdl</wsdlLocation> <staleFile>${project.build.directory}/jaxws/stale/XXXXXXXXXXXXXXX.stale</staleFile> </configuration> <id>wsimport-generate-XXXXXXXXXXXXXXX</id> <phase>generate-sources</phase> </execution> </executions> <dependencies> <dependency> <groupId>javax.xml</groupId> <artifactId>webservices-api</artifactId> <version>2.0</version> </dependency> </dependencies> <configuration> <sourceDestDir>${project.build.directory}/generated-sources/jaxws-wsimport</sourceDestDir> <xnocompile>true</xnocompile> <verbose>true</verbose> <extension>true</extension> <catalog>${basedir}/src/jax-ws-catalog.xml</catalog> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jarsigner-plugin</artifactId> <version>1.4</version> <executions> <execution> <id>signing</id> <goals> <goal>sign</goal> <goal>verify</goal> </goals> <phase>package</phase> <inherited>true</inherited> <configuration> <removeExistingSignatures>true</removeExistingSignatures> <archiveDirectory></archiveDirectory> <includes> <include>${project.build.directory}/${project.artifactId}.jar</include> </includes> <keystore>./XXXXXXXXXXXXXXX.keystore</keystore> <storepass>XXXXXXXXXXXXXXX</storepass> <keypass>XXXXXXXXXXXXXXX</keypass> <alias>XXXXXXXXXXXXXXX</alias> <verbose>true</verbose> </configuration> </execution> </executions> </plugin> </plugins> </build> ...
###試したこと
-
Javaコントロールパネルのセキュリティ設定で、該当のURLは除外しております。
-
NetBeansのJavaアプリケーションプロジェクトを作成、
同じ署名を使用して、プロジェクトをビルド、署名、jnlpから実行したところ、
署名の信頼性の警告は出ますが実行は可能でした。そのため、署名データに問題はないように思います。
- 同じプロジェクトをJDK1.8.0_45でMavenビルドすると、警告はでますが実行できました。
JDK1.8.0_91でMavenビルドすると、警告ではなくブロックされて実行できませんでした。
おそらく問題はMavenによるビルドと、NetBeansデフォルトのビルドの違いだと思われますが、
どこが原因なのか調べる方法すらわかっておりません。
###補足情報(言語/FW/ツール等のバージョンなど)
Java (サーバ側)1.8.0_77 (クライアント側)1.8.0_91
Tomcat 8.0.27
ご助力よろしくお願いいたします。
回答1件
あなたの回答
tips
プレビュー