zbus rpc不支持com.jfinal.plugin.activerecord.Page类型
@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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
亲
这不是zbus 的问题。而是fastjson的问题 。因为jfinal里的page 对象没有默认构造函数。
你可以自己封装一个page对象来使用就是了。