Couple of problems

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

Couple of problems

junklight
Hi,

I have installed solr under a stand alone tomcat5.5 installation. I  
can see the admin screens etc.

When I submit documents I get this error

Oct 11, 2006 10:05:44 AM org.apache.solr.core.SolrException  
logSEVERE: java.lang.NullPointerException
         at org.apache.solr.update.DocumentBuilder.addField
(DocumentBuilder.java:78)
at org.apache.solr.update.DocumentBuilder.addField
(DocumentBuilder.java:74)
at org.apache.solr.core.SolrCore.readDoc(SolrCore.java:917)
  at org.apache.solr.core.SolrCore.update(SolrCore.java:685)
at org.apache.solr.servlet.SolrUpdateServlet.doPost
(SolrUpdateServlet.java:52)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
.....


My docs follow this schema:

  <fields>
    <field name="id" type="string" indexed="false" stored="true"/>
    <field name="timestamp" type="string" indexed="true" stored="true"/>
    <field name="url" type="string" indexed="false" stored="true"/>
    <field name="collection" type="text_ws" indexed="true"  
stored="true"/>
    <field name="mimetype" type="string" indexed="true" stored="true"/>
   <field name="content" type="text" indexed="true" stored="false"/>
</fields>

Also - since getting this error I can no longer see part of the solr/
admin/stats.jsp screen - the boxes core, update , cache and other are  
now empty. I deleted and reinstalled solr  (including the unpacked  
webapps dir) but not tomcat and the problem is still there....

cheers

mark
Reply | Threaded
Open this post in threaded view
|

Re: Couple of problems

PanosJee
Check the tomcat logs... most probably there is a conflict with the
field definitions in your schema.xml
Reply | Threaded
Open this post in threaded view
|

Re: Couple of problems

junklight
Hi,

there are no errors while reading the schema:

Oct 11, 2006 9:56:43 AM org.apache.solr.schema.IndexSchema readConfig
INFO: Reading Solr Schema
Oct 11, 2006 9:56:43 AM org.apache.solr.schema.IndexSchema readConfig
INFO: Schema name=archive
Oct 11, 2006 9:56:43 AM org.apache.solr.schema.IndexSchema readConfig
INFO: default search field is content
Oct 11, 2006 9:56:43 AM org.apache.solr.schema.IndexSchema readConfig
INFO: query parser default operator is OR
Oct 11, 2006 9:56:43 AM org.apache.solr.servlet.SolrUpdateServlet init
INFO: SolrUpdateServlet.init() done

and then the first error is the one I reported when I submit a document

I am looking in Catalina.out - are there any other logs I should look  
at?

cheers

mark


On 11 Oct 2006, at 10:40, Panayiotis Papadopoulos wrote:

> Check the tomcat logs... most probably there is a conflict with the  
> field definitions in your schema.xml

Reply | Threaded
Open this post in threaded view
|

Re: Couple of problems

PanosJee
How do you post the documents to solr ? Via php, jsp or smth like that ?
Then if u use curl from php or jsp or asp you can see the error that
solr returns,
in php using curl i found out the error using this...

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 4);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header);  
$data = curl_exec($ch);
   

and then i printed $data, my schema was parsed successfully but actually
in the xml i was using variables bit different than in schema plus there
were some logical errors in the schema ...
So try to find the SOLR runtime errors using a solution like above
Reply | Threaded
Open this post in threaded view
|

Re: Couple of problems

junklight
that just returns the null pointer exception.

I have checked my schema and doc:

Schema:

   <field name="id" type="string" indexed="false" stored="true"/>
    <field name="timestamp" type="string" indexed="true" stored="true"/>
    <field name="url" type="string" indexed="false" stored="true"/>
    <field name="collection" type="text_ws" indexed="true"  
stored="true"/>
    <field name="mimetype" type="string" indexed="true" stored="true"/>

    <field name="content" type="text" indexed="true" stored="false"/>

Template:

doc = """<add>
     <doc>
         <field name="id">%s</field>
         <field name="timestamp">%s</field>
         <field name="url">%s</field>
         <field name="collection">%s</field>
         <field name="mimetype">%s</field>
         <field name="content">%s</field>
     </doc>
</add>"""


On 11 Oct 2006, at 12:19, Panayiotis Papadopoulos wrote:

> How do you post the documents to solr ? Via php, jsp or smth like  
> that ? Then if u use curl from php or jsp or asp you can see the  
> error that solr returns,
> in php using curl i found out the error using this...
>
> $ch = curl_init();
> curl_setopt($ch, CURLOPT_URL,$url);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
> curl_setopt($ch, CURLOPT_TIMEOUT, 4);
> curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header);   $data =  
> curl_exec($ch);
>
> and then i printed $data, my schema was parsed successfully but  
> actually in the xml i was using variables bit different than in  
> schema plus there were some logical errors in the schema ...
> So try to find the SOLR runtime errors using a solution like above

Reply | Threaded
Open this post in threaded view
|

