我的nutz版本是1.r.63.r2
使用mvc定义了两个controller:DataController、FolderController
我在前端同时发两个请求,一个请求FolderController的service/folder/queryFolders接口;一个请求DataController的service/data/getUserTableMetas接口
有时getUserTableMetas的请求会报以下错误:
java.lang.ClassCastException: com.gistech.ba.controller.DataController$$NUTZAOP cannot be cast to com.gistech.ba.controller.FolderController
at com.gistech.ba.controller.FolderController$FM$queryFolders$c2c1340a494ba25832f2f6a9154f67a1.invoke(FolderController.java)
at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:31)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:30)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at com.gistech.ba.filter.AccessControlFilter.process(AccessControlFilter.java:162)
at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:62)
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:202)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.gistech.ba.filter.CorsFilter.doFilter(CorsFilter.java:50)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
FolderController定义如下:
@IocBean
@At("/service/folder")
public class FolderController {
@Aop({ "analog" })
@At("/queryFolders")
@GET
@POST
@Ok("json")
public Response queryFolders(@Param("tag") String tag, @Param("parentId") String parentId, @Param("folderName") String folderName,
HttpServletRequest request) {
Response res = Response.getInstance();
return res;
}
}
DataController定义如下:
@IocBean
@At("/service/data")
public class DataController {
@Aop({ "analog" })
@At("/getUserTableMetas")
@GET
@POST
@Ok("json")
public Response getUserTableMetas(@Param("currentPage") int currentPage, @Param("pageSize") int pageSize,
@Param("keyword") String keyword, @Param("folderId") String folderId, HttpServletRequest request) {
Response res = Response.getInstance();
return res;
}
}
麻烦帮忙看下是什么原因,谢谢!