开发者社区> 问答> 正文

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


@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

展开
收起
爱吃鱼的程序员 2020-06-10 10:54:24 769 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    手动看一下远程的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 

    2020-06-10 10:54:41
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
如何运维千台以上游戏云服务器 立即下载
网站/服务器取证 实践与挑战 立即下载
ECS块储存产品全面解析 立即下载