繁体   English   中英

Spring-boot:运行正常,但java-jar不运行

[英]Spring-boot:run works but java-jar doesn't

该应用程序是一个集成WS(公开一个端点,其操作称为第三方WS)。 该应用程序可与http正常工作,但是当第三方添加其自己的证书并强制使用https时,它将停止工作。

我已经创建了jks,并且设法生成了第三方wsdl类。 该应用程序编译并执行mvn spring-boot: run -Djavax.net.ssl.trustStore = MiJks.jks正常工作。 另一方面,如果使用java -jar Miapp.jar -Djavax.net.ssl.trustStore = MiJks.jks ,则无法创建第三项服务的bean。

为了生成第三个的wsdl代码,我使用了来自Codehaus的jaxws-maven-plugin。

这是应用程序上下文中bean的定义:

<bean id="teleoptiInternalService"
        class="org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean">
        <property name="serviceInterface"
            value="com.teleopti.ccc.schemas.sdk._2010._04.TeleoptiCccSdkInternal" />
        <property name="wsdlDocumentUrl"
             value="https://WTWFMWEB01.comunicaciones.tel/TeleoptiWFM/SDK/TeleoptiCccSdkService.svc?wsdl" />
        <property name="serviceName" value="TeleoptiCccSdkService" />
        <property name="portName" value="TeleoptiOrganizationService1" />
        <!-- TODO Endpoint URL should be in a properties file -->
        <property name="endpointAddress"
            value="https://WTWFMWEB01.comunicaciones.tel/TeleoptiWFM/SDK/TeleoptiCccSdkService.svc" />
        <property name="handlerResolver" ref="wsHandlerResolver" />
        <property name="portFeatures">
            <bean class="org.apache.cxf.feature.LoggingFeature" />
        </property>
    </bean>

这是显示的错误:

2018-05-28 10:32:55.623  WARN 2172 --- [           main] o.s.b.f.s.DefaultListableBeanFactory     : Bean creation exception on non-lazy FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'teleoptiInternalService' defined in class path resource [applicationContext-teleopti-integration.xml]: Invocation of init method failed; nested exception is javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.

怎么了? 通过maven运行Java和直接运行Java有什么区别?

谢谢

解决方案:在执行Java命令时将-D放在-jar之前

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM