com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "safeKey"

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Dracotianlong/article/details/50485601
Jan 08, 2016 10:33:48 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [springmvc] in context with path [/xxx] threw exception [Request processing failed; nested exception is javax.ws.rs.ProcessingException: Error reading entity from input stream.] with root cause
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "safeKey" (class xxx), not marked as ignorable (3 known properties: "modifyDate", "createDate", "id"])
 at [Source: org.glassfish.jersey.message.internal.EntityInputStream@446d559; line: 1, column: 68] (through reference chain: com.qbao.xx.service.response.QbaoAccountResponse["rows"]->com.xx.bbs.entity.ss["safeKey"])
	at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:51)
	at com.fasterxml.jackson.databind.DeserializationContext.reportUnknownProperty(DeserializationContext.java:671)
	at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:771)
	at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1297)
	at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1275)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:247)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:118)
	at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:525)
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:99)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:242)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:118)
	at com.fasterxml.jackson.databind.ObjectReader._bind(ObjectReader.java:1233)
	at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:677)
	at com.fasterxml.jackson.jaxrs.base.ProviderBase.readFrom(ProviderBase.java:777)
	at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.invokeReadFrom(ReaderInterceptorExecutor.java:257)
	at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.aroundReadFrom(ReaderInterceptorExecutor.java:229)
	at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor.proceed(ReaderInterceptorExecutor.java:149)
	at org.glassfish.jersey.message.internal.MessageBodyFactory.readFrom(MessageBodyFactory.java:1124)
	at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:851)
	at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:783)
	at org.glassfish.jersey.client.ClientResponse.readEntity(ClientResponse.java:326)
	at org.glassfish.jersey.client.InboundJaxrsResponse$1.call(InboundJaxrsResponse.java:111)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:399)
	at org.glassfish.jersey.client.InboundJaxrsResponse.readEntity(InboundJaxrsResponse.java:108)
	at com.xx.bbs.service.client.ServerRequest.rest(ServerRequest.java:189)
	at com.xx.bbs.service.client.ServerRequest.rest(ServerRequest.java:90)
	at com.qbxao.bbs.service.client.QbaoAccountClient.findByAccountKey(QbaoAccountClient.java:57)
	at com.xx.bbs.controller.LoginController.submit(LoginController.java:87)
	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 org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219)
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686)
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at com.planetj.servlet.filter.compression.CompressingFilter.doFilter(CompressingFilter.java:270)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	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:220)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1757)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1716)
	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)


解决如下:添加

JsonIgnoreProperties

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
/**
 * Entity - 管理员
 * 
 * @author xutianlong
 * @version [1.0, Dec 15, 2015]
 * @see [Account/方法]
 * @since [xxx/1.0]
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class Account extends BaseEntity implements Serializable
{}

jersy2.x引入

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;


阅读更多
换一批

ibaties启动报错 t.SqlMapException: Unrecognized parameter mapping field

09-30

ibaties 启动报错:rnCaused by: org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [configs/ibatis/sqlMapConfig.xml]; nested exception is com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: com.ibatis.sqlmap.client.SqlMapException: Unrecognized parameter mapping field: 'RO2CR.ROLE_OBJ_RULE_ID' in rn union allrn SELECT RO2CR.CFG_RULE_ID,RO2CR.ROLE_OBJ_RULE_ID,NULL REQ_OBJ_RELA_ID,RIC.REQ_ITEM_CFG_ID,'1' TYPErn FROM ROLE_OBJ_2_CFG_RULE RO2CR, CFG_RULE CR,CFG_RULE_2_ITEM_CFG CR2IC,REQ_ITEM_CFG RICrn WHERE RO2CR.CFG_RULE_ID = CR.CFG_RULE_ID AND CR2IC.CFG_RULE_ID=CR.CFG_RULE_ID rn AND RIC.REQ_ITEM_CFG_ID=CR2IC.REQ_ITEM_CFG_IDrn and cr.ppm_seq = rn at org.springframework.orm.ibatis.SqlMapClientFactoryBean.buildSqlMapClient(SqlMapClientFactoryBean.java:341)rn at org.springframework.orm.ibatis.SqlMapClientFactoryBean.afterPropertiesSet(SqlMapClientFactoryBean.java:291)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)rn ... 37 morernrnrn源码:rnrn rn SELECT RO2CR.CFG_RULE_ID,RO2CR.ROLE_OBJ_RULE_ID,RO2IC.REQ_OBJ_RELA_ID,RO2IC.REQ_ITEM_CFG_ID,'0' TYPErn FROM ROLE_OBJ_2_CFG_RULE RO2CR, CFG_RULE CR,REQ_OBJ_RELA ROR,REQ_OBJ_2_ITEM_CFG RO2IC,REQ_ITEM_CFG RICrn WHERE RO2CR.CFG_RULE_ID = CR.CFG_RULE_ID AND ROR.CFG_RULE_ID=CR.CFG_RULE_IDrn AND ROR.REQ_OBJ_RELA_ID=RO2IC.REQ_OBJ_RELA_ID AND RIC.REQ_ITEM_CFG_ID=RO2IC.REQ_ITEM_CFG_IDrn and cr.ppm_seq = #seq#rn and ro2cr.offer_role_id = #offerRoleId:DECIMALrn and ror.obj_id=#objId#rn union allrn SELECT RO2CR.CFG_RULE_ID,RO2CR.ROLE_OBJ_RULE_ID,NULL REQ_OBJ_RELA_ID,RIC.REQ_ITEM_CFG_ID,'1' TYPErn FROM ROLE_OBJ_2_CFG_RULE RO2CR, CFG_RULE CR,CFG_RULE_2_ITEM_CFG CR2IC,REQ_ITEM_CFG RICrn WHERE RO2CR.CFG_RULE_ID = CR.CFG_RULE_ID AND CR2IC.CFG_RULE_ID=CR.CFG_RULE_ID rn AND RIC.REQ_ITEM_CFG_ID=CR2IC.REQ_ITEM_CFG_IDrn and cr.ppm_seq = #seq#rn and ro2cr.offer_role_id = #offerRoleId:DECIMALrn and ric.item_spec_id=#itemSpecId#rn rn rn rnrnrn rn rn rn rn rn rnrn怎么就报错了啊,是不是不能用union进行拼接,union 下面的SQL去掉就不报错了,不知道咋回事啊!!!!

没有更多推荐了,返回首页