Skip to content

9.0.0版本使用远端扩展字典时报错: null_pointer_exception #1104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
trigold1218 opened this issue May 9, 2025 · 5 comments
Open

Comments

@trigold1218
Copy link

Description

GET /_analyze
{
    "analyzer":"ik_max_word",
    "text":"单身狗单身狗单身"
}
{
  "error": {
    "root_cause": [
      {
        "type": "null_pointer_exception",
        "reason": """Cannot invoke "org.wltea.analyzer.dic.DictSegment.match(char[], int, int)" because "org.wltea.analyzer.dic.Dictionary.singleton._StopWords" is null"""
      }
    ],
    "type": "null_pointer_exception",
    "reason": """Cannot invoke "org.wltea.analyzer.dic.DictSegment.match(char[], int, int)" because "org.wltea.analyzer.dic.Dictionary.singleton._StopWords" is null"""
  },
  "status": 500
}

Steps to reproduce

配置如下:当开启 remote_ext_dict 后必然复现此错误;注释后重启恢复正常

Image

测试的字典文件如下:keywords.dic

adw
烏列爾
轉蛋
发送到
我的大
1
2
3
4
5
6
7
8
9
0
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z

Expected behavior

能够正常进行分词

Actual behavior

A description of what happens instead.

Environment

  • 系统环境: docker
  • ES版本: Elasticsearch 9.0.0
  • IK 版本: 9.0.0 (2025-4-25号的版本)
@trigold1218
Copy link
Author

追加:9.0.1也会有这个问题

@kin122
Copy link
Contributor

kin122 commented May 11, 2025

@trigold1218 是不是https的原因,

Image Image

我这里可以正常分词

@xai008
Copy link

xai008 commented May 14, 2025

出现了同样的问题,远程词库是http,elasticsearch.yml 配置文件如下:

xpack.security.enabled: false
xpack.security.http.ssl:
enabled: false
keystore.path: certs/http.p12
xpack.security.transport.ssl:
enabled: false

请问是需要做什么设置吗? 是否因为java24取消了 java.policy 引起?

Environment
系统环境: window
ES版本: Elasticsearch 9.0.1
IK 版本: 9.0.1

@kin122
Copy link
Contributor

kin122 commented May 15, 2025

@xai008 是和java24版本的策略有关系,已经修复了,可以install试一下

@xai008
Copy link

xai008 commented May 15, 2025

@kin122 谢谢 已经测试可行

Environment
系统环境: window
ES版本: Elasticsearch 9.0.1
IK 版本: 9.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants