2021-05-25 17:59:42
[ERROR]-[Thread: MQTT Call: org-19922877693696-test1234]-[cn.org.zhny.base.JBoltBaseModel._getTable()]: class cn.org.zhny.common.model.Weather can not mapping to database table,maybe application cannot connect to database.
连接断开,可以做重连
MqttException (0) - java.lang.RuntimeException: class cn.org.zhny.common.model.Weather can not mapping to database table,maybe application cannot connect to database.
at org.eclipse.paho.client.mqttv3.internal.CommsCallback.run(CommsCallback.java:228)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: class cn.org.zhny.common.model.Weather can not mapping to database table,maybe application cannot connect to database.
at cn.org.zhny.base.JBoltBaseModel._getTable(JBoltBaseModel.java:139)
at cn.org.zhny.base.JBoltBaseModel._getPrimaryKeys(JBoltBaseModel.java:174)
at cn.org.zhny.base.JBoltBaseModel._getPrimaryKey(JBoltBaseModel.java:162)
at cn.org.zhny.base.JBoltBaseModel._initPrimaryKey(JBoltBaseModel.java:196)
at cn.org.zhny.base.JBoltBaseModel.save(JBoltBaseModel.java:213)
at cn.org.zhny.mqtt.PushCallback.handleMsg(PushCallback.java:92)
at cn.org.zhny.mqtt.PushCallback.messageArrived(PushCallback.java:73)
at org.eclipse.paho.client.mqttv3.internal.CommsCallback.deliverMessage(CommsCallback.java:519)
at org.eclipse.paho.client.mqttv3.internal.CommsCallback.handleMessage(CommsCallback.java:417)
at org.eclipse.paho.client.mqttv3.internal.CommsCallback.run(CommsCallback.java:214)
... 1 more
能正常启动,在config文件的onStart方法里的语句也能连接数据库并输出
但是在另一个地方的保存就报错,不知道怎么回事???这个保存是在mqtt的回调函数里,这个应该怎么操作那??
是不是 arp.addMapping("user", User.class);
https://jfinal.com/doc/5-2
没有建立了数据库表名到Model的映射关系啊?
可以用Db + Record 保存试试。