Getting Data In

Exception in thread "main" com.splunk.HttpException: HTTP 404

charanrajd1328
Observer

Java Code;

package com.ibm.splunk;

import java.util.HashMap;
import java.util.Map;
import com.splunk.Service;
import com.splunk.Args;
import com.splunk.Receiver;

public class SplunkService {

public static void main(String[] args) {

Map<String,Object> splunkObj = new HashMap<String,Object>();
splunkObj.put("host","localhost");
splunkObj.put("username","admin");
splunkObj.put("password","password");
splunkObj.put("port",8000);
splunkObj.put("scheme","http");

Service splunkLogObj = Service.connect(splunkObj);
Receiver splunkLogReceiver = splunkLogObj.getReceiver();

Args logDebug = new Args();
logDebug.put("sourceType","hellosplunk");

splunkLogReceiver.log("main", logDebug, "sql");


}

}

After executing I am getting following exception

Exception in thread "main" com.splunk.HttpException: HTTP 404 -- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
This is a static HTML string template to render errors. To edit this
template, see appserver/mrsparkle/lib/error.py.
-->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:splunk="http://www.splunk.com/xhtml-extensions/1.0" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="referrer" content="never" />
<meta name="referrer" content="no-referrer" />
<link rel="shortcut icon" href="/en-US/static/@90D01B29FA360636D5CB8D409133AAB811AFD803520AA382919A97DB376D5500/img/favicon.ico" />
<title>Page not found! - Splunk</title>
<style>
@font-face {
font-family: "Splunk Sans";
src: url('/static/fonts/proxima-regular-webfont.woff') format('woff');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: "Splunk Mono";
src: url('/static/fonts/inconsolata-regular.woff') format('woff');
font-weight: 400;
font-style: normal;
}
* { margin: 0; padding: 0; }
body { font-family: "Splunk Sans", "Proxima Nova", Roboto, Droid, "Helvetica Neue", Helvetica, Arial, sans-serif; color: #3C444D; background-color: #F2F4F5; position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
a { color: #007ABD; text-decoration: none; }
a:hover { text-decoration: underline; }
p,pre { margin-bottom: 1em; }
.status { color: #818D99; margin: 20px; }
.msg { margin-bottom: 1em; font-size: 1.4em;}
pre { font-family: Monaco,Courier Bold,Courier New,monospace; font-size: .7em;background-color: #eee; padding: 5px;}
#toggle { font-size: .8em; margin-bottom: 1em; }
.byline { color: #555; }
.byline span { font-weight: bold; line-height: 1.4em; }
hr { height: 1px; background-color: #c3cbd4; border: 0; margin: 20px 0 10px; }
h1 { font-size: 100px; margin-bottom: 10px; }
h2 { font-size: 1em; margin-bottom: 1em; }
table { border-collapse: collapse; }
td { padding: 2px; }
td.k { font-family: helvetica neue, helvetica, arial, sans-serif; font-weight: bold; }
#debug { display: none; }
#crashes { margin: 20px 0; padding: 10px; border: 1px solid #800; }
#crashes dt { font-size: 12px; margin-bottom: 5px; }
#crashes dd { white-space: pre; background: #f2f2f2; padding: 10px; margin-left: 20px; display: none; font-size: 11px; font-family: "Splunk Mono", Inconsolata, Consolas, "Droid Sans Mono", Monaco, "Courier New", Courier, monospace; }
.fixed-width { width: 960px; margin: auto; }
.error-wrapper { height: 60%; min-height: 400px; margin-top: 10vh; }
.error-container { z-index: 10; display: table; }
.error-image { float: left; margin-left: 80px; }
.error-message { display: inline-block; margin: 60px 0 0 100px; width: 600px; }
.error-message p { font-size: 18px; }
.error-background { color: #B8C2CC; position: absolute; margin-top: 260px; height: 96px; z-index: -10; line-height: 16px; user-select: none; font-size: 11px; font-family: "Splunk Mono", Inconsolata, Consolas, "Droid Sans Mono", Monaco, "Courier New", Courier, monospace; }
.main-error-background { height: 80px; width: 76%; overflow: hidden; text-overflow: clip; }
.error-offset-background { position: absolute; top: 0; left: 65%; width: 150px; }
.offset-background { position: absolute; white-space: nowrap; }
.offset-1 { top: 19px; left: 50px; transform: rotate(12deg); -webkit-transform: rotate(12deg); -ms-transform: rotate(12deg); }
.offset-2 { top: 10px; left: 20px; transform: rotate(41deg); -webkit-transform: rotate(41deg); -ms-transform: rotate(41deg); }
.offset-3 { top: 4px; left: 40px; transform: rotate(-3deg); -webkit-transform: rotate(-3deg); -ms-transform: rotate(-3deg); }
.offset-4 { top: 30px; left: 106px; transform: rotate(-13deg); -webkit-transform: rotate(-13deg); -ms-transform: rotate(-13deg); }
.offset-5 { top: 29px; left: 125px; }
.offset-6 { top: 21px; left: 239px; }
.offset-7 { top: 37px; left: 198px; }
.offset-8 { top: 58px; left: 237px; }
.offset-9 { top: 46px; left: 194px; transform: rotate(-18deg); -webkit-transform: rotate(-18deg); -ms-transform: rotate(-18deg); }
.offset-10 { top: 52px; left: 203px; transform: rotate(41deg); -webkit-transform: rotate(41deg); -ms-transform: rotate(41deg); }
.offset-11 { top: 63px; left: 239px; transform: rotate(-3deg); -webkit-transform: rotate(-3deg); -ms-transform: rotate(-3deg); }
.offset-12 { top: 56px; left: 61px; transform: rotate(-3deg); -webkit-transform: rotate(-3deg); -ms-transform: rotate(-3deg); }
.offset-13 { top: 88px; left: 65px; transform: rotate(41deg); -webkit-transform: rotate(41deg); -ms-transform: rotate(41deg); }
.offset-14 { top: 100px; left: 0px; transform: rotate(-30deg); -webkit-transform: rotate(-30deg); -ms-transform: rotate(-30deg); }
.message-wrapper { padding: 20px; margin-top: 20px; clear: both; border-top: 1px solid #C3CBD4; }
.message-container { padding: 0 0 10px 0; }
.message-container:empty { padding: 0; }
</style>
<script>
function toggle(what) {
what = document.getElementById(what);
if (what.style.display == 'block') {
what.style.display = 'none';
} else {
what.style.display = 'block';
}
}
</script>
</head>
<body>
<p class="status" data-role="page-status">404 Not Found</p>
<div class="error-wrapper">
<div class="error-background">
<div class="main-error-background">
12.130.60.4 - - [05/Mar/2014 18:10:57:153] "GET /category.screen?category_id=GIFTS&JSESSIONID=SD1SL4FF10ADFF10 HTTP 1.1" 404 720 "http://buttercup-shopping.com/cart.do?action=view&itemId=EST-6&product_id=FI-SW-01" "Opera/9.20 (Windows NT 6.0; U; en)" 559 128.241.220.82 - - [05/Mar/2014 18:10:57:123] "GET /product.screen?product_id=FL-DSH-01&JSESSIONID=SD5SL7FF6ADFF9 HTTP 1.1" 404 3322 "http://buttercup-shopping.com/category.screen?category_id=GIFTS" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)" 317 27.160.0.0 - - [05/Mar/2014 18:10:56:156] "GET /oldlink?item_id=EST-26&JSESSIONID=SD5SL9FF1ADFF3 HTTP 1.1" 200 1318 "http://buttercup-shopping.com/cart.do?action=purchase&itemId=EST-26&product_id=K9-CW-01" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)" 468 12.130.60.4 - - [05/Mar/2014 18:10:57:153] "GET /category.screen?category_id=GIFTS&JSESSIONID=SD1SL4FF10ADFF10 HTTP 1.1" 404 720 "http://buttercup-shopping.com/cart.do?action=view&itemId=EST-6&product_id=FI-SW-01" "Opera/9.20 (Windows NT 6.0; U; en)" 559 128.241.220.82 - - [05/Mar/2014 18:10:57:123] "GET /product.screen?product_id=FL-DSH-01&JSESSIONID=SD5SL7FF6ADFF9 HTTP 1.1" 404 3322 "http://buttercup-shopping.com/category.screen?category_id=GIFTS" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)" 317 27.160.0.0 - - [05/Mar/2014 18:10:56:156] "GET /oldlink?item_id=EST-26&JSESSIONID=SD5SL9FF1ADFF3 HTTP 1.1" 200 1318 "http://buttercup-shopping.com/cart.do?action=purchase&itemId=EST-26&product_id=K9-CW-01" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)" 468 12.130.60.4 - - [05/Mar/2014 18:10:57:153] "GET /category.screen?category_id=GIFTS&JSESSIONID=SD1SL4FF10ADFF10 HTTP 1.1" 404 720 "http://buttercup-shopping.com/cart.do?action=view&itemId=EST-6&product_id=FI-SW-01" "Opera/9.20 (Windows NT 6.0; U; en)" 559 128.241.220.82 - - [05/Mar/2014 18:10:57:123] "GET /product.screen?product_id=FL-DSH-01&JSESSIONID=SD5SL7FF6ADFF9 HTTP 1.1" 404 3322 "http://buttercup-shopping.com/category.screen?category_id=GIFTS" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)" 317 27.160.0.0 - - [05/Mar/2014 18:10:56:156] "GET /oldlink?item_id=EST-26&JSESSIONID=SD5SL9FF1ADFF3 HTTP 1.1" 200 1318 "http://buttercup-shopping.com/cart.do?action=purchase&itemId=EST-26&product_id=K9-CW-01" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)" 468
</div>
<div class="error-offset-background">
<div class="offset-1 offset-background">
"http://buttercup-shopping.com/cart.do?actio
</div>
<div class="offset-2 offset-background">
view&itemId=EST-6
</div>
<div class="offset-3 offset-background">
reen?category_id=GIFTS&JSESSIONID
</div>
<div class="offset-4 offset-background">
JSESSIONID
</div>
<div class="offset-5 offset-background">
18:10:57:153
</div>
<div class="offset-6 offset-background">
action
</div>
<div class="offset-7 offset-background">
shopping.com
</div>
<div class="offset-8 offset-background">
404
</div>
<div class="offset-9 offset-background">
12.130.60.4
</div>
<div class="offset-10 offset-background">
SD1SL4FF10ADFF10
</div>
<div class="offset-11 offset-background">
GET /category.screen?
</div>
<div class="offset-12 offset-background">
category_id
</div>
<div class="offset-13 offset-background">
&product_id=FI-SW-01
</div>
<div class="offset-14 offset-background">
JSESSIONID
</div>
</div>

</div>
<div class="error-container fixed-width">
<div class="error-image" data-role="error-image">
<svg width="147px" height="391px" viewBox="339 122 147 391" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(341.964620, 124.258095)">
<path d="M30.8324637,383.060345 C30.8324637,385.005323 48.2226765,386.583023 69.673423,386.583023 C91.1241695,386.583023 108.514382,385.005323 108.514382,383.060345 C108.514382,381.115367 91.1241695,379.537667 69.673423,379.537667 C48.2226765,379.537667 30.8324637,381.115367 30.8324637,383.060345" id="Fill-1" fill="#221F20" transform="translate(69.673423, 383.060345) scale(1, -1) translate(-69.673423, -383.060345) "></path>
<path d="M89.4503057,375.876595 C93.0743835,375.820647 93.4669839,373.36376 ........ 501.389179"></polygon>
<ellipse id="Oval-3" stroke="none" fill="#FFFFFF" fill-rule="evenodd" cx="406.744014" cy="191.337682" rx="1.74401396" ry="2.33768157"></ellipse>
<ellipse id="Oval-3" stroke="none" fill="#FFFFFF" fill-rule="evenodd" cx="437.44693" cy="188.92924" rx="1.44693017" ry="1.92924022"></ellipse>
</svg>
</div>
<div class="error-message">
<h1 data-role="error-title">Oops.</h1>
<p data-role="error-message">Page not found! Click <a href="/" data-role="return-to-splunk-home">here</a> to return to Splunk homepage.</p>
</div>
</div>
</div>
<div class="message-wrapper">
<div class="message-container fixed-width" data-role="more-results"><a href="/en-US/app/search/search?q=index%3D_internal%20host%3D%22DESKTOP-OCM7KU1%22%20source%3D%2Aweb_service.log%20log_level%3DERROR%20requestid%3D5f79fbcf721d31000b048" target="_blank">View more information about your request (request ID = 5f79fbcf721d31000b048) in Search</a></div>
<div class="message-container fixed-width" data-role="crashes"></div>
<div class="message-container fixed-width" data-role="refferer"></div>
<div class="message-container fixed-width" data-role="debug"></div>
<div class="message-container fixed-width" data-role="byline">
<p class="byline">.</p>
</div>
</div>
</body>
</html>

at com.splunk.HttpException.create(HttpException.java:84)
at com.splunk.HttpService.send(HttpService.java:500)
at com.splunk.Service.send(Service.java:1295)
at com.splunk.HttpService.post(HttpService.java:348)
at com.splunk.Service.login(Service.java:1124)
at com.splunk.Service.login(Service.java:1103)
at com.splunk.Service.connect(Service.java:189)
at com.ibm.splunk.SplunkService.main(SplunkService.java:20)

Please help me

Labels (2)
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...