Return-Path: Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: (qmail 43567 invoked from network); 9 Mar 2011 04:08:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Mar 2011 04:08:22 -0000 Received: (qmail 45589 invoked by uid 500); 9 Mar 2011 04:08:21 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 45534 invoked by uid 500); 9 Mar 2011 04:08:21 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 45524 invoked by uid 99); 9 Mar 2011 04:08:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Mar 2011 04:08:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Mar 2011 04:08:20 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 828703A0C47 for ; Wed, 9 Mar 2011 04:07:59 +0000 (UTC) Date: Wed, 9 Mar 2011 04:07:59 +0000 (UTC) From: "Mike Mattozzi (JIRA)" To: dev@lucene.apache.org Message-ID: <151851028.7028.1299643679531.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Updated: (SOLR-1752) SolrJ fails with exception when passing document ADD and DELETEs in the same request using XML request writer (but not binary request writer) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SOLR-1752?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mike Mattozzi updated SOLR-1752: -------------------------------- Attachment: SOLR-1752.patch I ran into this problem today and was surprised it hadn't been fixed. I've attached a patch to UpdateRequest that maintains an ordered list that can be a mix of SolrInputDocuments to add, ids to delete, and delete queries. There's a few places where my patch iterates over documents instead of doing an addAll so there may be some inefficiencies. It seems like these would be outweighed by the ability to group up update operations, but I could always optimize more. > SolrJ fails with exception when passing document ADD and DELETEs in the same request using XML request writer (but not binary request writer) > --------------------------------------------------------------------------------------------------------------------------------------------- > > Key: SOLR-1752 > URL: https://issues.apache.org/jira/browse/SOLR-1752 > Project: Solr > Issue Type: Bug > Components: clients - java, update > Affects Versions: 1.4 > Reporter: Jayson Minard > Assignee: Shalin Shekhar Mangar > Priority: Blocker > Attachments: SOLR-1752.patch > > > Add this test to SolrExampleTests.java and it will fail when using the XML Request Writer (now default), but not if you change the SolrExampleJettyTest to use the BinaryRequestWriter. > {code} > public void testAddDeleteInSameRequest() throws Exception { > SolrServer server = getSolrServer(); > SolrInputDocument doc3 = new SolrInputDocument(); > doc3.addField( "id", "id3", 1.0f ); > doc3.addField( "name", "doc3", 1.0f ); > doc3.addField( "price", 10 ); > UpdateRequest up = new UpdateRequest(); > up.add( doc3 ); > up.deleteById("id001"); > up.setWaitFlush(false); > up.setWaitSearcher(false); > up.process( server ); > } > {code} > terminates with exception: > {code} > Feb 3, 2010 8:55:34 AM org.apache.solr.common.SolrException log > SEVERE: org.apache.solr.common.SolrException: Illegal to have multiple roots (start tag in epilog?). > at [row,col {unknown-source}]: [1,125] > at org.apache.solr.handler.XMLLoader.load(XMLLoader.java:72) > at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:54) > at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131) > at org.apache.solr.core.SolrCore.execute(SolrCore.java:1316) > at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:338) > at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:241) > at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089) > at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365) > at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) > at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712) > at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) > at org.mortbay.jetty.Server.handle(Server.java:285) > at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:502) > at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:835) > at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:723) > at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:202) > at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:378) > at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:226) > at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442) > Caused by: com.ctc.wstx.exc.WstxParsingException: Illegal to have multiple roots (start tag in epilog?). > at [row,col {unknown-source}]: [1,125] > at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:630) > at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:461) > at com.ctc.wstx.sr.BasicStreamReader.handleExtraRoot(BasicStreamReader.java:2155) > at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2070) > at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2647) > at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019) > at org.apache.solr.handler.XMLLoader.processUpdate(XMLLoader.java:90) > at org.apache.solr.handler.XMLLoader.load(XMLLoader.java:69) > ... 18 more > {code} -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org