flask-restful-pyhanlp新手遇到python调用hanlp出现问题

基本情况:

通过flask_restful与pyhanlp做了一个接口,访问该接口返回情感预测值。在win环境下运行一切正常。

部署在centos8环境中,conda虚拟环境(与win的python版本还有包全部一致),uwsgi+niginx,运行到safeJclass()这块就没有返回了。

路由中还有纯python编写的接口,访问都正常。

排错过程中通过命令窗口进入到centos虚拟环境中,通过交互式界面运行这些代码都没有问题。

text_classifier =NaiveBayesClassifier(IOUtil.readObjectFrom(model_pat
h))
from pyhanlp import *
NaiveBayesClassifier = SafeJClass(‘com.hankcs.hanlp.classification.classi
fiers.NaiveBayesClassifier’)
IOUtil = SafeJClass(‘com.hankcs.hanlp.corpus.io.IOUtil’)
model_path1=’./server/product_frequency/ChnSentiCorp.ser’
text_classifier =NaiveBayesClassifier(IOUtil.readObjectFrom(model_pat
h1))
result1=text_classifier.classify(“机柜偶i哦打死都汽车,大众高尔夫数据库的
急啊离开发窘蛋糕i风格就是对方”)
print(result1)
问题分析:

已经基本定位到在通过JPype调用java时候没有响应(或者响应超时。)

服务器中的java版本1.8 与win中的java环境一样。

请问谁遇到过类似问题,帮忙解答一下,谢啦