Re: Couple of problems

Erik Hatcher
Are you ensuring that the %s replacements are properly encoded for XML?

        Erik


On Oct 11, 2006, at 7:54 AM, mark wrote:

> that just returns the null pointer exception.
>
> I have checked my schema and doc:
>
> Schema:
>
>   <field name="id" type="string" indexed="false" stored="true"/>
>    <field name="timestamp" type="string" indexed="true"  
> stored="true"/>
>    <field name="url" type="string" indexed="false" stored="true"/>
>    <field name="collection" type="text_ws" indexed="true"  
> stored="true"/>
>    <field name="mimetype" type="string" indexed="true" stored="true"/>
>
>    <field name="content" type="text" indexed="true" stored="false"/>
>
> Template:
>
> doc = """<add>
>     <doc>
>         <field name="id">%s</field>
>         <field name="timestamp">%s</field>
>         <field name="url">%s</field>
>         <field name="collection">%s</field>
>         <field name="mimetype">%s</field>
>         <field name="content">%s</field>
>     </doc>
> </add>"""
>
>
> On 11 Oct 2006, at 12:19, Panayiotis Papadopoulos wrote:
>
>> How do you post the documents to solr ? Via php, jsp or smth like  
>> that ? Then if u use curl from php or jsp or asp you can see the  
>> error that solr returns,
>> in php using curl i found out the error using this...
>>
>> $ch = curl_init();
>> curl_setopt($ch, CURLOPT_URL,$url);
>> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
>> curl_setopt($ch, CURLOPT_TIMEOUT, 4);
>> curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header);   $data =  
>> curl_exec($ch);
>>
>> and then i printed $data, my schema was parsed successfully but  
>> actually in the xml i was using variables bit different than in  
>> schema plus there were some logical errors in the schema ...
>> So try to find the SOLR runtime errors using a solution like above

Reply | Threaded
Open this post in threaded view
|

Re: Couple of problems

junklight
I believe so - an earlier attempt did fail in that department but the  
result was an XML parsing error (as you might expect).


On 11 Oct 2006, at 14:19, Erik Hatcher wrote:

> Are you ensuring that the %s replacements are properly encoded for  
> XML?
>
> Erik
>
>
> On Oct 11, 2006, at 7:54 AM, mark wrote:
>
>> that just returns the null pointer exception.
>>
>> I have checked my schema and doc:
>>
>> Schema:
>>
>>   <field name="id" type="string" indexed="false" stored="true"/>
>>    <field name="timestamp" type="string" indexed="true"  
>> stored="true"/>
>>    <field name="url" type="string" indexed="false" stored="true"/>
>>    <field name="collection" type="text_ws" indexed="true"  
>> stored="true"/>
>>    <field name="mimetype" type="string" indexed="true"  
>> stored="true"/>
>>
>>    <field name="content" type="text" indexed="true" stored="false"/>
>>
>> Template:
>>
>> doc = """<add>
>>     <doc>
>>         <field name="id">%s</field>
>>         <field name="timestamp">%s</field>
>>         <field name="url">%s</field>
>>         <field name="collection">%s</field>
>>         <field name="mimetype">%s</field>
>>         <field name="content">%s</field>
>>     </doc>
>> </add>"""
>>
>>
>> On 11 Oct 2006, at 12:19, Panayiotis Papadopoulos wrote:
>>
>>> How do you post the documents to solr ? Via php, jsp or smth like  
>>> that ? Then if u use curl from php or jsp or asp you can see the  
>>> error that solr returns,
>>> in php using curl i found out the error using this...
>>>
>>> $ch = curl_init();
>>> curl_setopt($ch, CURLOPT_URL,$url);
>>> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
>>> curl_setopt($ch, CURLOPT_TIMEOUT, 4);
>>> curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header);   $data =  
>>> curl_exec($ch);
>>>
>>> and then i printed $data, my schema was parsed successfully but  
>>> actually in the xml i was using variables bit different than in  
>>> schema plus there were some logical errors in the schema ...
>>> So try to find the SOLR runtime errors using a solution like above

Reply | Threaded
Open this post in threaded view
|

Re: Couple of problems

Chris Hostetter-3
In reply to this post by junklight

Wow ... this is crazy looking ... as far as i can tell the only way to get
an NPE at thta line is if the DocumentBuilder is being given a null
IndexSchema when i'ts constructed.  I don't know how that would happen.

can you zip up your solr/conf (so we have the schema and the config) and
post it online somehwere?

: admin/stats.jsp screen - the boxes core, update , cache and other are
: now empty. I deleted and reinstalled solr  (including the unpacked
: webapps dir) but not tomcat and the problem is still there....

that's really weird ... i suggeggests that the info registry is being
emptied out ... you said this problem continued after re-installing, i
assume you stoped/started the port as well?



-Hoss

Reply | Threaded
Open this post in threaded view
|

Re: Couple of problems

