Return-Path: Delivered-To: apmail-lucene-solr-dev-archive@locus.apache.org Received: (qmail 74605 invoked from network); 4 Feb 2007 11:07:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Feb 2007 11:07:22 -0000 Received: (qmail 44766 invoked by uid 500); 4 Feb 2007 11:07:28 -0000 Delivered-To: apmail-lucene-solr-dev-archive@lucene.apache.org Received: (qmail 44745 invoked by uid 500); 4 Feb 2007 11:07:27 -0000 Mailing-List: contact solr-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-dev@lucene.apache.org Delivered-To: mailing list solr-dev@lucene.apache.org Received: (qmail 44736 invoked by uid 99); 4 Feb 2007 11:07:27 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Feb 2007 03:07:27 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [81.169.146.188] (HELO mo-p07-ob.rzone.de) (81.169.146.188) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Feb 2007 03:07:17 -0800 Received: from [192.168.1.33] (121.Red-83-58-66.dynamicIP.rima-tde.net [83.58.66.121]) by post.webmailer.de (klopstock mo50) (RZmta 4.4) with ESMTP id B0367bj146FKUx for ; Sun, 4 Feb 2007 12:06:53 +0100 (MET) Subject: Re: Connecting custom RequestHandler From: Thorsten Scherler To: solr-dev@lucene.apache.org In-Reply-To: <176776ee0702031841x6e4d0b10i969a2f44851b2a7e@mail.gmail.com> References: <1170522875.19301.14.camel@cartman> <1170532711.27886.4.camel@cartman> <176776ee0702031841x6e4d0b10i969a2f44851b2a7e@mail.gmail.com> Content-Type: text/plain Date: Sun, 04 Feb 2007 11:06:51 +0100 Message-Id: <1170583612.5120.5.camel@cartman> Mime-Version: 1.0 X-Mailer: Evolution 2.8.1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Sat, 2007-02-03 at 18:41 -0800, Ryan McKinley wrote: > The 'new' request parser reads the content type header to see if it > should parse the body as params or not. If the content type is > "application/x-www-form-urlencoded" it parses them as params, if it is > "multipart/*" it parses them as multipart. if it is *anything* else, > it reads the body as a stream. > > curl defaults the content type to "application/x-www-form-urlencoded" > > so you will need to run curl with -H "Content-Type: text/xml > > - - - - - - - Hmm, I patched the post.sh only regarding the URL. FILES=$* URL=http://localhost:8983/solr/update/stax for f in $FILES; do echo Posting file $f to $URL curl $URL --data-binary @$f -H 'Content-type:text/xml; charset=utf-8' echo done Meaning what you describe is already in there. I now played around again with it and surprise it works now. Thanks Ryan. > > I should add this to the wiki. > > Can we change the post.sh to use -H "Content-Type: text/xml"? This > will not affect old updater and will work for new UpdateHandlers. It is see above. Not sure why it did not work the yesterday. Thanks for the feedback. salu2 > ryan > > > On 2/3/07, Thorsten Scherler wrote: > > On Sat, 2007-02-03 at 18:14 +0100, Thorsten Scherler wrote: > > > Hi all, > > > > > > I am working on SOLR-133 and I have wrapped up a first version of the > > > XmlUpdateRequestHandlerStax.java. Now I am trying to connect it in the > > > example but I have some problems. > > > > > > I am trying: > > > > > class="solr.XmlUpdateRequestHandlerStax" /> > > > > > > Trying to curl to URL=http://localhost:8983/solr/update/stax > > > > Debugging this I used http://localhost:8983/solr/update/xml and I get > > the same error. > > > > So I figured that we still use the SolrUpdateServlet @Deprecated in the > > post.sh. > > > > For now I can test the StAX changing > > XmlUpdateRequestHandlerStax legacyUpdateHandler; > > and implementing a doLegacyUpdate method in the handler. > > > > salu2 > > > > > I get: > > > Posting file solr.xml to http://localhost:8983/solr/update/stax > > > > > > > > > 0 > > name="QTime">67 > > > > > > > > > > > > > > > Error 400 missing content stream stax > > > > > > > > >

HTTP ERROR: 400

missing content stream stax
> > >

RequestURI=/solr/update/stax

> > > ... > > > > > > What did I forget that the content stream is not passed to the method? > > > > > > Any tip, hint or shoot in the dark welcome. > > > > > > > > > salu2 > > -- > > Thorsten Scherler thorsten.at.apache.org > > Open Source Java & XML consulting, training and solutions > > > > -- Thorsten Scherler thorsten.at.apache.org Open Source Java & XML consulting, training and solutions