[jira] Created: (SOLR-525) NullPointerException with no query or empty query

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (SOLR-525) NullPointerException with no query or empty query

JIRA jira@apache.org
NullPointerException with no query or empty query
-------------------------------------------------

                 Key: SOLR-525
                 URL: https://issues.apache.org/jira/browse/SOLR-525
             Project: Solr
          Issue Type: Bug
          Components: search
    Affects Versions: 1.3
         Environment: Tomcat 5.5
            Reporter: Lars Kotthoff
            Priority: Minor


When calling the search URL with no query or an empty query (i.e.  http://localhost:8080/solr/select/ or http://localhost:8080/solr/select/?q=), Solr throws a NullPointerException. The value for the query string returned by the SolrParams object is null, but QueryComponent tries to process it.

I encountered this bug because of a bug in my application calling the search URL, but arguably the response should be more constructive.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (SOLR-525) NullPointerException with no query or empty query

JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/SOLR-525?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lars Kotthoff updated SOLR-525:
-------------------------------

    Attachment: solr-search-empty-query.patch

Patch to fix the NullPointerException. Instead of setting the query string of the ResponseBuilder object to whatever the SolrParams object returns, check whether the returned value is null, and if so, set the query string to "". This will raise a ParserException when no or an empty search string is passed to Solr.

I'm not sure whether this is the optimal solution, so if anyone has a better idea of how to handle this, please comment. This solution only provides a more meaningful error message than a NullPointerException.

> NullPointerException with no query or empty query
> -------------------------------------------------
>
>                 Key: SOLR-525
>                 URL: https://issues.apache.org/jira/browse/SOLR-525
>             Project: Solr
>          Issue Type: Bug
>          Components: search
>    Affects Versions: 1.3
>         Environment: Tomcat 5.5
>            Reporter: Lars Kotthoff
>            Priority: Minor
>         Attachments: solr-search-empty-query.patch
>
>
> When calling the search URL with no query or an empty query (i.e.  http://localhost:8080/solr/select/ or http://localhost:8080/solr/select/?q=), Solr throws a NullPointerException. The value for the query string returned by the SolrParams object is null, but QueryComponent tries to process it.
> I encountered this bug because of a bug in my application calling the search URL, but arguably the response should be more constructive.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

Re: [jira] Updated: (SOLR-525) NullPointerException with no query or empty query

Shalin Shekhar Mangar
Both these links are related to the same problem I believe:

http://www.nabble.com/query-parsing-error-to14124285.html#a14140108
and
https://issues.apache.org/jira/browse/SOLR-435

On Tue, Apr 1, 2008 at 1:28 PM, Lars Kotthoff (JIRA) <[hidden email]>
wrote:

>
>     [
> https://issues.apache.org/jira/browse/SOLR-525?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel]
>
> Lars Kotthoff updated SOLR-525:
> -------------------------------
>
>    Attachment: solr-search-empty-query.patch
>
> Patch to fix the NullPointerException. Instead of setting the query string
> of the ResponseBuilder object to whatever the SolrParams object returns,
> check whether the returned value is null, and if so, set the query string to
> "". This will raise a ParserException when no or an empty search string is
> passed to Solr.
>
> I'm not sure whether this is the optimal solution, so if anyone has a
> better idea of how to handle this, please comment. This solution only
> provides a more meaningful error message than a NullPointerException.
>
> > NullPointerException with no query or empty query
> > -------------------------------------------------
> >
> >                 Key: SOLR-525
> >                 URL: https://issues.apache.org/jira/browse/SOLR-525
> >             Project: Solr
> >          Issue Type: Bug
> >          Components: search
> >    Affects Versions: 1.3
> >         Environment: Tomcat 5.5
> >            Reporter: Lars Kotthoff
> >            Priority: Minor
> >         Attachments: solr-search-empty-query.patch
> >
> >
> > When calling the search URL with no query or an empty query (i.e.
> http://localhost:8080/solr/select/ or
> http://localhost:8080/solr/select/?q=), Solr throws a
> NullPointerException. The value for the query string returned by the
> SolrParams object is null, but QueryComponent tries to process it.
> > I encountered this bug because of a bug in my application calling the
> search URL, but arguably the response should be more constructive.
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>


--
Regards,
Shalin Shekhar Mangar.
Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (SOLR-525) NullPointerException with no query or empty query

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/SOLR-525?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ryan McKinley resolved SOLR-525.
--------------------------------

    Resolution: Duplicate

Thanks for posting a solution!  This is the same as SOLR-435, but that has lingered for a while.

> NullPointerException with no query or empty query
> -------------------------------------------------
>
>                 Key: SOLR-525
>                 URL: https://issues.apache.org/jira/browse/SOLR-525
>             Project: Solr
>          Issue Type: Bug
>          Components: search
>    Affects Versions: 1.3
>         Environment: Tomcat 5.5
>            Reporter: Lars Kotthoff
>            Priority: Minor
>         Attachments: solr-search-empty-query.patch
>
>
> When calling the search URL with no query or an empty query (i.e.  http://localhost:8080/solr/select/ or http://localhost:8080/solr/select/?q=), Solr throws a NullPointerException. The value for the query string returned by the SolrParams object is null, but QueryComponent tries to process it.
> I encountered this bug because of a bug in my application calling the search URL, but arguably the response should be more constructive.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (SOLR-525) NullPointerException with no query or empty query

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/SOLR-525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12584374#action_12584374 ]

Lars Kotthoff commented on SOLR-525:
------------------------------------

Ah, sorry, didn't find that issue. I agree with the original thread reporting this problem that returning a 400 and indicating that a parameter is missing is a better solution.

> NullPointerException with no query or empty query
> -------------------------------------------------
>
>                 Key: SOLR-525
>                 URL: https://issues.apache.org/jira/browse/SOLR-525
>             Project: Solr
>          Issue Type: Bug
>          Components: search
>    Affects Versions: 1.3
>         Environment: Tomcat 5.5
>            Reporter: Lars Kotthoff
>            Priority: Minor
>         Attachments: solr-search-empty-query.patch, solr-search-empty-query.patch
>
>
> When calling the search URL with no query or an empty query (i.e.  http://localhost:8080/solr/select/ or http://localhost:8080/solr/select/?q=), Solr throws a NullPointerException. The value for the query string returned by the SolrParams object is null, but QueryComponent tries to process it.
> I encountered this bug because of a bug in my application calling the search URL, but arguably the response should be more constructive.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (SOLR-525) NullPointerException with no query or empty query

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/SOLR-525?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lars Kotthoff updated SOLR-525:
-------------------------------

    Attachment: solr-search-empty-query.patch

New patch which throws a SolrException when the query string is empty (cf. http://www.nabble.com/query-parsing-error-to14124285.html#a14140108).

> NullPointerException with no query or empty query
> -------------------------------------------------
>
>                 Key: SOLR-525
>                 URL: https://issues.apache.org/jira/browse/SOLR-525
>             Project: Solr
>          Issue Type: Bug
>          Components: search
>    Affects Versions: 1.3
>         Environment: Tomcat 5.5
>            Reporter: Lars Kotthoff
>            Priority: Minor
>         Attachments: solr-search-empty-query.patch, solr-search-empty-query.patch
>
>
> When calling the search URL with no query or an empty query (i.e.  http://localhost:8080/solr/select/ or http://localhost:8080/solr/select/?q=), Solr throws a NullPointerException. The value for the query string returned by the SolrParams object is null, but QueryComponent tries to process it.
> I encountered this bug because of a bug in my application calling the search URL, but arguably the response should be more constructive.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (SOLR-525) NullPointerException with no query or empty query

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/SOLR-525?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lars Kotthoff updated SOLR-525:
-------------------------------

    Attachment:     (was: solr-search-empty-query.patch)

> NullPointerException with no query or empty query
> -------------------------------------------------
>
>                 Key: SOLR-525
>                 URL: https://issues.apache.org/jira/browse/SOLR-525
>             Project: Solr
>          Issue Type: Bug
>          Components: search
>    Affects Versions: 1.3
>         Environment: Tomcat 5.5
>            Reporter: Lars Kotthoff
>            Priority: Minor
>         Attachments: solr-search-empty-query.patch
>
>
> When calling the search URL with no query or an empty query (i.e.  http://localhost:8080/solr/select/ or http://localhost:8080/solr/select/?q=), Solr throws a NullPointerException. The value for the query string returned by the SolrParams object is null, but QueryComponent tries to process it.
> I encountered this bug because of a bug in my application calling the search URL, but arguably the response should be more constructive.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.