我尝试在 Tomcat 7 中运行一个网络应用程序。我正在使用 Maven,并且使用 jetty-Plugin 一切正常。在构建战争并将其部署到 Tomcat7 时,我得到 Keystore-File 的 FileNotFoundException。
我必须将文件放在哪里,我必须在 cxfClient.xml 中使用什么路径?
pom.xml 片段:
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-xjc-plugin</artifactId>
<version>2.3.2</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>xsdtojava</goal>
</goals>
<configuration>
<sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
<xsdOptions>
<xsdOption>
<xsd>${basedir}/src/main/resources/xsd/template1.xsd</xsd>
<packagename>some.packagename</packagename>
</xsdOption>
</xsdOptions>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>2.7.3</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
<wsdlOptions>
<wsdlOption>
<!-- <wsdl>URLTOWSDL</wsdl> -->
<wsdl>${basedir}/src/test/resources/somewsdl.wsdl</wsdl>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
cxfClient.xml:
<sec:keyManagers>
<sec:keyStore file="truststore.jks" password="test1234" type="JKS"/>
</sec:keyManagers>
<sec:trustManagers>
<sec:keyStore file="truststore.jks" password="test1234" type="JKS"/>
</sec:trustManagers>
来自日志文件的行:
Error creating bean with name 'servicename.http-conduit': Cannot create inner bean '(inner bean)' of type [org.apache.cxf.configuration.jsse.TLSClientParametersConfig] while setting bean property 'tlsClientParameters'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public static java.lang.Object org.apache.cxf.configuration.jsse.TLSClientParametersConfig.createTLSClientParameters(java.lang.String)] threw exception; nested exception is java.lang.RuntimeException: java.io.FileNotFoundException: src\main\resources\truststore.jks (Das System kann den angegebenen Pfad nicht finden)
我在 cxfClient 中尝试了具有不同路径的 src/main/resources、src/main/webapp,但总是得到 FileNotFoundException。
提前致谢