<?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: ResultsReaderJson gives error The import com.google cannot be resolved and JsonReader cannot be resolved to a type in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/ResultsReaderJson-gives-error-The-import-com-google-cannot-be/m-p/366759#M66366</link>
    <description>&lt;P&gt;Thank you, downgrading to 1.5.0.0 unblocked me.&lt;/P&gt;</description>
    <pubDate>Wed, 21 Feb 2018 23:38:06 GMT</pubDate>
    <dc:creator>teresap</dc:creator>
    <dc:date>2018-02-21T23:38:06Z</dc:date>
    <item>
      <title>ResultsReaderJson gives error The import com.google cannot be resolved and JsonReader cannot be resolved to a type</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/ResultsReaderJson-gives-error-The-import-com-google-cannot-be/m-p/366757#M66364</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;We are using Selenium+Java for our automation and we have integrated splunk sdk using maven dependencies.&lt;BR /&gt;
we are able to get the Json response by connecting and running the job when we try to display results with the results reader it throws following error:&lt;/P&gt;

&lt;P&gt;java.lang.Error: Unresolved compilation problems:&lt;BR /&gt;
    The import com.google cannot be resolved&lt;BR /&gt;
    The import com.google cannot be resolved&lt;BR /&gt;
    JsonReader cannot be resolved to a type&lt;BR /&gt;
    JsonToken cannot be resolved to a variable&lt;/P&gt;

&lt;P&gt;Splunk Version :  used splunk 1.5 and 1.6 -- getting same error.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;groupId&amp;gt;com.splunk&amp;lt;/groupId&amp;gt;
&amp;lt;artifactId&amp;gt;splunk&amp;lt;/artifactId&amp;gt;
&amp;lt;version&amp;gt;1.6.2.0&amp;lt;/version&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Code :&lt;BR /&gt;
JobResultsArgs resultsArgs = new JobResultsArgs();&lt;BR /&gt;
resultsArgs.setOutputMode(JobResultsArgs.OutputMode.JSON);&lt;BR /&gt;
InputStream results = automationLeadJob.getResults(resultsArgs);&lt;BR /&gt;
ResultsReaderJson resultsReader = new ResultsReaderJson(results);&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2017 04:19:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/ResultsReaderJson-gives-error-The-import-com-google-cannot-be/m-p/366757#M66364</guid>
      <dc:creator>rpatkar</dc:creator>
      <dc:date>2017-05-08T04:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: ResultsReaderJson gives error The import com.google cannot be resolved and JsonReader cannot be resolved to a type</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/ResultsReaderJson-gives-error-The-import-com-google-cannot-be/m-p/366758#M66365</link>
      <description>&lt;P&gt;For me the following dependencies work fine:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dependency&amp;gt;
    &amp;lt;groupId&amp;gt;com.google.code.gson&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;gson&amp;lt;/artifactId&amp;gt;
    &amp;lt;version&amp;gt;2.8.0&amp;lt;/version&amp;gt;
    &amp;lt;scope&amp;gt;runtime&amp;lt;/scope&amp;gt;
&amp;lt;/dependency&amp;gt;

&amp;lt;dependency&amp;gt;
    &amp;lt;groupId&amp;gt;com.splunk&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;splunk&amp;lt;/artifactId&amp;gt;
    &amp;lt;version&amp;gt;1.5.0.0&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However I couldn't find gson version working with splunk 1.6.x&lt;BR /&gt;
When I downloaded splunk sdk 1.6.2 and built it locally I could run my code using &lt;EM&gt;ResultsReaderJson&lt;/EM&gt; when I added &lt;EM&gt;./dist/splunk-1.6.2.jar&lt;/EM&gt; and &lt;EM&gt;./dist/gson-2.2.4.jar&lt;/EM&gt; to my classpath (IntelliJ). Then I tried to set splunk and gson versions to 1.6.2.0 and 2.2.4 respectively (in my pom.xml), but I got again the exception:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
    The import com.google cannot be resolved
    The import com.google cannot be resolved
    JsonReader cannot be resolved to a type
    JsonReader cannot be resolved to a type
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 May 2017 13:08:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/ResultsReaderJson-gives-error-The-import-com-google-cannot-be/m-p/366758#M66365</guid>
      <dc:creator>tulinski</dc:creator>
      <dc:date>2017-05-09T13:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: ResultsReaderJson gives error The import com.google cannot be resolved and JsonReader cannot be resolved to a type</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/ResultsReaderJson-gives-error-The-import-com-google-cannot-be/m-p/366759#M66366</link>
      <description>&lt;P&gt;Thank you, downgrading to 1.5.0.0 unblocked me.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 23:38:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/ResultsReaderJson-gives-error-The-import-com-google-cannot-be/m-p/366759#M66366</guid>
      <dc:creator>teresap</dc:creator>
      <dc:date>2018-02-21T23:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: ResultsReaderJson gives error The import com.google cannot be resolved and JsonReader cannot be resolved to a type</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/ResultsReaderJson-gives-error-The-import-com-google-cannot-be/m-p/366760#M66367</link>
      <description>&lt;P&gt;Use splunk 1.6,3.0 with gson 2.8. I have been struggling with the same issue and that combination fixed it.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 16:22:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/ResultsReaderJson-gives-error-The-import-com-google-cannot-be/m-p/366760#M66367</guid>
      <dc:creator>f2mahmud</dc:creator>
      <dc:date>2018-03-19T16:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: ResultsReaderJson gives error The import com.google cannot be resolved and JsonReader cannot be resolved to a type</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/ResultsReaderJson-gives-error-The-import-com-google-cannot-be/m-p/366761#M66368</link>
      <description>&lt;P&gt;Hi, &lt;BR /&gt;
even I am facing the same problem just as @rpatkar, and i followed your advice, but still there is no change in the error. Can you help here please?&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
 Mohammed Shahid Nawaz&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 12:25:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/ResultsReaderJson-gives-error-The-import-com-google-cannot-be/m-p/366761#M66368</guid>
      <dc:creator>shahid285</dc:creator>
      <dc:date>2018-11-16T12:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: ResultsReaderJson gives error The import com.google cannot be resolved and JsonReader cannot be resolved to a type</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/ResultsReaderJson-gives-error-The-import-com-google-cannot-be/m-p/366762#M66369</link>
      <description>&lt;P&gt;Use splunk SDK 1.6.5.0 with gson 2.8.2.  This set up works for me fine.&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 18:54:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/ResultsReaderJson-gives-error-The-import-com-google-cannot-be/m-p/366762#M66369</guid>
      <dc:creator>atpsplunk11</dc:creator>
      <dc:date>2019-05-17T18:54:46Z</dc:date>
    </item>
  </channel>
</rss>

