cloudsoft / winrm4j

Apache License 2.0
93 stars 53 forks source link

Failed to create Service #24

Closed rahulcoode90 closed 7 years ago

rahulcoode90 commented 8 years ago

I have written the code using version 0.3.1 and also have included all the dependent jar files, the program is giving the error as: Exception in thread "main" javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service. at org.apache.cxf.jaxws.ServiceImpl.initialize(ServiceImpl.java:163) at org.apache.cxf.jaxws.ServiceImpl.(ServiceImpl.java:129) at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:99) at javax.xml.ws.Service.(Service.java:77) at io.cloudsoft.winrm4j.client.WinRmService.(WinRmService.java:44) at io.cloudsoft.winrm4j.client.WinRmClient.createService(WinRmClient.java:297) at io.cloudsoft.winrm4j.client.WinRmClient.getService(WinRmClient.java:290) at io.cloudsoft.winrm4j.client.WinRmClient.command(WinRmClient.java:194) at io.cloudsoft.winrm4j.winrm.WinRmTool.executeCommand(WinRmTool.java:197) at io.cloudsoft.winrm4j.winrm.WinRmTool.executePs(WinRmTool.java:210) at tejas_gateway_v1.test_v1.main(test_v1.java:20) Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service. at org.apache.cxf.wsdl11.WSDLServiceFactory.(WSDLServiceFactory.java:87) at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:218) at org.apache.cxf.jaxws.ServiceImpl.initialize(ServiceImpl.java:161) ... 10 more Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: java.lang.RuntimeException: Cannot create a secure XMLInputFactory at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:207) at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:156) at org.apache.cxf.wsdl11.WSDLServiceFactory.(WSDLServiceFactory.java:85) ... 12 more Caused by: java.lang.RuntimeException: Cannot create a secure XMLInputFactory at org.apache.cxf.staxutils.StaxUtils.createXMLInputFactory(StaxUtils.java:312) at org.apache.cxf.staxutils.StaxUtils.getXMLInputFactory(StaxUtils.java:262) at org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1511) at org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1413) at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:197) ... 14 more

Please someone let me know what is problem?

neykov commented 8 years ago

@rahulcoode90 Looks like a conflicting dependencies problem - could be wrong dependency or version mismatch. An easy way to get all the current dependencies is to execute in the winrm4j module folder:

mvn dependency:copy-dependencies -DoutputDirectory=<folder to copy deps to>

If you still get the same error try running the tests in winrm4j by updating the credentials in AbstractWinRmToolLiveTest and running mvn clean install -PLive.

neykov commented 7 years ago

Closing - no response from user. Let us know if you still have the problem with latest 0.5.0 release.

ravirajamiyer commented 7 years ago

I faced the same issue described in this report. After following the suggestion by 'neykov' I was able to get over that. There are lot of dependency jar files that are required to get it working.