Can u take a look at the Solr logs and see what is hapening? On Wed, Apr 1, 2009 at 3:19 PM, Radha C. <cra...@ceiindia.com> wrote: > > Thanks Paul, > > I changed the URL but I am getting another error - Bad request , Any help > will be appriciated. > > Exception in thread "main" org.apache.solr.common.SolrException: Bad Request > Bad Request > request: http://localhost:8080/solr/update?wt=javabin > at > org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:428) > at > org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:245) > at > org.apache.solr.client.solrj.request.UpdateRequest.process(UpdateRequest.java:243) > at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:48) > at SolrIndexTest.main(SolrIndexTest.java:47) > Java Result: 1 > > > > > -----Original Message----- > From: Noble Paul നോബിള് नोब्ळ् [mailto:noble.p...@gmail.com] > Sent: Wednesday, April 01, 2009 2:26 PM > To: solr-user@lucene.apache.org; cra...@ceiindia.com > Subject: Re: Runtime exception when adding documents using solrj > > the url is wrong > try this > CommonsHttpSolrServer server = new > CommonsHttpSolrServer("http://localhost:8080/solr/"); > > On Wed, Apr 1, 2009 at 2:04 PM, Radha C. <cra...@ceiindia.com> wrote: >> >> Can anyone please tell me , what is the issue with the below java code.. >> >> -----Original Message----- >> From: Radha C. [mailto:cra...@ceiindia.com] >> Sent: Wednesday, April 01, 2009 12:28 PM >> To: solr-user@lucene.apache.org >> Subject: RE: Runtime exception when adding documents using solrj >> >> >> I am using Solr 1.3 version >> >> _____ >> >> From: Noble Paul നോബിള് नोब्ळ् [mailto:noble.p...@gmail.com] >> Sent: Wednesday, April 01, 2009 12:16 PM >> To: solr-user@lucene.apache.org; cra...@ceiindia.com >> Subject: Re: Runtime exception when adding documents using solrj >> >> >> which version of Solr are you using? >> >> >> On Wed, Apr 1, 2009 at 12:01 PM, Radha C. <cra...@ceiindia.com> wrote: >> >> >> Hi All, >> >> I am trying to index documents by using solrj client. I have written a >> simple code below, >> >> { >> CommonsHttpSolrServer server = new >> CommonsHttpSolrServer("http://localhost:8080/solr/update"); >> SolrInputDocument doc1=new SolrInputDocument(); >> doc1.addField( "id", "id1", 1.0f ); >> doc1.addField( "name", "doc1", 1.0f ); >> doc1.addField( "price", 10 ); >> SolrInputDocument doc2 = new SolrInputDocument(); >> doc2.addField( "id", "id2", 1.0f ); >> doc2.addField( "name", "doc2", 1.0f ); >> doc2.addField( "price", 20 ); >> Collection<SolrInputDocument> docs = new >> ArrayList<SolrInputDocument>(); >> docs.add( doc1 ); >> docs.add( doc2 ); >> server.add(docs); >> server.commit(); >> } >> >> But I am getting the below error, Can anyone tell me what is the wrong >> with the above code. >> >> Exception in thread "main" java.lang.RuntimeException: Invalid version >> or the data in not in 'javabin' format >> at >> org.apache.solr.common.util.JavaBinCodec.unmarshal(JavaBinCodec.java:9 >> 8) >> at >> org.apache.solr.client.solrj.impl.BinaryResponseParser.processResponse >> (Binar >> yResponseParser.java:39) >> at >> org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(Common >> sHttpS >> olrServer.java:470) >> at >> org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(Common >> sHttpS >> olrServer.java:245) >> at >> org.apache.solr.client.solrj.request.UpdateRequest.process(UpdateReque >> st.jav >> a:243) >> at >> org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:48) >> at SolrIndexTest.main(SolrIndexTest.java:46) >> Java Result: 1 >> >> >> >> >> >> >> -- >> --Noble Paul >> >> > > > > -- > --Noble Paul > >
-- --Noble Paul