SolrDictionarySerializer - Object reference not set to an instance of an object.

57 views
Skip to first unread message

Dorin Oltean

unread,
Nov 18, 2014, 9:10:01 AM11/18/14
to sol...@googlegroups.com
Hey,
I am getting this error and cant seem to find the reason ??? Do you know what a possible reason should be for this ???
Looking over this SolrDictionarySerializer file it doesn't look like this exception is possible

Below is the stacktrace.
System.NullReferenceException: Object reference not set to an instance of an object.
   at SolrNet.Impl.SolrDictionarySerializer.Serialize(Dictionary`2 doc, Nullable`1 boost)
   at SolrNet.Commands.AddCommand`1.ConvertToXml()
   at SolrNet.Commands.AddCommand`1.Execute(ISolrConnection connection)
   at SolrNet.Impl.SolrBasicServer`1.SendAndParseHeader(ISolrCommand cmd)
   at SolrNet.Impl.SolrBasicServer`1.AddWithBoost(IEnumerable`1 docs, AddParameters parameters)
   at SolrNet.Impl.SolrServer`1.AddRange(IEnumerable`1 docs, AddParameters parameters)
   at SolrNet.Impl.SolrServer`1.AddRange(IEnumerable`1 docs)

Thanks,
Dorin

Mauricio Scheffer

unread,
Nov 18, 2014, 9:50:07 AM11/18/14
to sol...@googlegroups.com
I think that's the same problem as in https://github.com/mausch/SolrNet/pull/166 .
I just linked from that pull request to this thread as a reminder, when I get some time to review that pull request :-(

Cheers



--
Mauricio

--
You received this message because you are subscribed to the Google Groups "SolrNet" group.
To unsubscribe from this group and stop receiving emails from it, send an email to solrnet+u...@googlegroups.com.
To post to this group, send email to sol...@googlegroups.com.
Visit this group at http://groups.google.com/group/solrnet.
For more options, visit https://groups.google.com/d/optout.

Dorin Oltean

unread,
Nov 18, 2014, 10:21:57 AM11/18/14
to sol...@googlegroups.com
That is not the reason why I get the exception, because none of the values I send are List<>.
I managed to not get this error not throwed by not calling addDocuments from different threads.

Probably somewhere in the documentatino is specified that it is not thread safe.


On Tue Nov 18 2014 at 4:50:07 PM Mauricio Scheffer <mauricio...@gmail.com> wrote:
I think that's the same problem as in https://github.com/mausch/SolrNet/pull/166 .
I just linked from that pull request to this thread as a reminder, when I get some time to review that pull request :-(

Cheers



--
Mauricio

On Tue, Nov 18, 2014 at 2:10 PM, Dorin Oltean <dorin...@gmail.com> wrote:
Hey,
I am getting this error and cant seem to find the reason ??? Do you know what a possible reason should be for this ???
Looking over this SolrDictionarySerializer file it doesn't look like this exception is possible

Below is the stacktrace.
System.NullReferenceException: Object reference not set to an instance of an object.
   at SolrNet.Impl.SolrDictionarySerializer.Serialize(Dictionary`2 doc, Nullable`1 boost)
   at SolrNet.Commands.AddCommand`1.ConvertToXml()
   at SolrNet.Commands.AddCommand`1.Execute(ISolrConnection connection)
   at SolrNet.Impl.SolrBasicServer`1.SendAndParseHeader(ISolrCommand cmd)
   at SolrNet.Impl.SolrBasicServer`1.AddWithBoost(IEnumerable`1 docs, AddParameters parameters)
   at SolrNet.Impl.SolrServer`1.AddRange(IEnumerable`1 docs, AddParameters parameters)
   at SolrNet.Impl.SolrServer`1.AddRange(IEnumerable`1 docs)

Thanks,
Dorin

--
You received this message because you are subscribed to the Google Groups "SolrNet" group.
To unsubscribe from this group and stop receiving emails from it, send an email to solrnet+unsubscribe@googlegroups.com.

To post to this group, send email to sol...@googlegroups.com.
Visit this group at http://groups.google.com/group/solrnet.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "SolrNet" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/solrnet/84_PQiNP4Ok/unsubscribe.
To unsubscribe from this group and all its topics, send an email to solrnet+unsubscribe@googlegroups.com.

Dorin Oltean

unread,
Nov 18, 2014, 10:28:52 AM11/18/14
to sol...@googlegroups.com
SOLVED.
One of the values in the dictionary was null. And that is why the exception was throwed.
Thanks for the different perspective.

Mauricio Scheffer

unread,
Nov 18, 2014, 10:30:57 AM11/18/14
to sol...@googlegroups.com
Great, but any NullReferenceException thrown from SolrNet is a bug in SolrNet. I'll try to throw a more specific exception at least.

Cheers



--
Mauricio

To unsubscribe from this group and stop receiving emails from it, send an email to solrnet+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages