jfinal项目启动异常,十万火急,望大家不吝赐教

jfinal项目启动异常,暂无法解决,十万火急,望大家不吝赐教:

Exception in thread "main" java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    com/oillab/article/article/controller/ArticleApiController.add(Lcom/oillab/article/article/model/Article;)V @11: invokevirtual
  Reason:
    Type 'com/oillab/article/article/model/Article' (current frame, stack[2]) is not assignable to 'com/jfinal/ext/common/model/BaseModel'
  Current Frame:
    bci: @11
    flags: { }
    locals: { 'com/oillab/article/article/controller/ArticleApiController', 'com/oillab/article/article/model/Article' }
    stack: { 'com/oillab/article/article/controller/ArticleApiController', 'com/oillab/article/article/controller/ArticleApiController', 'com/oillab/article/article/model/Article' }
  Bytecode:
    0x0000000: 2b2a b600 0db6 000e 2a2a 2bb6 000f b600
    0x0000010: 0bb1                                   

	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
	at java.lang.Class.getDeclaredMethods(Class.java:1975)
	at com.jfinal.core.ActionMapping.buildActionMapping(ActionMapping.java:66)
	at com.jfinal.core.JFinal.initActionMapping(JFinal.java:103)
	at com.jfinal.core.JFinal.init(JFinal.java:64)
	at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:64)
	at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:111)
	at io.undertow.servlet.core.ManagedFilter.createFilter(ManagedFilter.java:80)
	at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:591)
	at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:556)
	at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
	at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
	at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:598)
	at com.jfinal.server.undertow.UndertowServer.configHttp(UndertowServer.java:287)
	at com.jfinal.server.undertow.UndertowServer.doStart(UndertowServer.java:265)
	at com.jfinal.server.undertow.UndertowServer.start(UndertowServer.java:158)
	at com.jfinal.ext.starter.ServerStarter.run(ServerStarter.java:51)
	at com.jfinal.ext.starter.ServerStarter.run(ServerStarter.java:22)
	at com.oillab.Main.main(Main.java:26)

> Task :api:Main.main() FAILED

相关代码:

// ArticleApiController
public void add(@Para("") Article article) {
    article.setUid(getUserId());
    renderJson(checkAndAdd(article));
}

model继承关系:

Article --> BaseArticle --> BaseModel --> Model

评论区

lyh061619

2020-10-19 01:16

注意看下错误提示:is not assignable to 'com/jfinal/ext/common/model/BaseModel',建议下载官方demo运行,其实注意看下文档。

BTMTimor

2020-10-19 21:19

@lyh061619 谢谢。这个是maven 转gradle的,maven时是正常的

JFinal

2020-10-20 12:40

VerifyError 是在被加载的类文件验证的时候出了问题,可能是你的 .class 确实有问题,可能是文件被损坏,也有可能是依赖的第三方文件有问题

删掉本地 maven 库中的相关依赖文件所在的目录,让 mavne/gradle 重新下载文件试试