zbus rpc不支持com.jfinal.plugin.activerecord.Page类型

hypocrite11 发布于 2016/02/01 15:58
阅读 646
收藏 0

@JFinal @少帮主 你好,想跟你请教个问题:

尝试了一下rpc的直连,发现zbus不支持JFinal的com.jfinal.plugin.activerecord.Page类型。

BlogController

setAttr("blogPage", blogService.paginate(getParaToInt(0, 1), 10));
render("blog.html");


BlogServiceImpl

public Page<Blog> paginate(int pageNumber, int pageSize) {
     return Blog.me.paginate(pageNumber, pageSize, "select *", "from blog order by id asc");
}

错误如下:

[] [] [ERROR]-[Thread: http-nio-80-exec-6]-[com.jfinal.core.ActionHandler.handle()]: /blog/
org.zbus.rpc.RpcException
at org.zbus.rpc.JsonRpcCodec.decodeResponse(JsonRpcCodec.java:153)
at org.zbus.rpc.RpcInvoker.invokeSync(RpcInvoker.java:145)
at org.zbus.rpc.RpcInvoker.invokeSync(RpcInvoker.java:90)
at org.zbus.rpc.RpcInvoker.invokeSync(RpcInvoker.java:86)
at org.zbus.rpc.RpcInvocationHandler.invoke(RpcFactory.java:127)
at com.sun.proxy.$Proxy11.paginate(Unknown Source)
at com.platform.mvc.blog.BlogController.index(BlogController.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.jfinal.aop.Invocation.invoke(Invocation.java:73)
at com.jfinal.core.ActionHandler.handle(ActionHandler.java:74)
at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1527)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1484)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)



加载中
0
callmeHEN
callmeHEN

这不是zbus 的问题。而是fastjson的问题 。因为jfinal里的page 对象没有默认构造函数。

你可以自己封装一个page对象来使用就是了。

返回顶部
顶部