同样的代码,在本地发布没问题,在服务器发布报错,都是tomcat7?报错-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文

同样的代码,在本地发布没问题,在服务器发布报错,都是tomcat7?报错

爱吃鱼的程序员 2020-06-10 10:54:24 28


@JFinal 你好,想跟你请教个问题:

同样的代码,在本地发布没问题,把部署包复制到服务器发布报错,都是tomcat7;

报错如下。

com.jfinal.plugin.activerecord.ActiveRecordException: java.lang.RuntimeException: The TableMapping of model: com.canyou.model.User not exists. Please add mapping to ActiveRecordPlugin(activeRecordPlugin.addMapping(tableName, YourModel.class)).
 at com.jfinal.plugin.activerecord.Model.find(Model.java:424)
 at com.jfinal.plugin.activerecord.Model.findFirst(Model.java:453)
 at com.canyou.service.LoginService.findByUserName(LoginService.java:127)
 at com.canyou.service.LoginService.login(LoginService.java:49)
 at com.canyou.controller.LoginController.login(LoginController.java:54)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:606)
 at com.jfinal.core.ActionInvocation.invoke(ActionInvocation.java:55)
 at com.canyou.shiro.ShiroInterceptor.intercept(ShiroInterceptor.java:94)
 at com.jfinal.core.ActionInvocation.invoke(ActionInvocation.java:51)
 at com.jfinal.core.ActionHandler.handle(ActionHandler.java:73)
 at com.canyou.handler.XssHandler.handle(XssHandler.java:40)
 at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
 at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
 at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
 at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
 at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
 at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
 at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 at com.canyou.util.NewSessionFilter.doFilter(NewSessionFilter.java:93)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
 at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
 at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
 at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
 at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
 at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: The TableMapping of model: com.canyou.model.User not exists. Please add mapping to ActiveRecordPlugin(activeRecordPlugin.addMapping(tableName, YourModel.class)).
 at com.jfinal.plugin.activerecord.TableInfoMapping.getTableInfo(TableInfoMapping.java:42)
 at com.jfinal.plugin.activerecord.Model.checkTableName(Model.java:434)
 at com.jfinal.plugin.activerecord.Model.find(Model.java:397)
 at com.jfinal.plugin.activerecord.Model.find(Model.java:422)
 ... 43 more

分享到
取消 提交回答
全部回答(1)
  • 爱吃鱼的程序员
    2020-06-10 10:54:41

    手动看一下远程的WEB-INF/classes目录下面是否真的有编译好的class文件,另外,看一下是否掉坑里去了:<atarget="_blank"rel="nofollow">http://my.oschina.net/jfinal/blog/353062 有关Jfinal在jetty环境下开发,tomcat环境下发布造成的问题解决心得。http://my.oschina.net/matol/blog/530445<divclass='ref'>

    引用来自“JFinal”的评论

    手动看一下远程的WEB-INF/classes目录下面是否真的有编译好的class文件,另外,看一下是否掉坑里去了:<atarget="_blank"rel="nofollow">http://my.oschina.net/jfinal/blog/353062 <divclass='ref'><divclass='ref'>

    引用来自“JFinal”的评论

    手动看一下远程的WEB-INF/classes目录下面是否真的有编译好的class文件,另外,看一下是否掉坑里去了:<atarget="_blank"rel="nofollow">http://my.oschina.net/jfinal/blog/353062 

    0 0
云计算
使用钉钉扫一扫加入圈子
+ 订阅

时时分享云计算技术内容,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。

推荐文章