<?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 Re: Connecting to Splunk via Java SDK, why am I getting error &amp;quot;java.lang.IllegalArgumentException: URI can't be null.&amp;quot; in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Connecting-to-Splunk-via-Java-SDK-why-am-I-getting-error-quot/m-p/269606#M3381</link>
    <description>&lt;P&gt;Hi thewho123,&lt;/P&gt;

&lt;P&gt;I had the same problem recently. The issue turned out to be a default setting when running Java 1.8. I'm linking to the resolution here: &lt;A href="https://answers.splunk.com/answers/463594/severe-uri-cant-be-null.html"&gt;https://answers.splunk.com/answers/463594/severe-uri-cant-be-null.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You have to explicitly set the SslSecurityProtocol before calling Service.connect:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; HttpService.setSslSecurityProtocol( SSLSecurityProtocol.TLSv1_2 );
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps&lt;/P&gt;</description>
    <pubDate>Wed, 19 Oct 2016 18:55:44 GMT</pubDate>
    <dc:creator>steelecomp99</dc:creator>
    <dc:date>2016-10-19T18:55:44Z</dc:date>
    <item>
      <title>Connecting to Splunk via Java SDK, why am I getting error "java.lang.IllegalArgumentException: URI can't be null."</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Connecting-to-Splunk-via-Java-SDK-why-am-I-getting-error-quot/m-p/269605#M3380</link>
      <description>&lt;P&gt;I am trying to connect to Splunk using the Java SDK. I created a new project in Java using Maven and have the following code provided by Splunk.&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;ServiceArgs loginArgs = new&lt;BR /&gt;
ServiceArgs();&lt;BR /&gt;
loginArgs.setUsername("username");&lt;BR /&gt;
loginArgs.setPassword("password");&lt;BR /&gt;
loginArgs.setHost("hostname");&lt;BR /&gt;
loginArgs.setPort(8089);&lt;BR /&gt;&lt;BR /&gt;
Service service = Service.connect(loginArgs);&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;When I run this, I get "java.lang.IllegalArgumentException: URI can't be null."&lt;/P&gt;

&lt;P&gt;What am I supposed to use for the hostname? Most examples show hostname as localhost.&lt;/P&gt;

&lt;P&gt;I normally access Splunk using a url "mycompany.splunkcloud.com" and enter my credentials.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 18:29:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Connecting-to-Splunk-via-Java-SDK-why-am-I-getting-error-quot/m-p/269605#M3380</guid>
      <dc:creator>thewho123</dc:creator>
      <dc:date>2016-03-29T18:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to Splunk via Java SDK, why am I getting error "java.lang.IllegalArgumentException: URI can't be null."</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Connecting-to-Splunk-via-Java-SDK-why-am-I-getting-error-quot/m-p/269606#M3381</link>
      <description>&lt;P&gt;Hi thewho123,&lt;/P&gt;

&lt;P&gt;I had the same problem recently. The issue turned out to be a default setting when running Java 1.8. I'm linking to the resolution here: &lt;A href="https://answers.splunk.com/answers/463594/severe-uri-cant-be-null.html"&gt;https://answers.splunk.com/answers/463594/severe-uri-cant-be-null.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You have to explicitly set the SslSecurityProtocol before calling Service.connect:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; HttpService.setSslSecurityProtocol( SSLSecurityProtocol.TLSv1_2 );
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2016 18:55:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Connecting-to-Splunk-via-Java-SDK-why-am-I-getting-error-quot/m-p/269606#M3381</guid>
      <dc:creator>steelecomp99</dc:creator>
      <dc:date>2016-10-19T18:55:44Z</dc:date>
    </item>
  </channel>
</rss>