junklight
>
> can you zip up your solr/conf (so we have the schema and the  
> config) and
> post it online somehwere?

http://www.pagefall.com/cnf.zip

But this is a right out of the box install - I have only messed with  
the schema to suit me.

It was a nightly build though....

>
>
>
> that's really weird ... i suggeggests that the info registry is being
> emptied out ... you said this problem continued after re-installing, i
> assume you stoped/started the port as well?

yep - really careful to check this - I made sure there was a 404  
between stop and start

cheers

mark


Reply | Threaded
Open this post in threaded view
|

Re: Couple of problems

Kevin Lewandowski
In reply to this post by junklight
I've had a problem similar to this and it was because of the
schema.xml. It was valid XML but there were some incorrect field
definitions and/or the default field listed was not a defined field.

I'd suggest you start with the default schema and build on it piece by
piece, each time testing for the error with a "ping" operation in the
admin page.

Kevin

On 10/11/06, mark <[hidden email]> wrote:

> Hi,
>
> I have installed solr under a stand alone tomcat5.5 installation. I
> can see the admin screens etc.
>
> When I submit documents I get this error
>
> Oct 11, 2006 10:05:44 AM org.apache.solr.core.SolrException
> logSEVERE: java.lang.NullPointerException
>          at org.apache.solr.update.DocumentBuilder.addField
> (DocumentBuilder.java:78)
> at org.apache.solr.update.DocumentBuilder.addField
> (DocumentBuilder.java:74)
> at org.apache.solr.core.SolrCore.readDoc(SolrCore.java:917)
>   at org.apache.solr.core.SolrCore.update(SolrCore.java:685)
> at org.apache.solr.servlet.SolrUpdateServlet.doPost
> (SolrUpdateServlet.java:52)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> .....
>
>
> My docs follow this schema:
>
>   <fields>
>     <field name="id" type="string" indexed="false" stored="true"/>
>     <field name="timestamp" type="string" indexed="true" stored="true"/>
>     <field name="url" type="string" indexed="false" stored="true"/>
>     <field name="collection" type="text_ws" indexed="true"
> stored="true"/>
>     <field name="mimetype" type="string" indexed="true" stored="true"/>
>    <field name="content" type="text" indexed="true" stored="false"/>
> </fields>
>
> Also - since getting this error I can no longer see part of the solr/
> admin/stats.jsp screen - the boxes core, update , cache and other are
> now empty. I deleted and reinstalled solr  (including the unpacked
> webapps dir) but not tomcat and the problem is still there....
>
> cheers
>
> mark
>
Reply | Threaded
Open this post in threaded view
|

Re: Couple of problems

Chris Hostetter-3
In reply to this post by junklight

: But this is a right out of the box install - I have only messed with
: the schema to suit me.

when i use your schema with the current trunk using Jetty, right at
startup my logs contain a "SolrException: Schema Parsing Failed" which is
wrapping...

Caused by: java.lang.RuntimeException: 'id' is not an indexed field:id{type=string,properties=stored}
        at org.apache.solr.schema.IndexSchema.getIndexedField(IndexSchema.java:192)
        at org.apache.solr.schema.IndexSchema.readConfig(IndexSchema.java:387)
        ... 21 more

...which is because if you want to use a uniqueKey field it must be
indexed so deletes can be done.

This didn't show up at all in your Tomcat logs on startup?  or the first
time you tried to do a search or an update?  (it's in the SolrServlet.init
method)




-Hoss

Reply | Threaded
Open this post in threaded view
|

Re: Couple of problems

junklight
>
> This didn't show up at all in your Tomcat logs on startup?  or the  
> first
> time you tried to do a search or an update?  (it's in the  
> SolrServlet.init
> method)
>
>

Nope - not at all. Hmm - thanks for finding problem though - will try  
it in a bit


>
>
> -Hoss

Reply | Threaded
Open this post in threaded view
|

Re: Couple of problems

junklight
In reply to this post by Chris Hostetter-3
Hi,

that sorted it out.

cheers

mark



On 12 Oct 2006, at 02:22, Chris Hostetter wrote:

>
> : But this is a right out of the box install - I have only messed with
> : the schema to suit me.
>
> when i use your schema with the current trunk using Jetty, right at
> startup my logs contain a "SolrException: Schema Parsing Failed"  
> which is
> wrapping...
>
> Caused by: java.lang.RuntimeException: 'id' is not an indexed  
> field:id{type=string,properties=stored}
>         at org.apache.solr.schema.IndexSchema.getIndexedField
> (IndexSchema.java:192)
>         at org.apache.solr.schema.IndexSchema.readConfig
> (IndexSchema.java:387)
>         ... 21 more
>
> ...which is because if you want to use a uniqueKey field it must be
> indexed so deletes can be done.
>
> This didn't show up at all in your Tomcat logs on startup?  or the  
> first
> time you tried to do a search or an update?  (it's in the  
> SolrServlet.init
> method)
>
>
>
>
> -Hoss