JSON update not working - json

I tried to insert this into sole using the update/json handler:
[{"id":"abc","text":"you have been served"}]
But Solr gives me this hard-to-troubleshoot message. I am using Scala + Dispatch HTTP, whic is new for me. I am kinda experienced with Solr, but this error message is unhelpful. What exactly is this message?
I am using the latest version 3.6, using the start.jar (for testing) and have disabled lazy loading for update/json.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 404 NOT_FOUND</title>
</head>
<body>
<h2>HTTP ERROR: 404</h2>
<p>Problem accessing /update/json. Reason:
<pre> NOT_FOUND</pre></p>
<hr /><i><small>Powered by Jetty://</small></i>
</body>
</html>

Instead of
localhost:8983/solr/update...
I was careless enough to
localhost:8983/update...
My bad.

Related

When form submitted: The character encoding of the html document was not declared (although it is)

I've seen a few questions relating to this, but almost all of them use php. I have just a simple html file, with an input and a button. I've tried using proposed solutions, but I always get the error after I submit the form with the button. I have included the character enconding as utf-8. I also have the <meta charset="utf-8" /> but commented out upon seeing other solutions on SO, which I have implemented to no avail.
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<script src="index.js"></script>
<title>My Page</title>
</head>
<body>
<form name="data-form" enctype="multipart/form-data" method="post">
<input type="file" id="file-input">
<button id="form-btn" type="submit">Load File</button>
</form>
</body>
</html>
Based on my rudimentary understanding, this should read the file no problem. I'm trying to upload a JSON file, not sure if that's the issue. It is a valid JSON, I have checked and double-checked.
The index.js file that is linked, currently does not interact with the file upload in anyway, so in the interest of brevity I have not included it.
EDIT
I "solved" this, I guess. More like bypassed it. I wrote a JS function (readFile()) to read on click, and changed the button's type to type="button" and put an onclick="readFile()" and now it reads the file and eecutes properly. Hopefully maybe this will help someone else who has a similar problem. I guess this can be closed.
See edit. I used a modified version of the IFFE answer posted in this question How to access data of uploaded JSON file?. I'm not sure if this is "technically" the solution but it works for my purposes.

HTMLFile COM object (IHTMLDocument2) breaks in Edge mode, sometimes

I have a web page as a simple string. I'm trying to make an HTMLDocument out of it using the HTMLFile COM object:
$page = #'
<!DOCTYPE html><html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<title>A Title</title>
<script src="/index.js"></script>
</head>
<body>
<div class="findme">Hello</div>
<div>Nope</div>
</body>
</html>
'#
$bytes = [System.Text.Encoding]::Unicode.GetBytes($page);
$html = New-Object -Com "HTMLFile";
try {
# Powershell 4
$html.IHTMLDocument2_write($bytes);
} catch {
# Powershell 5
$html.write($bytes);
}
write $html.documentElement.innerHTML;
As written, this outputs
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>A Title</title>
<script src="/index.js"></script></head>
Note that the entire <body> tag is gone. If I change the meta tag from IE=edge (or IE=11) to IE=9, the output is correct and includes the <body> tag and all its contents. The crazy part is that it works with IE=edge if I take out the <script> tag, or if it's an inline script rather than a src= reference.
Did I do something wrong? The HTML passes the W3C validator so I don't think it's faulty markup. Is there a different mode I can set on the document before the call to .write() to have it parse successfully even with the IE=edge meta-tag?
PS: I wish this wasn't relevant, but it might matter that I don't have Office installed on this machine, because I think that would provide a different implementation for the COM object. Win10 18363, Powershell 5.1.

jekyll error reading configuration,and show nothing on web,my system is win7

When i execute "jekyll server --safe -- watch" on cmd, i have this WARNING:
WARNING: Error reading configuration. Using default .
Configuration file: <INVALID> D:/git/blog/_config.yml
And my html source files is:
/git/blog/index.html:
---
layout: default
---
Hello jekyll
and /git/blog/_layouts/default.html:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>My blog</title>
</head>
<body></body>
</html>
but i get nothing on web page, except the title "My blog",
Is someone had met this before???
You won't see the content Hello jekyll from your HTML source file unless you add the Liquid tag {{ content }} somewhere in your layout file. This is where the content from your pages will be displayed.
Like this:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>My blog</title>
</head>
<body>{{ content }}</body>
</html>
Plus, your config file seems to be missing, like David Jacquel already said in his comment.
This isn't necessarily a bad thing, it's just that Jekyll will use the default configuration when no config file is present.
But the missing config file doesn't have anything to do with the fact that your web page isn't showing anything - that's because of the missing {{ content }} tag, like I said in the beginning!

dojo mobile with phonegap doesn't work properly

