简体   繁体   中英

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

The application is an integration WS (exposes an endpoint whose operations call a third-party WS). The application worked correctly with http, but when the third party added its own certificate and forced the use of https, it stopped working.

I have created the jks, and I have managed to generate the third-party wsdl classes. The application compiles and executes mvn spring-boot: run -Djavax.net.ssl.trustStore = MiJks.jks works correctly. On the other hand, if I use java -jar Miapp.jar -Djavax.net.ssl.trustStore = MiJks.jks , it is not able to create the beans of the 3rd services.

To generate the wsdl code of the 3rd, I use jaxws-maven-plugin from codehaus.

This is the definition of the bean within the application-context:

<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>

This is the error showed :

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.

What's wrong? What's the difference between running java through maven and running the java directly?

Thanks

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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