You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Noor <no...@opentechindia.com> on 2009/06/12 12:56:50 UTC

Custom Request handler Error:

hi,
  i am new to apache solr.
I need to create a custom request handler class. So i create a new one 
and changed the solr-config.xml file as,
   <requestHandler name="/select" class="solr.my.MyCustomHandler">
        <lst name="defaults">
            <str name="echoParams">explicit</str>
            <str name="q">tandem</str>
            <str name="debugQuery">true</str>
        </lst>
    </requestHandler>

And in my java class, the code is,

public class MyCustomHandler extends RequestHandlerBase{
   public CoreContainer coreContainer;
   public void handleRequestBody(SolrQueryRequest request, 
SolrQueryResponse response) throws Exception {
        SolrCore coreToRequest = coreContainer.getCore("core2");
        ModifiableSolrParams params = new ModifiableSolrParams();
        params.set("echoParams", "explicit");
        params.set("q", "text");
        params.set("debugQuery", "true");
request = new LocalSolrQueryRequest(coreToRequest, params);
//      
        SolrRequestHandler reqHandler = 
coreToRequest.getRequestHandler("/select");
        coreToRequest.execute(reqHandler, request, response);
        coreToRequest.close();
        request.close();
    }
  // the abstract methods - getDescription(), getSourceId(), 
getSource(), getVersion() are //overrided... but these methods doesn't 
have any implementations.
}


But, if i search any text in my webapp from browser, gots the HTTP 500 
error.
i dont know how SolrContainer is intialized....
Pls anyone give me the solution...

thanks and regards,
Mohamed

Re: Custom Request handler Error:

Posted by noor <no...@opentechindia.com>.
Yes,

Nullpointer Exception. on the line

SolrCore coreToRequest = coreContainer.getCore("core2");


Noble Paul ??????? ?????? wrote:
> is there any error on the console?
>
> On Fri, Jun 12, 2009 at 4:26 PM, Noor<no...@opentechindia.com> wrote:
>   
>> hi,
>>  i am new to apache solr.
>> I need to create a custom request handler class. So i create a new one and
>> changed the solr-config.xml file as,
>>  <requestHandler name="/select" class="solr.my.MyCustomHandler">
>>       <lst name="defaults">
>>           <str name="echoParams">explicit</str>
>>           <str name="q">tandem</str>
>>           <str name="debugQuery">true</str>
>>       </lst>
>>   </requestHandler>
>>
>> And in my java class, the code is,
>>
>> public class MyCustomHandler extends RequestHandlerBase{
>>  public CoreContainer coreContainer;
>>  public void handleRequestBody(SolrQueryRequest request, SolrQueryResponse
>> response) throws Exception {
>>       SolrCore coreToRequest = coreContainer.getCore("core2");
>>       ModifiableSolrParams params = new ModifiableSolrParams();
>>       params.set("echoParams", "explicit");
>>       params.set("q", "text");
>>       params.set("debugQuery", "true");
>> request = new LocalSolrQueryRequest(coreToRequest, params);
>> //             SolrRequestHandler reqHandler =
>> coreToRequest.getRequestHandler("/select");
>>       coreToRequest.execute(reqHandler, request, response);
>>       coreToRequest.close();
>>       request.close();
>>   }
>>  // the abstract methods - getDescription(), getSourceId(), getSource(),
>> getVersion() are //overrided... but these methods doesn't have any
>> implementations.
>> }
>>
>>
>> But, if i search any text in my webapp from browser, gots the HTTP 500
>> error.
>> i dont know how SolrContainer is intialized....
>> Pls anyone give me the solution...
>>
>> thanks and regards,
>> Mohamed
>>
>>     
>
>
>
>   


Re: Custom Request handler Error:

Posted by noor <no...@opentechindia.com>.
Shalin Shekhar Mangar wrote:
> On Fri, Jun 12, 2009 at 8:07 PM, noor <no...@opentechindia.com> wrote:
>
>   
>> <requestHandler name="/select" class="solr.my.MyCustomHandler">
>> <lst name="defaults">
>> <str name="echoParams">explicit</str>
>> <str name="q">tandem</str>
>> <str name="debugQuery">true</str>
>> </lst>
>> </requestHandler>
>>
>> Now, my webapp runs fine by,
>> http://localhost:8983/mysearch
>> searching also working fine.
>> But, these are not run through my custom handler.
>>
>>     
>
> Specify the full package to your handler class. Packages starting with
> "solr" are loaded in a special way.
>
>   
I specified like 
<requestHandler name="/select" class="org.apache.solr.my.MyCustomHandler">
.....
But still the same error.

Re: Custom Request handler Error:

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Fri, Jun 12, 2009 at 8:07 PM, noor <no...@opentechindia.com> wrote:

>
> <requestHandler name="/select" class="solr.my.MyCustomHandler">
> <lst name="defaults">
> <str name="echoParams">explicit</str>
> <str name="q">tandem</str>
> <str name="debugQuery">true</str>
> </lst>
> </requestHandler>
>
> Now, my webapp runs fine by,
> http://localhost:8983/mysearch
> searching also working fine.
> But, these are not run through my custom handler.
>

Specify the full package to your handler class. Packages starting with
"solr" are loaded in a special way.

-- 
Regards,
Shalin Shekhar Mangar.

Re: Custom Request handler Error:

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@corp.aol.com>.
please take a look at one of the updatehandlers which are already there
XmlUpdateRequestHandler
CSVRequestHandler
BinaryUpdateRequestHandler

