NutzCN Logo
问答 我要修改时间客户每次第一次进入修改就会报错
发布于 2335天前 作者 悟丶静心 2213 次浏览 复制 上一个帖子 下一个帖子
标签:
org.nutz.castor.FailToCastObjectException: '2016-07-02 14:59:00:00' to java.util.Date
	at org.nutz.castor.castor.DateTimeCastor.toDate(DateTimeCastor.java:17)
	at org.nutz.castor.castor.String2Datetime.cast(String2Datetime.java:12)
	at org.nutz.castor.castor.String2Datetime.cast(String2Datetime.java:5)
	at org.nutz.castor.Castors.cast(Castors.java:252)
	at org.nutz.castor.Castors.castTo(Castors.java:318)
	at org.nutz.castor.castor.Array2Object.cast(Array2Object.java:21)
	at org.nutz.castor.Castors.cast(Castors.java:252)
	at org.nutz.castor.Castors.castTo(Castors.java:318)
	at org.nutz.mvc.adaptor.injector.NameInjector.fromReqParam(NameInjector.java:117)
	at org.nutz.mvc.adaptor.injector.NameInjector.get(NameInjector.java:102)
	at org.nutz.mvc.adaptor.AbstractAdaptor.adapt(AbstractAdaptor.java:257)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:28)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:198)
	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:110)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
	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:962)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
	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:722)
Caused by: java.lang.RuntimeException: Unexpect date format '2016-07-02 14:59:00:00'
	at org.nutz.lang.Lang.makeThrow(Lang.java:131)
	at org.nutz.lang.Times.ams(Times.java:207)
	at org.nutz.lang.Times.ams(Times.java:121)
	at org.nutz.lang.Times.D(Times.java:324)
	at org.nutz.castor.castor.DateTimeCastor.toDate(DateTimeCastor.java:11)
	... 40 more
5 回复

这日期明显不对

但是第二次修改就没有错误了

public String editsj(String yuyue_no, Date pz) {
		Work_yuyue_pzEntity yuyue = dao.fetch(Work_yuyue_pzEntity.class,
				yuyue_no);
		yuyue.setYuyue_yjjcrq(pz);
		dao.update(yuyue);
		return jsons.json(1, 1, 1, "成功");
	}

你页面的问题,发了个不合法的值

那为什么第二次修改的时候是一模一样的值就没问题,能不能在后台处理下

在根源解决

添加回复
请先登陆
回到顶部