introducing exception capture solr

1, when the defined field error solr

1.1 malformed

Description: There is no isolation between words, a click, select multiple.

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-fbKA0Y3w-1585376211028) (assets / 1583999514974.png)]

Solution: According to the original label re-writing a word.

1.2, word problems jar package

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-A9r5nqKa-1585376211029) (assets / 1583999146722.png)]

Reasons: 1. lack jar package. 2. jar package version is too low.

Solution: put the jar package in line with the solr container / opt / solr / server / solr-webapp / webapp / WEB-INF / lib directory.

Here, the lack of the jar package

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-0VlUKsp6-1585376211032) (assets / 1583999858998.png)]

2, solr can not import data

2.1, multi-threaded breakpoint hit in the thread. As shown below

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-TI3R364q-1585376211033) (assets / 1584029002038.png)]

2.2, it can not import data to solr, there is no error.

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-maVYUsMG-1585376211040) (assets / 1584027861345.png)]

Use the parent class subclass to replace abnormal abnormal arrest .

As can be seen in the figure below, some of the goods tagList missing field values.

Therefore, in the manager.schema solr file edit custom fields required = false set does not have to. The problem is solved.

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-rwFcrDe0-1585376211042) (assets / 1584027690917.png)]

2.3, the code does not go down, use Evaluate tools

Code is blocked for no reason, you can use this tool. It is shown in the figure below, the occurrence of the null pointer process. Click stackTrace (stack trace) can navigate to the location of the problem. Then traced, you can find the problem.

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-dlL8Hl02-1585376211044) (assets / 1584023502926.png)]

3, field names used in solr from SolrDocument objects must manage-schema in the same

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-nFX3jrM6-1585376211048) (assets / 1584164518401.png)]

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-z4tF22Xb-1585376211049) (assets / 1584165323814.png)]

If not the field type, then to return to the leading end of the data:

No data show that the back end will be reported null pointer.

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-mjZZ9jhB-1585376211052) (assets / 1584165435922.png)]

Detailed ProdSolr entity class

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-4OWvHNhp-1585376211054) (assets / 1584165142329.png)]

Published 29 original articles · won praise 0 · Views 2239

Guess you like

Origin blog.csdn.net/rootDream/article/details/105160624