On Tue, Jun 16, 2009 at 1:34 PM, noor<no...@opentechindia.com> wrote:
> how to create a custom update handler, to update my fields... ?
> Also, how to make the update, through url, i mean,
>
> http://localhost:8983/solr/update..../../ like that... ???
>
>
>
>
> noor wrote:
>>
>> Yes, i changed "custom" into "/custom", now it calls my class.
>> But, in browser, It shows
>> Null RequestHandler null.
>>
>> So, i need to accept my changes by solr. For that, what i need to do,
>> pls guide me to acheive this.
>>
>>
>> Noble Paul wrote:
>>>
>>> register is as follows
>>> <requestHandler name="/custom"
>>> class="org.apache.solr.my.MyCustomHandler">
>>>
>>> the request must be made to the uri "/custom" only then the requests
>>> would come to your handler
>>>
>>> On Sat, Jun 13, 2009 at 5:49 PM, noor<no...@opentechindia.com> wrote:
>>>
>>>>
>>>> Yes, i changed requestHandler name as,
>>>> <requestHandler name="custom"
>>>> class="org.apache.solr.my.MyCustomHandler">
>>>> .....
>>>>
>>>> Then also,
>>>> In statistics page, my custom handler under QueryHandler's request count
>>>> remains 0. It shows that, the webrequest is not coming to my class....
>>>>
>>>> Noble Paul wrote:
>>>>
>>>>>
>>>>> register your handler in some other name and fire a request to that
>>>>>
>>>>> On Fri, Jun 12, 2009 at 8:07 PM, noor<no...@opentechindia.com> wrote:
>>>>>
>>>>>
>>>>>>
>>>>>> I solved this NullPointerException, by the following changes.
>>>>>>
>>>>>> In java code:
>>>>>> public void handleRequestBody(SolrQueryRequest request,
>>>>>> SolrQueryResponse
>>>>>> response) throws Exception {
>>>>>> SolrCore coreToRequest =
>>>>>> request.getCore();//coreContainer.getCore("core2");
>>>>>> .....
>>>>>> }
>>>>>>
>>>>>> and in solr-config.xml:
>>>>>> <requestHandler name="/select" class="solr.my.MyCustomHandler">
>>>>>> <lst name="defaults">
>>>>>> <str name="echoParams">explicit</str>
>>>>>> <str name="q">tandem</str>
>>>>>> <str name="debugQuery">true</str>
>>>>>> </lst>
>>>>>> </requestHandler>
>>>>>>
>>>>>> Now, my webapp runs fine by,
>>>>>> http://localhost:8983/mysearch
>>>>>> searching also working fine.
>>>>>> But, these are not run through my custom handler. So i felt, it
>>>>>> wrongly
>>>>>> doing searching.
>>>>>> Because, in solr admin statistics page,
>>>>>> my custom handler under QueryHandler's request count remains 0, it
>>>>>> doesn't
>>>>>> get incremented, when i search something. Rather,
>>>>>> statndardReqHandler's
>>>>>> request count is incremented.
>>>>>>
>>>>>> And another thing, how do we debug solr. ???
>>>>>> Please anybody help me to solve this ...
>>>>>>
>>>>>> Thanks in advance.
>>>>>>
>>>>>> Noble Paul ??????? ?????? wrote:
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> is there any error on the console?
>>>>>>>
>>>>>>> On Fri, Jun 12, 2009 at 4:26 PM, Noor<no...@opentechindia.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> hi,
>>>>>>>>  i am new to apache solr.
>>>>>>>> I need to create a custom request handler class. So i create a new
>>>>>>>> one
>>>>>>>> and
>>>>>>>> changed the solr-config.xml file as,
>>>>>>>>  <requestHandler name="/select" class="solr.my.MyCustomHandler">
>>>>>>>>    <lst name="defaults">
>>>>>>>>        <str name="echoParams">explicit</str>
>>>>>>>>        <str name="q">tandem</str>
>>>>>>>>        <str name="debugQuery">true</str>
>>>>>>>>    </lst>
>>>>>>>>  </requestHandler>
>>>>>>>>
>>>>>>>> And in my java class, the code is,
>>>>>>>>
>>>>>>>> public class MyCustomHandler extends RequestHandlerBase{
>>>>>>>>  public CoreContainer coreContainer;
>>>>>>>>  public void handleRequestBody(SolrQueryRequest request,
>>>>>>>> SolrQueryResponse
>>>>>>>> response) throws Exception {
>>>>>>>>    SolrCore coreToRequest = coreContainer.getCore("core2");
>>>>>>>>    ModifiableSolrParams params = new ModifiableSolrParams();
>>>>>>>>    params.set("echoParams", "explicit");
>>>>>>>>    params.set("q", "text");
>>>>>>>>    params.set("debugQuery", "true");
>>>>>>>> request = new LocalSolrQueryRequest(coreToRequest, params);
>>>>>>>> //             SolrRequestHandler reqHandler =
>>>>>>>> coreToRequest.getRequestHandler("/select");
>>>>>>>>    coreToRequest.execute(reqHandler, request, response);
>>>>>>>>    coreToRequest.close();
>>>>>>>>    request.close();
>>>>>>>>  }
>>>>>>>>  // the abstract methods - getDescription(), getSourceId(),
>>>>>>>> getSource(),
>>>>>>>> getVersion() are //overrided... but these methods doesn't have any
>>>>>>>> implementations.
>>>>>>>> }
>>>>>>>>
>>>>>>>>
>>>>>>>> But, if i search any text in my webapp from browser, gots the HTTP
>>>>>>>> 500
>>>>>>>> error.
>>>>>>>> i dont know how SolrContainer is intialized....
>>>>>>>> Pls anyone give me the solution...
>>>>>>>>
>>>>>>>> thanks and regards,
>>>>>>>> Mohamed
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>
>>
>
>



