Hi Ranjeet,
try this in your Spring config:

<bean id="solrServer"
class="org.apache.solr.client.solrj.impl.CommonsHttpSolrServer">

  <constructor-arg><value>http://solr_url:8080/</value></constructor-arg>

  <property name="connectionTimeout" value="100"/>

  <property name="defaultMaxConnectionsPerHost" value="100"/>

  <property name="maxTotalConnections" value="100"/>

</bean>



and inject it to you service like this:

<bean id="someService" class="service.SomeServiceImpl">

  <property name="server" ref="solrServer"/>

  </bean>



and you have to have a setter in SomeService for the prop. server
(solrServer), off course.

Hope this helps,

Tomislav


2008/8/4 Ranjeet <[EMAIL PROTECTED]>

> Hi,
>
> I am using Solr 1.3 and Solrj as a Java Client. I am Integarating Solrj in
> Spring framwork, I am facing a problem, Spring framework is not inializing
> CommonsHttpSolrServer class, how can  I define this class to get the
> instance of SolrServer to invoke furthur method on this.
>
> Thanks & Regards,
> Ranjeet Jha

Reply via email to