Quantcast
Channel: Questions in topic: "splunk-enterprise"
Viewing all articles
Browse latest Browse all 47296

Getting ClassCastException with Service.connect for Splunk sdk Java

$
0
0
Hi, I am using Splunk sdk for Java to access splunk REST API endpoints. I am trying to call API as per below code: Code Snippet: ... Map connectArgs=new HashMap(); connectArgs.put("host", "splunk"); connectArgs.put("username", "username"); connectArgs.put("password", "pass"); connectArgs.put("port", "8089"); connectArgs.put("scheme", "https"); Service splunkService=Service.connect(connectArgs); //Line with exception ... It gives ClassCastException at service call "Service splunkService=Service.connect(connectArgs); ". Please find below for exception log: ... Exception in thread "main" java.lang.ClassCastException: java.base/java.lang.String cannot be cast to java.base/java.lang.Integer at com.splunk.Service.(Service.java:166) ... Is there any dependency needs to be added to avoid exception. Please let me know where is the issue. Thanks,

Viewing all articles
Browse latest Browse all 47296


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>