HTTP response code: 400 error

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

HTTP response code: 400 error

Spencer Tickner
Hi List,

Thanks in advance for the help. I'm new to Solr and ran across a bit
of a problem. I installed Solr with the Jetty and tested the
exampledocs. Everything went great. Next I tried adding one of my own
documents to the collection. The XML is below:

test.xml

<add>
    <doc>
        <field name="id">123456789</field>
        <field name="url">http://localhost/testing.xml</field>
        <field name="title">Testing</field>
        <field name="name">Testing</field>
        <field name="creationDate">2007-06-16</field>
        <field name="rating">10</field>
        <field name="content">A Test piece of legislation</field>
        <field name="published">on</field>
    </doc>
</add>

when I try to post it with the default:

java -jar post.jar text.xml

I get the error:

SimplePostTool: FATAL: Conncection error (is Solr running at
http://localhost:8983/solr/update ?): java.io.IOException: Server
returned HTTP response code: 400 f or URL:
http://localhost:8983/solr/update

I've made sure that my XML Document is UTF-8, the test.xml is UTF-8
and that other exampledocs still post. If anyone had any advice as to
where to go from here it would be much appreciated.

Thanks,

Spencer
Reply | Threaded
Open this post in threaded view
|

Re: HTTP response code: 400 error

Brian Whitman

> Hi List,
>
> Thanks in advance for the help. I'm new to Solr and ran across a bit
> of a problem. I installed Solr with the Jetty and tested the
> exampledocs. Everything went great. Next I tried adding one of my own
> documents to the collection. The XML is below:
>
Are you running the example without changing the schema? The example  
schema doesn't have all of those fields. If you look at your Jetty  
log, you'll see the real error, which is

Jun 19, 2007 2:02:04 PM org.apache.solr.common.SolrException log
SEVERE: org.apache.solr.common.SolrException: ERROR:unknown field  
'title'

It's probably a Solr bug that the post.jar does not return a useful  
error message, but otherwise you should read up on the schema and  
change it for your use before posting that xml.




Reply | Threaded
Open this post in threaded view
|

Re: HTTP response code: 400 error

Yonik Seeley-2
On 6/19/07, Brian Whitman <[hidden email]> wrote:

>
> > Hi List,
> >
> > Thanks in advance for the help. I'm new to Solr and ran across a bit
> > of a problem. I installed Solr with the Jetty and tested the
> > exampledocs. Everything went great. Next I tried adding one of my own
> > documents to the collection. The XML is below:
> >
> Are you running the example without changing the schema? The example
> schema doesn't have all of those fields. If you look at your Jetty
> log, you'll see the real error, which is
>
> Jun 19, 2007 2:02:04 PM org.apache.solr.common.SolrException log
> SEVERE: org.apache.solr.common.SolrException: ERROR:unknown field
> 'title'
>
> It's probably a Solr bug that the post.jar does not return a useful
> error message

Or a Java bug?
http://www.innovation.ch/java/HTTPClient/urlcon_vs_httpclient.html
I'm not sure if it's possible to get the extra info with Java's
built-in HTTP client.

Spencer, does post.sh give you more error info?

-Yonik
Reply | Threaded
Open this post in threaded view
|

Re: HTTP response code: 400 error

Spencer Tickner
Hi Guys,

Thanks very much for the response. Brian you were correct. I was
following a separate tutorial where the fields had been added to the
schema.

Cheers,

Spencer

On 6/19/07, Yonik Seeley <[hidden email]> wrote:

> On 6/19/07, Brian Whitman <[hidden email]> wrote:
> >
> > > Hi List,
> > >
> > > Thanks in advance for the help. I'm new to Solr and ran across a bit
> > > of a problem. I installed Solr with the Jetty and tested the
> > > exampledocs. Everything went great. Next I tried adding one of my own
> > > documents to the collection. The XML is below:
> > >
> > Are you running the example without changing the schema? The example
> > schema doesn't have all of those fields. If you look at your Jetty
> > log, you'll see the real error, which is
> >
> > Jun 19, 2007 2:02:04 PM org.apache.solr.common.SolrException log
> > SEVERE: org.apache.solr.common.SolrException: ERROR:unknown field
> > 'title'
> >
> > It's probably a Solr bug that the post.jar does not return a useful
> > error message
>
> Or a Java bug?
> http://www.innovation.ch/java/HTTPClient/urlcon_vs_httpclient.html
> I'm not sure if it's possible to get the extra info with Java's
> built-in HTTP client.
>
> Spencer, does post.sh give you more error info?
>
> -Yonik
>
Reply | Threaded
Open this post in threaded view
|

Re: HTTP response code: 400 error

Brian Whitman
In reply to this post by Yonik Seeley-2

On Jun 19, 2007, at 2:09 PM, Yonik Seeley wrote:
>
> Or a Java bug?
> http://www.innovation.ch/java/HTTPClient/urlcon_vs_httpclient.html
> I'm not sure if it's possible to get the extra info with Java's
> built-in HTTP client.
>
> Spencer, does post.sh give you more error info?
>

Does for me, not very prettily but it does:

bwhitman$ ./post.sh test.xml
Posting file test.xml to http://localhost:8983/solr/update
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;  
charset=ISO-8859-1"/>
<title>Error 400 </title>
</head>
<body><h2>HTTP ERROR: 400</h2><pre>ERROR:unknown field 'title'</pre>
<p>RequestURI=/solr/update</p><p><i><small><a href="http://
jetty.mortbay.org/">Powered by Jetty://</a></small></i></p><br/>
<br/>