model.save()插入数据失败,但同项目下同类型插入可以成功


    直接在mysql上可以插入,传参也没错但是就是在这个save()语句报错跑不过去,求解答

public void newTask(String curid,String curtime,String deadline,String title,String detail ){

System.out.println(curid+"===="+curtime+"===="+deadline+"===="+title+"===="+detail);

new Task().set("CUR_ID",curid)

 .set("CUR_TIME", curtime)

 .set("DEADLINE",deadline)

 .set("TITLE",title)

 .set("DETAIL", detail).save();

System.out.println("already insert");

}

下面是报错信息

[ERROR] [20:42:17] com.jfinal.core.ActionHandler - /task/insertTask

   com.jfinal.render.RenderException: java.lang.RuntimeException: File not found : E:\WorkSpce\apache-tomcat-7.0.73\webapps\HomeWork_System/task/insertTask.html

at com.jfinal.render.TemplateRender.render(TemplateRender.java:62)

at com.jfinal.core.ActionHandler.handle(ActionHandler.java:108)

at syzhou.handler.PermissionHandler.handle(PermissionHandler.java:28)

at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:73)

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:218)

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:169)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)

at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:958)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:452)

at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087)

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)

at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2517)

at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2506)

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)

跪求各位大大帮忙解答!!!

评论区

zhangtianxiao

2018-04-28 01:55

报错信息是File not found , 跟你数据库操作没关系. 调一下render方法就好了

白吃小菜

2018-04-28 14:13

@zhangtianxiao 我现在不报file not found ,但那个数据库插入还是不行,第一个system.out可以打印出参数是正确的,但就是无法通过sql语句,另一个class里用额同样的方法却可以正确插入

白吃小菜

2018-04-28 14:54

@zhangtianxiao 找到原因了,数据库里有一个字段是保存文章的varchar 2000,取消这个字段就能过去了,现在不知道是String不支持还是Jfinal对插入数据大小有限制,求解答@JFinal

JFinal

2018-04-29 10:20

@白吃小菜 是保存的时候超出数据库字段指定的长度,这个肯定是与 jfinal 无关的

热门反馈

扫码入社