com.jfinal.plugin.activerecord.ActiveRecordException: The attribute name does not exist: XXX

最近刚发现的一个问题:

 我们在测试环境修改的数据库的表结构,对应的在jfinal对应的base中也加入了新的字段,测试环境全部测试ok之后,发布生产环境时报错:com.jfinal.plugin.activerecord.ActiveRecordException: The attribute name does not exist: XXX,当时就感到很疑惑,重新把服务端发布了之后,项目就正常了..

 

结果

是因为我们的操作是先发布的项目后执行的数据库脚本,应该是jfinal在第一次启动的时候,并没有直接找到我新增的那个字段,

在我重新发布之后,因为这时候脚本已经执行过了,所以他就可以找到那个字段,就不会报错了

com.jfinal.plugin.activerecord.ActiveRecordException: The attribute name does not exist: XXX

com.jfinal.plugin.activerecord.ActiveRecordException: The attribute name does not exist: XXX

 

 

 

 

用jfinal做数据库交互的时候