Skip to content
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

ES6.6.1通过Mysql加载字典的问题 #169

Open
onaple opened this issue Sep 5, 2019 · 1 comment
Open

ES6.6.1通过Mysql加载字典的问题 #169

onaple opened this issue Sep 5, 2019 · 1 comment

Comments

@onaple
Copy link

onaple commented Sep 5, 2019

plugin-security.policy 配置
grant { permission java.lang.RuntimePermission "getClassLoader"; permission java.lang.RuntimePermission "setContextClassLoader"; permission java.io.FilePermission "<<ALL FILES>>", "read,write"; permission java.net.SocketPermission "*:*", "accept,connect,resolve"; };

jdbc jar :
mysql-connector-java-5.1.17.jar (注mysql MySQL 5.7)

本地基于插件跑test可以获取流文件:
测试的方法: org.ansj.dic.impl.Jdbc2Stream#toStream方法

但是es启动报错如下:

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

@shi-yuan
Copy link
Member

shi-yuan commented Sep 8, 2019

请问,字典的url是如何配置的?

# 全局变量配置方式一
ansj:
  ......
  # 从数据库中加载
  dic_d3: jdbc://jdbc:mysql://xxxx:3306/ttt?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull|username|password|select name as name,nature,freq from dic where type=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

2 participants