I start write application using phonegap and dojo in Eclipse. Phonegap, without dojo work properly on android emulator and in chrome with ripple addon. Problem is when I added dojo to project. I use phonegap 2.7.0 and dojo 1.9.0.
I was using: http://www.ibm.com/developerworks/web/library/wa-mobappdev1/ tutorial to setup this.
How I setup dojo:
index.html file:
<!DOCTYPE HTML>
<html>
<head>
<title>PhoneGap</title>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="stylesheet" href="libs/dojo/dojox/mobile/themes/android/android.css" type="text/css" media="screen" title="no title" charset="utf-8"/>
<script type="text/javascript" src="libs/dojo/dojo/dojo.js" djConfig="parseOnLoad:true"></script>
<script type="text/javascript" charset="utf-8" src="cordova-2.7.0.js"></script>
<script type="text/javascript" charset="UTF-8" src="funkcja.js"></script>
<script type="text/javascript">
dojo.require("dojox.mobile.parser");
dojo.require("dojox.mobile");
dojo.require("dojox.mobile.app");
dojo.require("dojox.mobile.Button");
</script>
</head>
<body>
<div dojoType="dojox.mobile.View" id="site" selected="true">
<h1 dojoType="dojox.mobile.Heading">Index</h1>
<div>
<input dojoType="dojox.mobile.Button" type="button" id="submit" name="submit" value="Button" onclick="loguj()"/>
</div>
</div>
</body>
</html>
In emulator I get a blank screen.
In chrome using ripple I get just html without dojo scripts. Scripts are include. In console I get an errors:
Console was cleared ripple.js:37
Ripple :: Environment Warming Up (Tea. Earl Gray. Hot.) ripple.js:37
Uncaught SyntaxError: Unexpected token u Insertion.js:1
GET http://localhost/config.xml 404 (Not Found) ripple.js:50
cordova :: Initialization Finished (Make it so.) ripple.js:37
GET http://localhost/libs/dojo/dojo/fx/Toggler.js 404 (Not Found) ripple.js:50
Error {src: "dojoLoader", info: "xhrFailed"} dojo.js:15
GET http://localhost/cordova_plugins.json 404 (Not Found) ripple.js:50
Uncaught SyntaxError: Unexpected token < cordova-2.7.0.js:6816
GET http://localhost/libs/dojo/dojo/resources/blank.gif 404 (Not Found) app.js:15
deviceready has not fired after 5 seconds. cordova-2.7.0.js:6672
Channel not fired: onPluginsReady cordova-2.7.0.js:6665
Channel not fired: onCordovaReady cordova-2.7.0.js:6665
Channel not fired: onCordovaConnectionReady cordova-2.7.0.js:6665
deviceready has not fired after 5 seconds. cordova-2.7.0.js:6672
Channel not fired: onPluginsReady cordova-2.7.0.js:6665
Channel not fired: onCordovaReady cordova-2.7.0.js:6665
Channel not fired: onCordovaConnectionReady cordova-2.7.0.js:6665
Dojo tries to load his js files, but can't. I think this answer may work for you too:
PhoneGap / Cordova 1.6 and dojo 1.7.2 AMD works from web, not from local?
Set the djConfig of dojo.js to djConfig="async:false,parseOnLoad:true"
AND load cordova.js before dojo.js !
If it doesnt work & you want to start developing, try to use dojo.js from the web.
Just create a cordova_plugins.json file into www with {} inside.
Alternatively, you can comment out lines 6395->6415 from cordova-2.7.0.js.
I followed the same tutorial on IBM Website and it also did not work.
To make it work I had to do the following:
Remove djConfig="parseOnLoad:true"
Replace
dojo.require("dojox.mobile.parser");
dojo.require("dojox.mobile");
dojo.require("dojox.mobile.app");
dojo.require("dojox.mobile.Button");
with:
require(["dojox/mobile/parser", "dojox/mobile", "dojox/mobile/app", "dojox/mobile/Button", "dojo/domReady!"],
function(parser) {
parser.parse();
}
);

hiutil not indexing properly in Mountain Lion?

I use Voodoopad to create my help docs, as described here. Basically I have a Run Script build phase which tells Voodoopad to export my document as html. The Voodoopad doc is set to run hiutil to create the help index when it exports.
After noticing that many of my help anchors weren't working, I traced it back to hiutil. When I run hiutil on the html exported from Voodoopad, I get a bunch of errors:
Zach-iMac:Desktop zach$ hiutil -a --create Help/ --file Help/Help.helpindex -1 -vvv
index.html -- Parse error: The operation couldn’t be completed. (NSXMLParserErrorDomain error 76.)
index.html -- Parse error: Error 76, Description: (null), Line: 14, Column: 8
index.html -- Finished parsing
These errors are repeated for every single file. Line 14, column 8 is the closing of the head tag. The first part of every file is basically the same:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta name="AppleTitle" content="VideoBuffet Help">
<meta name="AppleIcon" content="appicon16.png">
<title>Index</title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="1138.23">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'}
</style>
</head>
<body>
This exact HTML used to work just fine with hiutil. Since the last time I've run this I upgraded to Mountain Lion and Xcode 4.5.
Is anyone else using hiutil, and is it working for you?
If you use this prologue at the top of your HTML file:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
and run your HTML through a validator like http://validator.w3.org/#validate_by_upload+with_options
and fix all the problems until the validator returns success, it should work with hiutil 1.3. It did for me anyway.
See also http://lists.apple.com/archives/apple-help-authoring/2012/Sep/msg00018.html
It's not a proper answer, but my workaround is to use the version of hiutil that shipped with Lion (1.2) to build my help index.
I'm not very happy with this, but it will do for now. If anyone has this issue, and wants to learn how to do it, you can read my blog post about it.
Update: posted rdar://12326432
Update: I've heard from Apple this is a duplicate of bug #11981648 (which is still open at this moment).