<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Getting XML parsing error while connecting to Splunk via java SDK. in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Getting-XML-parsing-error-while-connecting-to-Splunk-via-java/m-p/392876#M6631</link>
    <description>&lt;P&gt;Hi &lt;BR /&gt;PFB code&lt;/P&gt;
&lt;P&gt;HttpService.setSslSecurityProtocol( SSLSecurityProtocol.TLSv1_2 );&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;     ServiceArgs serviceArgs = new ServiceArgs();
     serviceArgs.setHost("mycompanyserver.com");
     serviceArgs.setPort(8089);
     serviceArgs.setUsername("myuser");
     serviceArgs.setPassword("mypasword");


     // Create a Service instance and log in with the argument map
     Service service = Service.connect(serviceArgs);  // throwing error here 

     System.out.println(service.getToken().toString());
     for (Application app : service.getApplications().values()) {
         System.out.println(app.getName());
     }
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;PFB the error&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[Fatal Error] :1:3: The markup in the document preceding the root element must be well-formed.
Exception in thread "main" java.lang.RuntimeException: The markup in the document preceding the root element must be well-formed.
at com.splunk.Xml.parse(Xml.java:63)
at com.splunk.Xml.parse(Xml.java:40)
at com.splunk.Service.login(Service.java:1125)
at com.splunk.Service.login(Service.java:1103)
at com.splunk.Service.connect(Service.java:189)&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 17 Jun 2020 22:32:09 GMT</pubDate>
    <dc:creator>chitranjan155</dc:creator>
    <dc:date>2020-06-17T22:32:09Z</dc:date>
    <item>
      <title>Getting XML parsing error while connecting to Splunk via java SDK.</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Getting-XML-parsing-error-while-connecting-to-Splunk-via-java/m-p/392876#M6631</link>
      <description>&lt;P&gt;Hi &lt;BR /&gt;PFB code&lt;/P&gt;
&lt;P&gt;HttpService.setSslSecurityProtocol( SSLSecurityProtocol.TLSv1_2 );&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;     ServiceArgs serviceArgs = new ServiceArgs();
     serviceArgs.setHost("mycompanyserver.com");
     serviceArgs.setPort(8089);
     serviceArgs.setUsername("myuser");
     serviceArgs.setPassword("mypasword");


     // Create a Service instance and log in with the argument map
     Service service = Service.connect(serviceArgs);  // throwing error here 

     System.out.println(service.getToken().toString());
     for (Application app : service.getApplications().values()) {
         System.out.println(app.getName());
     }
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;PFB the error&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[Fatal Error] :1:3: The markup in the document preceding the root element must be well-formed.
Exception in thread "main" java.lang.RuntimeException: The markup in the document preceding the root element must be well-formed.
at com.splunk.Xml.parse(Xml.java:63)
at com.splunk.Xml.parse(Xml.java:40)
at com.splunk.Service.login(Service.java:1125)
at com.splunk.Service.login(Service.java:1103)
at com.splunk.Service.connect(Service.java:189)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 17 Jun 2020 22:32:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Getting-XML-parsing-error-while-connecting-to-Splunk-via-java/m-p/392876#M6631</guid>
      <dc:creator>chitranjan155</dc:creator>
      <dc:date>2020-06-17T22:32:09Z</dc:date>
    </item>
  </channel>
</rss>

