我的jdk版本1.7.0_79,tomcat7电脑是mac系统。
同样的代码在别人的电脑1.7.0_2低版本跑就没有问题,这个问题已经折磨我一下午了!!!!!
下面是代码和错误代码,求救~~
Invoice invoice=getModel(Invoice.class,"invoice");
2017-08-07 18:27:09 [ERROR]-[Thread: http-bio-8080-exec-4]-[com.jfinal.core.ActionHandler.handle()]: /invoice/saveMessage java.lang.ClassCastException: org.apache.catalina.util.ParameterMap cannot be cast to java.util.HashMap at com.yawa.core.wrapper.RequestWrapper.getParameterMap(RequestWrapper.java:44) at com.jfinal.core.ModelInjector.injectActiveRecordModel(ModelInjector.java:87) at com.jfinal.core.ModelInjector.inject(ModelInjector.java:50) at com.jfinal.core.Controller.getModel(Controller.java:654) at com.yawa.invoice.controller.InvoiceController.saveMessage(InvoiceController.java:74) 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.aop.Invocation.invoke(Invocation.java:71) at com.yawa.core.interceptor.SessionInterceptor.intercept(SessionInterceptor.java:66) at com.jfinal.aop.Invocation.invoke(Invocation.java:65) at com.jfinal.core.ActionHandler.handle(ActionHandler.java:74) at com.yawa.core.handler.XssHandler.handle(XssHandler.java:18) 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.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:745)
项目:JFinal
Map parasMap = request.getParameterMap();
从上面代码可以看出来,变量类型是 java.util.Map,这是绝对不可能出错的,而你的异常提示接收参数的类型是 java.util.HashMap。很明显示是对 jfinal 源码进行改造过的版本