{"id":6698,"date":"2014-04-22T01:40:40","date_gmt":"2014-04-22T01:40:40","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/22\/web-service-throwing-java-io-ioexception-authentication-failure-collection-of-common-programming-errors-2\/"},"modified":"2014-04-22T01:40:40","modified_gmt":"2014-04-22T01:40:40","slug":"web-service-throwing-java-io-ioexception-authentication-failure-collection-of-common-programming-errors-2","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/22\/web-service-throwing-java-io-ioexception-authentication-failure-collection-of-common-programming-errors-2\/","title":{"rendered":"Web service throwing java.io.IOException: Authentication failure-Collection of common programming errors"},"content":{"rendered":"<p>I am trying to consume a SOAP based web service. I have written consumer using CXF 2.5.7 API. Web service has a NTML authentication implemented. I am passing userid and password when invoking it. Code is working fine and I am able to see the response. Same code is also working on one of my college machine but it is throwing error on other colleague&#8217;s machine. It throws <strong>java.io.IOException: Authentication failure<\/strong> exception. Though we all are able to access WSDL on explorer. I am not sure where is the issue. Can someone guide me.<\/p>\n<p>Could network settings be the issue? If yes what settings?<\/p>\n<p>I have also exported code to a runnable jar file. Jar is executing on my machine but throwing same exception on his machine.<\/p>\n<pre><code>Exception in thread \"main\" javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.\n    at org.apache.cxf.jaxws.ServiceImpl.(ServiceImpl.java:149)\n    at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:98)\n    at javax.xml.ws.Service.(Unknown Source)\n    at com.microsoft.schemas.sqlserver.reporting.reportingservices.ReportExecutionService.(ReportExecutionService.java:50)\n    at com.microsoft.schemas.sqlserver.reporting.reportingservices.execution.TestPerformance.getData(TestPerformance.java:106)\n    at com.microsoft.schemas.sqlserver.reporting.reportingservices.execution.TestPerformance.main(TestPerformance.java:190)\nCaused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.\n    at org.apache.cxf.wsdl11.WSDLServiceFactory.(WSDLServiceFactory.java:100)\n    at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:199)\n    at org.apache.cxf.jaxws.ServiceImpl.(ServiceImpl.java:147)\n    ... 5 more\nCaused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing 'http:\/\/IP_ADDRESS\/ReportServer\/ReportExecution2005.asmx?wsdl'.: java.io.IOException: Authentication failure\n    at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2198)\n    at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2390)\n    at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2422)\n    at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:262)\n    at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:205)\n    at org.apache.cxf.wsdl11.WSDLServiceFactory.(WSDLServiceFactory.java:98)\n    ... 7 more\nCaused by: java.io.IOException: Authentication failure\n    at sun.reflect.GeneratedConstructorAccessor2.newInstance(Unknown Source)\n    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)\n    at java.lang.reflect.Constructor.newInstance(Unknown Source)\n    at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)\n    at java.security.AccessController.doPrivileged(Native Method)\n    at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source)\n    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)\n    at jcifs.http.NtlmHttpURLConnection.getInputStream(NtlmHttpURLConnection.java:242)\n    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)\n    at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(Unknown Source)\n    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)\n    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)\n    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)\n    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)\n    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)\n    at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2188)\n    ... 12 more\nCaused by: java.io.IOException: Authentication failure\n    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)\n    at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(Unknown Source)\n    at jcifs.http.NtlmHttpURLConnection.parseResponseCode(NtlmHttpURLConnection.java:424)\n    at jcifs.http.NtlmHttpURLConnection.doHandshake(NtlmHttpURLConnection.java:436)\n    at jcifs.http.NtlmHttpURLConnection.handshake(NtlmHttpURLConnection.java:103)\n    at jcifs.http.NtlmHttpURLConnection.getInputStream(NtlmHttpURLConnection.java:240)\n    ... 20 more\n<\/code><\/pre>\n<p>Thanks<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am trying to consume a SOAP based web service. I have written consumer using CXF 2.5.7 API. Web service has a NTML authentication implemented. I am passing userid and password when invoking it. Code is working fine and I am able to see the response. Same code is also working on one of my [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6698","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6698","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6698"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6698\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6698"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}