-- 
-----------------------------------------------------
Noble Paul | Principal Engineer| AOL | http://aol.com

Re: Custom Request handler Error:

Posted by noor <no...@opentechindia.com>.
how to create a custom update handler, to update my fields... ?
Also, how to make the update, through url, i mean,

http://localhost:8983/solr/update..../../ like that... ???




noor wrote:
> Yes, i changed "custom" into "/custom", now it calls my class.
> But, in browser, It shows
> Null RequestHandler null.
>
> So, i need to accept my changes by solr. For that, what i need to do,
> pls guide me to acheive this.
>
>
> Noble Paul wrote:
>> register is as follows
>> <requestHandler name="/custom" 
>> class="org.apache.solr.my.MyCustomHandler">
>>
>> the request must be made to the uri "/custom" only then the requests
>> would come to your handler
>>
>> On Sat, Jun 13, 2009 at 5:49 PM, noor<no...@opentechindia.com> wrote:
>>  
>>> Yes, i changed requestHandler name as,
>>> <requestHandler name="custom" 
>>> class="org.apache.solr.my.MyCustomHandler">
>>> .....
>>>
>>> Then also,
>>> In statistics page, my custom handler under QueryHandler's request 
>>> count
>>> remains 0. It shows that, the webrequest is not coming to my class....
>>>
>>> Noble Paul wrote:
>>>    
>>>> register your handler in some other name and fire a request to that
>>>>
>>>> On Fri, Jun 12, 2009 at 8:07 PM, noor<no...@opentechindia.com> wrote:
>>>>
>>>>      
>>>>> I solved this NullPointerException, by the following changes.
>>>>>
>>>>> In java code:
>>>>> public void handleRequestBody(SolrQueryRequest request, 
>>>>> SolrQueryResponse
>>>>> response) throws Exception {
>>>>> SolrCore coreToRequest =
>>>>> request.getCore();//coreContainer.getCore("core2");
>>>>> .....
>>>>> }
>>>>>
>>>>> and in solr-config.xml:
>>>>> <requestHandler name="/select" class="solr.my.MyCustomHandler">
>>>>> <lst name="defaults">
>>>>> <str name="echoParams">explicit</str>
>>>>> <str name="q">tandem</str>
>>>>> <str name="debugQuery">true</str>
>>>>> </lst>
>>>>> </requestHandler>
>>>>>
>>>>> Now, my webapp runs fine by,
>>>>> http://localhost:8983/mysearch
>>>>> searching also working fine.
>>>>> But, these are not run through my custom handler. So i felt, it 
>>>>> wrongly
>>>>> doing searching.
>>>>> Because, in solr admin statistics page,
>>>>> my custom handler under QueryHandler's request count remains 0, it
>>>>> doesn't
>>>>> get incremented, when i search something. Rather, 
>>>>> statndardReqHandler's
>>>>> request count is incremented.
>>>>>
>>>>> And another thing, how do we debug solr. ???
>>>>> Please anybody help me to solve this ...
>>>>>
>>>>> Thanks in advance.
>>>>>
>>>>> Noble Paul ??????? ?????? wrote:
>>>>>
>>>>>        
>>>>>> is there any error on the console?
>>>>>>
>>>>>> On Fri, Jun 12, 2009 at 4:26 PM, Noor<no...@opentechindia.com> 
>>>>>> wrote:
>>>>>>
>>>>>>
>>>>>>          
>>>>>>> hi,
>>>>>>>  i am new to apache solr.
>>>>>>> I need to create a custom request handler class. So i create a 
>>>>>>> new one
>>>>>>> and
>>>>>>> changed the solr-config.xml file as,
>>>>>>>  <requestHandler name="/select" class="solr.my.MyCustomHandler">
>>>>>>>     <lst name="defaults">
>>>>>>>         <str name="echoParams">explicit</str>
>>>>>>>         <str name="q">tandem</str>
>>>>>>>         <str name="debugQuery">true</str>
>>>>>>>     </lst>
>>>>>>>  </requestHandler>
>>>>>>>
>>>>>>> And in my java class, the code is,
>>>>>>>
>>>>>>> public class MyCustomHandler extends RequestHandlerBase{
>>>>>>>  public CoreContainer coreContainer;
>>>>>>>  public void handleRequestBody(SolrQueryRequest request,
>>>>>>> SolrQueryResponse
>>>>>>> response) throws Exception {
>>>>>>>     SolrCore coreToRequest = coreContainer.getCore("core2");
>>>>>>>     ModifiableSolrParams params = new ModifiableSolrParams();
>>>>>>>     params.set("echoParams", "explicit");
>>>>>>>     params.set("q", "text");
>>>>>>>     params.set("debugQuery", "true");
>>>>>>> request = new LocalSolrQueryRequest(coreToRequest, params);
>>>>>>> //             SolrRequestHandler reqHandler =
>>>>>>> coreToRequest.getRequestHandler("/select");
>>>>>>>     coreToRequest.execute(reqHandler, request, response);
>>>>>>>     coreToRequest.close();
>>>>>>>     request.close();
>>>>>>>  }
>>>>>>>  // the abstract methods - getDescription(), getSourceId(),
>>>>>>> getSource(),
>>>>>>> getVersion() are //overrided... but these methods doesn't have any
>>>>>>> implementations.
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>> But, if i search any text in my webapp from browser, gots the 
>>>>>>> HTTP 500
>>>>>>> error.
>>>>>>> i dont know how SolrContainer is intialized....
>>>>>>> Pls anyone give me the solution...
>>>>>>>
>>>>>>> thanks and regards,
>>>>>>> Mohamed
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>             
>>>>>>
>>>>>>           
>>>>>         
>>>>
>>>>
>>>>       
>>>     
>>
>>
>>
>>   
>
>


Re: Custom Request handler Error:

Posted by Noor <no...@opentechindia.com>.
I want Solr, to accept my custom class changes and run it.
So for this, pls anyone guide me ....to achieve this..

noor wrote:
> Yes, i changed "custom" into "/custom", now it calls my class.
> But, in browser, It shows
> Null RequestHandler null.
>
> So, i need to accept my changes by solr. For that, what i need to do,
> pls guide me to acheive this.
>
>
> Noble Paul wrote:
>> register is as follows
>> <requestHandler name="/custom" 
>> class="org.apache.solr.my.MyCustomHandler">
>>
>> the request must be made to the uri "/custom" only then the requests
>> would come to your handler
>>
>> On Sat, Jun 13, 2009 at 5:49 PM, noor<no...@opentechindia.com> wrote:
>>  
>>> Yes, i changed requestHandler name as,
>>> <requestHandler name="custom" 
>>> class="org.apache.solr.my.MyCustomHandler">
>>> .....
>>>
>>> Then also,
>>> In statistics page, my custom handler under QueryHandler's request 
>>> count
>>> remains 0. It shows that, the webrequest is not coming to my class....
>>>
>>> Noble Paul wrote:
>>>    
>>>> register your handler in some other name and fire a request to that
>>>>
>>>> On Fri, Jun 12, 2009 at 8:07 PM, noor<no...@opentechindia.com> wrote:
>>>>
>>>>      
>>>>> I solved this NullPointerException, by the following changes.
>>>>>
>>>>> In java code:
>>>>> public void handleRequestBody(SolrQueryRequest request, 
>>>>> SolrQueryResponse
>>>>> response) throws Exception {
>>>>> SolrCore coreToRequest =
>>>>> request.getCore();//coreContainer.getCore("core2");
>>>>> .....
>>>>> }
>>>>>
>>>>> and in solr-config.xml:
>>>>> <requestHandler name="/select" class="solr.my.MyCustomHandler">
>>>>> <lst name="defaults">
>>>>> <str name="echoParams">explicit</str>
>>>>> <str name="q">tandem</str>
>>>>> <str name="debugQuery">true</str>
>>>>> </lst>
>>>>> </requestHandler>
>>>>>
>>>>> Now, my webapp runs fine by,
>>>>> http://localhost:8983/mysearch
>>>>> searching also working fine.
>>>>> But, these are not run through my custom handler. So i felt, it 
>>>>> wrongly
>>>>> doing searching.
>>>>> Because, in solr admin statistics page,
>>>>> my custom handler under QueryHandler's request count remains 0, it
>>>>> doesn't
>>>>> get incremented, when i search something. Rather, 
>>>>> statndardReqHandler's
>>>>> request count is incremented.
>>>>>
>>>>> And another thing, how do we debug solr. ???
>>>>> Please anybody help me to solve this ...
>>>>>
>>>>> Thanks in advance.
>>>>>
>>>>> Noble Paul ??????? ?????? wrote:
>>>>>
>>>>>        
>>>>>> is there any error on the console?
>>>>>>
>>>>>> On Fri, Jun 12, 2009 at 4:26 PM, Noor<no...@opentechindia.com> 
>>>>>> wrote:
>>>>>>
>>>>>>
>>>>>>          
>>>>>>> hi,
>>>>>>>  i am new to apache solr.
>>>>>>> I need to create a custom request handler class. So i create a 
>>>>>>> new one
>>>>>>> and
>>>>>>> changed the solr-config.xml file as,
>>>>>>>  <requestHandler name="/select" class="solr.my.MyCustomHandler">
>>>>>>>     <lst name="defaults">
>>>>>>>         <str name="echoParams">explicit</str>
>>>>>>>         <str name="q">tandem</str>
>>>>>>>         <str name="debugQuery">true</str>
>>>>>>>     </lst>
>>>>>>>  </requestHandler>
>>>>>>>
>>>>>>> And in my java class, the code is,
>>>>>>>
>>>>>>> public class MyCustomHandler extends RequestHandlerBase{
>>>>>>>  public CoreContainer coreContainer;
>>>>>>>  public void handleRequestBody(SolrQueryRequest request,
>>>>>>> SolrQueryResponse
>>>>>>> response) throws Exception {
>>>>>>>     SolrCore coreToRequest = coreContainer.getCore("core2");
>>>>>>>     ModifiableSolrParams params = new ModifiableSolrParams();
>>>>>>>     params.set("echoParams", "explicit");
>>>>>>>     params.set("q", "text");
>>>>>>>     params.set("debugQuery", "true");
>>>>>>> request = new LocalSolrQueryRequest(coreToRequest, params);
>>>>>>> //             SolrRequestHandler reqHandler =
>>>>>>> coreToRequest.getRequestHandler("/select");
>>>>>>>     coreToRequest.execute(reqHandler, request, response);
>>>>>>>     coreToRequest.close();
>>>>>>>     request.close();
>>>>>>>  }
>>>>>>>  // the abstract methods - getDescription(), getSourceId(),
>>>>>>> getSource(),
>>>>>>> getVersion() are //overrided... but these methods doesn't have any
>>>>>>> implementations.
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>> But, if i search any text in my webapp from browser, gots the 
>>>>>>> HTTP 500
>>>>>>> error.
>>>>>>> i dont know how SolrContainer is intialized....
>>>>>>> Pls anyone give me the solution...
>>>>>>>
>>>>>>> thanks and regards,
>>>>>>> Mohamed
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>             
>>>>>>
>>>>>>           
>>>>>         
>>>>
>>>>
>>>>       
>>>     
>>
>>
>>
>>   
>
>


Re: Custom Request handler Error:

Posted by noor <no...@opentechindia.com>.
Yes, i changed "custom" into "/custom", now it calls my class.
But, in browser, It shows
Null RequestHandler null.

So, i need to accept my changes by solr. For that, what i need to do,
pls guide me to acheive this.


Noble Paul wrote:
> register is as follows
> <requestHandler name="/custom" class="org.apache.solr.my.MyCustomHandler">
>
> the request must be made to the uri "/custom" only then the requests
> would come to your handler
>
> On Sat, Jun 13, 2009 at 5:49 PM, noor<no...@opentechindia.com> wrote:
>   
>> Yes, i changed requestHandler name as,
>> <requestHandler name="custom" class="org.apache.solr.my.MyCustomHandler">
>> .....
>>
>> Then also,
>> In statistics page, my custom handler under QueryHandler's request count
>> remains 0. It shows that, the webrequest is not coming to my class....
>>
>> Noble Paul wrote:
>>     
>>> register your handler in some other name and fire a request to that
>>>
>>> On Fri, Jun 12, 2009 at 8:07 PM, noor<no...@opentechindia.com> wrote:
>>>
>>>       
>>>> I solved this NullPointerException, by the following changes.
>>>>
>>>> In java code:
>>>> public void handleRequestBody(SolrQueryRequest request, SolrQueryResponse
>>>> response) throws Exception {
>>>> SolrCore coreToRequest =
>>>> request.getCore();//coreContainer.getCore("core2");
>>>> .....
>>>> }
>>>>
>>>> and in solr-config.xml:
>>>> <requestHandler name="/select" class="solr.my.MyCustomHandler">
>>>> <lst name="defaults">
>>>> <str name="echoParams">explicit</str>
>>>> <str name="q">tandem</str>
>>>> <str name="debugQuery">true</str>
>>>> </lst>
>>>> </requestHandler>
>>>>
>>>> Now, my webapp runs fine by,
>>>> http://localhost:8983/mysearch
>>>> searching also working fine.
>>>> But, these are not run through my custom handler. So i felt, it wrongly
>>>> doing searching.
>>>> Because, in solr admin statistics page,
>>>> my custom handler under QueryHandler's request count remains 0, it
>>>> doesn't
>>>> get incremented, when i search something. Rather, statndardReqHandler's
>>>> request count is incremented.
>>>>
>>>> And another thing, how do we debug solr. ???
>>>> Please anybody help me to solve this ...
>>>>
>>>> Thanks in advance.
>>>>
>>>> Noble Paul ??????? ?????? wrote:
>>>>
>>>>         
>>>>> is there any error on the console?
>>>>>
>>>>> On Fri, Jun 12, 2009 at 4:26 PM, Noor<no...@opentechindia.com> wrote:
>>>>>
>>>>>
>>>>>           
>>>>>> hi,
>>>>>>  i am new to apache solr.
>>>>>> I need to create a custom request handler class. So i create a new one
>>>>>> and
>>>>>> changed the solr-config.xml file as,
>>>>>>  <requestHandler name="/select" class="solr.my.MyCustomHandler">
>>>>>>     <lst name="defaults">
>>>>>>         <str name="echoParams">explicit</str>
>>>>>>         <str name="q">tandem</str>
>>>>>>         <str name="debugQuery">true</str>
>>>>>>     </lst>
>>>>>>  </requestHandler>
>>>>>>
>>>>>> And in my java class, the code is,
>>>>>>
>>>>>> public class MyCustomHandler extends RequestHandlerBase{
>>>>>>  public CoreContainer coreContainer;
>>>>>>  public void handleRequestBody(SolrQueryRequest request,
>>>>>> SolrQueryResponse
>>>>>> response) throws Exception {
>>>>>>     SolrCore coreToRequest = coreContainer.getCore("core2");
>>>>>>     ModifiableSolrParams params = new ModifiableSolrParams();
>>>>>>     params.set("echoParams", "explicit");
>>>>>>     params.set("q", "text");
>>>>>>     params.set("debugQuery", "true");
>>>>>> request = new LocalSolrQueryRequest(coreToRequest, params);
>>>>>> //             SolrRequestHandler reqHandler =
>>>>>> coreToRequest.getRequestHandler("/select");
>>>>>>     coreToRequest.execute(reqHandler, request, response);
>>>>>>     coreToRequest.close();
>>>>>>     request.close();
>>>>>>  }
>>>>>>  // the abstract methods - getDescription(), getSourceId(),
>>>>>> getSource(),
>>>>>> getVersion() are //overrided... but these methods doesn't have any
>>>>>> implementations.
>>>>>> }
>>>>>>
>>>>>>
>>>>>> But, if i search any text in my webapp from browser, gots the HTTP 500
>>>>>> error.
>>>>>> i dont know how SolrContainer is intialized....
>>>>>> Pls anyone give me the solution...
>>>>>>
>>>>>> thanks and regards,
>>>>>> Mohamed
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>>>>>
>>>>>           
>>>>         
>>>
>>>
>>>       
>>     
>
>
>
>   


Re: Custom Request handler Error:

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@corp.aol.com>.
register is as follows
<requestHandler name="/custom" class="org.apache.solr.my.MyCustomHandler">

the request must be made to the uri "/custom" only then the requests
would come to your handler

On Sat, Jun 13, 2009 at 5:49 PM, noor<no...@opentechindia.com> wrote:
> Yes, i changed requestHandler name as,
> <requestHandler name="custom" class="org.apache.solr.my.MyCustomHandler">
> .....
>
> Then also,
> In statistics page, my custom handler under QueryHandler's request count
> remains 0. It shows that, the webrequest is not coming to my class....
>
> Noble Paul wrote:
>>
>> register your handler in some other name and fire a request to that
>>
>> On Fri, Jun 12, 2009 at 8:07 PM, noor<no...@opentechindia.com> wrote:
>>
>>>
>>> I solved this NullPointerException, by the following changes.
>>>
>>> In java code:
>>> public void handleRequestBody(SolrQueryRequest request, SolrQueryResponse
>>> response) throws Exception {
>>> SolrCore coreToRequest =
>>> request.getCore();//coreContainer.getCore("core2");
>>> .....
>>> }
>>>
>>> and in solr-config.xml:
>>> <requestHandler name="/select" class="solr.my.MyCustomHandler">
>>> <lst name="defaults">
>>> <str name="echoParams">explicit</str>
>>> <str name="q">tandem</str>
>>> <str name="debugQuery">true</str>
>>> </lst>
>>> </requestHandler>
>>>
>>> Now, my webapp runs fine by,
>>> http://localhost:8983/mysearch
>>> searching also working fine.
>>> But, these are not run through my custom handler. So i felt, it wrongly
>>> doing searching.
>>> Because, in solr admin statistics page,
>>> my custom handler under QueryHandler's request count remains 0, it
>>> doesn't
>>> get incremented, when i search something. Rather, statndardReqHandler's
>>> request count is incremented.
>>>
>>> And another thing, how do we debug solr. ???
>>> Please anybody help me to solve this ...
>>>
>>> Thanks in advance.
>>>
>>> Noble Paul ??????? ?????? wrote:
>>>
>>>>
>>>> is there any error on the console?
>>>>
>>>> On Fri, Jun 12, 2009 at 4:26 PM, Noor<no...@opentechindia.com> wrote:
>>>>
>>>>
>>>>>
>>>>> hi,
>>>>>  i am new to apache solr.
>>>>> I need to create a custom request handler class. So i create a new one
>>>>> and
>>>>> changed the solr-config.xml file as,
>>>>>  <requestHandler name="/select" class="solr.my.MyCustomHandler">
>>>>>     <lst name="defaults">
>>>>>         <str name="echoParams">explicit</str>
>>>>>         <str name="q">tandem</str>
>>>>>         <str name="debugQuery">true</str>
>>>>>     </lst>
>>>>>  </requestHandler>
>>>>>
>>>>> And in my java class, the code is,
>>>>>
>>>>> public class MyCustomHandler extends RequestHandlerBase{
>>>>>  public CoreContainer coreContainer;
>>>>>  public void handleRequestBody(SolrQueryRequest request,
>>>>> SolrQueryResponse
>>>>> response) throws Exception {
>>>>>     SolrCore coreToRequest = coreContainer.getCore("core2");
>>>>>     ModifiableSolrParams params = new ModifiableSolrParams();
>>>>>     params.set("echoParams", "explicit");
>>>>>     params.set("q", "text");
>>>>>     params.set("debugQuery", "true");
>>>>> request = new LocalSolrQueryRequest(coreToRequest, params);
>>>>> //             SolrRequestHandler reqHandler =
>>>>> coreToRequest.getRequestHandler("/select");
>>>>>     coreToRequest.execute(reqHandler, request, response);
>>>>>     coreToRequest.close();
>>>>>     request.close();
>>>>>  }
>>>>>  // the abstract methods - getDescription(), getSourceId(),
>>>>> getSource(),
>>>>> getVersion() are //overrided... but these methods doesn't have any
>>>>> implementations.
>>>>> }
>>>>>
>>>>>
>>>>> But, if i search any text in my webapp from browser, gots the HTTP 500
>>>>> error.
>>>>> i dont know how SolrContainer is intialized....
>>>>> Pls anyone give me the solution...
>>>>>
>>>>> thanks and regards,
>>>>> Mohamed
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>>
>
>



-- 
-----------------------------------------------------
Noble Paul | Principal Engineer| AOL | http://aol.com

Re: Custom Request handler Error:

Posted by noor <no...@opentechindia.com>.
Yes, i changed requestHandler name as,
<requestHandler name="custom" class="org.apache.solr.my.MyCustomHandler">
.....

Then also,
In statistics page, my custom handler under QueryHandler's request count 
remains 0. It shows that, the webrequest is not coming to my class....

Noble Paul wrote:
> register your handler in some other name and fire a request to that
>
> On Fri, Jun 12, 2009 at 8:07 PM, noor<no...@opentechindia.com> wrote:
>   
>> I solved this NullPointerException, by the following changes.
>>
>> In java code:
>> public void handleRequestBody(SolrQueryRequest request, SolrQueryResponse
>> response) throws Exception {
>> SolrCore coreToRequest = request.getCore();//coreContainer.getCore("core2");
>> .....
>> }
>>
>> and in solr-config.xml:
>> <requestHandler name="/select" class="solr.my.MyCustomHandler">
>> <lst name="defaults">
>> <str name="echoParams">explicit</str>
>> <str name="q">tandem</str>
>> <str name="debugQuery">true</str>
>> </lst>
>> </requestHandler>
>>
>> Now, my webapp runs fine by,
>> http://localhost:8983/mysearch
>> searching also working fine.
>> But, these are not run through my custom handler. So i felt, it wrongly
>> doing searching.
>> Because, in solr admin statistics page,
>> my custom handler under QueryHandler's request count remains 0, it doesn't
>> get incremented, when i search something. Rather, statndardReqHandler's
>> request count is incremented.
>>
>> And another thing, how do we debug solr. ???
>> Please anybody help me to solve this ...
>>
>> Thanks in advance.
>>
>> Noble Paul ??????? ?????? wrote:
>>     
>>> is there any error on the console?
>>>
>>> On Fri, Jun 12, 2009 at 4:26 PM, Noor<no...@opentechindia.com> wrote:
>>>
>>>       
>>>> hi,
>>>>  i am new to apache solr.
>>>> I need to create a custom request handler class. So i create a new one
>>>> and
>>>> changed the solr-config.xml file as,
>>>>  <requestHandler name="/select" class="solr.my.MyCustomHandler">
>>>>      <lst name="defaults">
>>>>          <str name="echoParams">explicit</str>
>>>>          <str name="q">tandem</str>
>>>>          <str name="debugQuery">true</str>
>>>>      </lst>
>>>>  </requestHandler>
>>>>
>>>> And in my java class, the code is,
>>>>
>>>> public class MyCustomHandler extends RequestHandlerBase{
>>>>  public CoreContainer coreContainer;
>>>>  public void handleRequestBody(SolrQueryRequest request,
>>>> SolrQueryResponse
>>>> response) throws Exception {
>>>>      SolrCore coreToRequest = coreContainer.getCore("core2");
>>>>      ModifiableSolrParams params = new ModifiableSolrParams();
>>>>      params.set("echoParams", "explicit");
>>>>      params.set("q", "text");
>>>>      params.set("debugQuery", "true");
>>>> request = new LocalSolrQueryRequest(coreToRequest, params);
>>>> //             SolrRequestHandler reqHandler =
>>>> coreToRequest.getRequestHandler("/select");
>>>>      coreToRequest.execute(reqHandler, request, response);
>>>>      coreToRequest.close();
>>>>      request.close();
>>>>  }
>>>>  // the abstract methods - getDescription(), getSourceId(), getSource(),
>>>> getVersion() are //overrided... but these methods doesn't have any
>>>> implementations.
>>>> }
>>>>
>>>>
>>>> But, if i search any text in my webapp from browser, gots the HTTP 500
>>>> error.
>>>> i dont know how SolrContainer is intialized....
>>>> Pls anyone give me the solution...
>>>>
>>>> thanks and regards,
>>>> Mohamed
>>>>
>>>>
>>>>         
>>>
>>>
>>>       
>>     
>
>
>
>   


Re: Custom Request handler Error:

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@corp.aol.com>.
register your handler in some other name and fire a request to that

On Fri, Jun 12, 2009 at 8:07 PM, noor<no...@opentechindia.com> wrote:
> I solved this NullPointerException, by the following changes.
>
> In java code:
> public void handleRequestBody(SolrQueryRequest request, SolrQueryResponse
> response) throws Exception {
> SolrCore coreToRequest = request.getCore();//coreContainer.getCore("core2");
> .....
> }
>
> and in solr-config.xml:
> <requestHandler name="/select" class="solr.my.MyCustomHandler">
> <lst name="defaults">
> <str name="echoParams">explicit</str>
> <str name="q">tandem</str>
> <str name="debugQuery">true</str>
> </lst>
> </requestHandler>
>
> Now, my webapp runs fine by,
> http://localhost:8983/mysearch
> searching also working fine.
> But, these are not run through my custom handler. So i felt, it wrongly
> doing searching.
> Because, in solr admin statistics page,
> my custom handler under QueryHandler's request count remains 0, it doesn't
> get incremented, when i search something. Rather, statndardReqHandler's
> request count is incremented.
>
> And another thing, how do we debug solr. ???
> Please anybody help me to solve this ...
>
> Thanks in advance.
>
> Noble Paul ??????? ?????? wrote:
>>
>> is there any error on the console?
>>
>> On Fri, Jun 12, 2009 at 4:26 PM, Noor<no...@opentechindia.com> wrote:
>>
>>>
>>> hi,
>>>  i am new to apache solr.
>>> I need to create a custom request handler class. So i create a new one
>>> and
>>> changed the solr-config.xml file as,
>>>  <requestHandler name="/select" class="solr.my.MyCustomHandler">
>>>      <lst name="defaults">
>>>          <str name="echoParams">explicit</str>
>>>          <str name="q">tandem</str>
>>>          <str name="debugQuery">true</str>
>>>      </lst>
>>>  </requestHandler>
>>>
>>> And in my java class, the code is,
>>>
>>> public class MyCustomHandler extends RequestHandlerBase{
>>>  public CoreContainer coreContainer;
>>>  public void handleRequestBody(SolrQueryRequest request,
>>> SolrQueryResponse
>>> response) throws Exception {
>>>      SolrCore coreToRequest = coreContainer.getCore("core2");
>>>      ModifiableSolrParams params = new ModifiableSolrParams();
>>>      params.set("echoParams", "explicit");
>>>      params.set("q", "text");
>>>      params.set("debugQuery", "true");
>>> request = new LocalSolrQueryRequest(coreToRequest, params);
>>> //             SolrRequestHandler reqHandler =
>>> coreToRequest.getRequestHandler("/select");
>>>      coreToRequest.execute(reqHandler, request, response);
>>>      coreToRequest.close();
>>>      request.close();
>>>  }
>>>  // the abstract methods - getDescription(), getSourceId(), getSource(),
>>> getVersion() are //overrided... but these methods doesn't have any
>>> implementations.
>>> }
>>>
>>>
>>> But, if i search any text in my webapp from browser, gots the HTTP 500
>>> error.
>>> i dont know how SolrContainer is intialized....
>>> Pls anyone give me the solution...
>>>
>>> thanks and regards,
>>> Mohamed
>>>
>>>
>>
>>
>>
>>
>
>



-- 
-----------------------------------------------------
Noble Paul | Principal Engineer| AOL | http://aol.com

Re: Custom Request handler Error:

Posted by noor <no...@opentechindia.com>.
I solved this NullPointerException, by the following changes.

In java code:
public void handleRequestBody(SolrQueryRequest request, 
SolrQueryResponse response) throws Exception {
SolrCore coreToRequest = request.getCore();//coreContainer.getCore("core2");
.....
}

and in solr-config.xml:
<requestHandler name="/select" class="solr.my.MyCustomHandler">
<lst name="defaults">
<str name="echoParams">explicit</str>
<str name="q">tandem</str>
<str name="debugQuery">true</str>
</lst>
</requestHandler>

Now, my webapp runs fine by,
http://localhost:8983/mysearch
searching also working fine.
But, these are not run through my custom handler. So i felt, it wrongly 
doing searching.
Because, in solr admin statistics page,
my custom handler under QueryHandler's request count remains 0, it 
doesn't get incremented, when i search something. Rather, 
statndardReqHandler's request count is incremented.

And another thing, how do we debug solr. ???
Please anybody help me to solve this ...

Thanks in advance.

Noble Paul ??????? ?????? wrote:
> is there any error on the console?
>
> On Fri, Jun 12, 2009 at 4:26 PM, Noor<no...@opentechindia.com> wrote:
>   
>> hi,
>>  i am new to apache solr.
>> I need to create a custom request handler class. So i create a new one and
>> changed the solr-config.xml file as,
>>  <requestHandler name="/select" class="solr.my.MyCustomHandler">
>>       <lst name="defaults">
>>           <str name="echoParams">explicit</str>
>>           <str name="q">tandem</str>
>>           <str name="debugQuery">true</str>
>>       </lst>
>>   </requestHandler>
>>
>> And in my java class, the code is,
>>
>> public class MyCustomHandler extends RequestHandlerBase{
>>  public CoreContainer coreContainer;
>>  public void handleRequestBody(SolrQueryRequest request, SolrQueryResponse
>> response) throws Exception {
>>       SolrCore coreToRequest = coreContainer.getCore("core2");
>>       ModifiableSolrParams params = new ModifiableSolrParams();
>>       params.set("echoParams", "explicit");
>>       params.set("q", "text");
>>       params.set("debugQuery", "true");
>> request = new LocalSolrQueryRequest(coreToRequest, params);
>> //             SolrRequestHandler reqHandler =
>> coreToRequest.getRequestHandler("/select");
>>       coreToRequest.execute(reqHandler, request, response);
>>       coreToRequest.close();
>>       request.close();
>>   }
>>  // the abstract methods - getDescription(), getSourceId(), getSource(),
>> getVersion() are //overrided... but these methods doesn't have any
>> implementations.
>> }
>>
>>
>> But, if i search any text in my webapp from browser, gots the HTTP 500
>> error.
>> i dont know how SolrContainer is intialized....
>> Pls anyone give me the solution...
>>
>> thanks and regards,
>> Mohamed
>>
>>     
>
>
>
>   


Re: Custom Request handler Error:

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@corp.aol.com>.
is there any error on the console?

On Fri, Jun 12, 2009 at 4:26 PM, Noor<no...@opentechindia.com> wrote:
> hi,
>  i am new to apache solr.
> I need to create a custom request handler class. So i create a new one and
> changed the solr-config.xml file as,
>  <requestHandler name="/select" class="solr.my.MyCustomHandler">
>       <lst name="defaults">
>           <str name="echoParams">explicit</str>
>           <str name="q">tandem</str>
>           <str name="debugQuery">true</str>
>       </lst>
>   </requestHandler>
>
> And in my java class, the code is,
>
> public class MyCustomHandler extends RequestHandlerBase{
>  public CoreContainer coreContainer;
>  public void handleRequestBody(SolrQueryRequest request, SolrQueryResponse
> response) throws Exception {
>       SolrCore coreToRequest = coreContainer.getCore("core2");
>       ModifiableSolrParams params = new ModifiableSolrParams();
>       params.set("echoParams", "explicit");
>       params.set("q", "text");
>       params.set("debugQuery", "true");
> request = new LocalSolrQueryRequest(coreToRequest, params);
> //             SolrRequestHandler reqHandler =
> coreToRequest.getRequestHandler("/select");
>       coreToRequest.execute(reqHandler, request, response);
>       coreToRequest.close();
>       request.close();
>   }
>  // the abstract methods - getDescription(), getSourceId(), getSource(),
> getVersion() are //overrided... but these methods doesn't have any
> implementations.
> }
>
>
> But, if i search any text in my webapp from browser, gots the HTTP 500
> error.
> i dont know how SolrContainer is intialized....
> Pls anyone give me the solution...
>
> thanks and regards,
> Mohamed
>



-- 
-----------------------------------------------------
Noble Paul | Principal Engineer| AOL | http://aol.com