我在 WSO2-SI(流集成商)工作并构建一些 siddhi 应用程序。我开始需要使用 siddhi 商店中提供的 mongodb-store 扩展。我安装了扩展并使用 mongodb 配置了 @store。但似乎,我无法运行该应用程序,因为我遇到了错误com/mongodb/MongoException
。有时,当我重新启动 SI 时,我看到com/mongodb/MongoSocketOpenException
. 我不知道为什么会发生以及如何调试此错误。我可以在目录下看到 mongodb jar 文件{WSO2-SI-HOME}/lib/
,因此安装了扩展但无法正常工作。
这是我的 siddhi 应用程序的完整代码:
@App:name("MongoDB search")
@App:description("desc is here")
define stream SearchID (id string)
-- Exceptions appears here: com/mongodb/MongoException or com/mongodb/MongoSocketOpenException
@store(type="mongodb", mongodb.uri="mongodb://user:password@127.0.0.1:27017/database_name?replicaSet=rs0", collection.name="users")
define table UsersTable (id string, date_of_birth string, gender string, height_cm double, weight_kg double);
@sink(type='log', prefix='Logging')
define stream ListeningLogs(id string, Date_of_Birth string, Gender string, Height double, Original_Weight double)
@info(name='logging')
from SearchID as s join UsersTable as u
on s.id == u.id
select u.id, u.date_of_birth as Date_of_Birth, u.gender as Gender, u.height_cm as Height, u.weight_kg as Original_Weight
insert into ListeningLogs;
添加了新行
我在服务器上测试了应用程序,发现了以下原因:
Caused by: java.lang.NoClassDefFoundError: com/mongodb/MongoSocketOpenException
...
Caused by: java.lang.ClassNotFoundException: com.mongodb.MongoSocketOpenException cannot be found by siddhi-store-mongodb_2.1.1
但我不知道,如何解决它。