控制器写法:
对model
配置:
报如下错误:
java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class com.shop.model.ImsZofuiSalesGood and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)
at com.jfinal.json.Jackson.toJson(Jackson.java:93)
at com.jfinal.kit.JsonKit.toJson(JsonKit.java:28)
at com.jfinal.render.JsonRender.<init>(JsonRender.java:125)
at com.jfinal.render.RenderFactory.getJsonRender(RenderFactory.java:103)
at com.jfinal.core.Controller.renderJson(Controller.java:1133)
at com.shop.blog.TestController.findById(TestController.java:14)
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:498)
at com.jfinal.aop.Invocation.invoke(Invocation.java:75)
at com.jfinal.plugin.activerecord.tx.TxByActionKeys.intercept(TxByActionKeys.java:57)
at com.jfinal.aop.Invocation.invoke(Invocation.java:69)
at com.jfinal.plugin.activerecord.tx.TxByActionKeyRegex.intercept(TxByActionKeyRegex.java:61)
at com.jfinal.aop.Invocation.invoke(Invocation.java:69)
at com.jfinal.plugin.activerecord.tx.TxByMethods.intercept(TxByMethods.java:57)
at com.jfinal.aop.Invocation.invoke(Invocation.java:69)
at com.jfinal.plugin.activerecord.tx.TxByMethodRegex.intercept(TxByMethodRegex.java:61)
at com.jfinal.aop.Invocation.invoke(Invocation.java:69)
at com.jfinal.core.ActionHandler.handle(ActionHandler.java:81)
at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:86)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132)
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)