java - org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: Specified map is empty -


i find question related problem, there no answer it. here link

i using spring-mvc catch json serialization.

the stack trace follows:

     org.springframework.http.converter.httpmessagenotwritableexception: not write json: specified map empty (through reference chain: com.captain.common.core.base.ajaxpackvo["volist"]->java.util.arraylist[0]); nested exception com.fasterxml.jackson.databind.jsonmappingexception: specified map empty (through reference chain: com.captain.common.core.base.ajaxpackvo["volist"]->java.util.arraylist[0])     @ org.springframework.http.converter.json.mappingjackson2httpmessageconverter.writeinternal(mappingjackson2httpmessageconverter.java:207)     @ org.springframework.http.converter.abstracthttpmessageconverter.write(abstracthttpmessageconverter.java:180)     @ org.springframework.web.servlet.mvc.method.annotation.abstractmessageconvertermethodprocessor.writewithmessageconverters(abstractmessageconvertermethodprocessor.java:143)     @ org.springframework.web.servlet.mvc.method.annotation.abstractmessageconvertermethodprocessor.writewithmessageconverters(abstractmessageconvertermethodprocessor.java:89)     @ org.springframework.web.servlet.mvc.method.annotation.requestresponsebodymethodprocessor.handlereturnvalue(requestresponsebodymethodprocessor.java:189)     @ org.springframework.web.method.support.handlermethodreturnvaluehandlercomposite.handlereturnvalue(handlermethodreturnvaluehandlercomposite.java:69)     @ org.springframework.web.servlet.mvc.method.annotation.servletinvocablehandlermethod.invokeandhandle(servletinvocablehandlermethod.java:122)     @ org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.invokehandlemethod(requestmappinghandleradapter.java:745)     @ org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.handleinternal(requestmappinghandleradapter.java:685)     @ org.springframework.web.servlet.mvc.method.abstracthandlermethodadapter.handle(abstracthandlermethodadapter.java:80)     @ org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:919)     @ org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:851)     @ org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:953)     @ org.springframework.web.servlet.frameworkservlet.doget(frameworkservlet.java:844)     @ javax.servlet.http.httpservlet.service(httpservlet.java:621)     @ org.springframework.web.servlet.frameworkservlet.service(frameworkservlet.java:829)     @ javax.servlet.http.httpservlet.service(httpservlet.java:728)     @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:305)     @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:210)     @ org.apache.tomcat.websocket.server.wsfilter.dofilter(wsfilter.java:51)     @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:243)     @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:210)     @ com.opensymphony.sitemesh.webapp.sitemeshfilter.dofilter(sitemeshfilter.java:65)     @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:243)     @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:210)     @ com.captain.controller.core.htmlescaperfilter.dofilter(htmlescaperfilter.java:18)     @ org.springframework.web.filter.delegatingfilterproxy.invokedelegate(delegatingfilterproxy.java:343)     @ org.springframework.web.filter.delegatingfilterproxy.dofilter(delegatingfilterproxy.java:260)     @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:243)     @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:210)     @ org.apache.shiro.web.servlet.proxiedfilterchain.dofilter(proxiedfilterchain.java:61)     @ org.apache.shiro.web.servlet.advicefilter.executechain(advicefilter.java:108)     @ org.apache.shiro.web.servlet.advicefilter.dofilterinternal(advicefilter.java:137)     @ org.apache.shiro.web.servlet.onceperrequestfilter.dofilter(onceperrequestfilter.java:125)     @ org.apache.shiro.web.servlet.proxiedfilterchain.dofilter(proxiedfilterchain.java:66)     @ org.apache.shiro.web.servlet.abstractshirofilter.executechain(abstractshirofilter.java:449)     @ org.apache.shiro.web.servlet.abstractshirofilter$1.call(abstractshirofilter.java:365)     @ org.apache.shiro.subject.support.subjectcallable.docall(subjectcallable.java:90)     @ org.apache.shiro.subject.support.subjectcallable.call(subjectcallable.java:83)     @ org.apache.shiro.subject.support.delegatingsubject.execute(delegatingsubject.java:383)     @ org.apache.shiro.web.servlet.abstractshirofilter.dofilterinternal(abstractshirofilter.java:362)     @ org.apache.shiro.web.servlet.onceperrequestfilter.dofilter(onceperrequestfilter.java:125)     @ org.springframework.web.filter.delegatingfilterproxy.invokedelegate(delegatingfilterproxy.java:343)     @ org.springframework.web.filter.delegatingfilterproxy.dofilter(delegatingfilterproxy.java:260)     @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:243)     @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:210)     @ org.springframework.web.filter.characterencodingfilter.dofilterinternal(characterencodingfilter.java:88)     @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:106)     @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:243)     @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:210)     @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:222)     @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:123)     @ org.apache.catalina.authenticator.authenticatorbase.invoke(authenticatorbase.java:502)     @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:171)     @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:100)     @ org.apache.catalina.valves.accesslogvalve.invoke(accesslogvalve.java:953)     @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:118)     @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:408)     @ org.apache.coyote.http11.abstracthttp11processor.process(abstracthttp11processor.java:1041)     @ org.apache.coyote.abstractprotocol$abstractconnectionhandler.process(abstractprotocol.java:603)     @ org.apache.tomcat.util.net.jioendpoint$socketprocessor.run(jioendpoint.java:312)     @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1110)     @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:603)     @ java.lang.thread.run(thread.java:722) caused by: com.fasterxml.jackson.databind.jsonmappingexception: specified map empty (through reference chain: com.captain.common.core.base.ajaxpackvo["volist"]->java.util.arraylist[0])     @ com.fasterxml.jackson.databind.serializerprovider._createandcacheuntypedserializer(serializerprovider.java:1061)     @ com.fasterxml.jackson.databind.serializerprovider.findvalueserializer(serializerprovider.java:487)     @ com.fasterxml.jackson.databind.ser.std.beanserializerbase.resolve(beanserializerbase.java:315)     @ com.fasterxml.jackson.databind.ser.serializercache.addandresolvenontypedserializer(serializercache.java:148)     @ com.fasterxml.jackson.databind.serializerprovider._createandcacheuntypedserializer(serializerprovider.java:1046)     @ com.fasterxml.jackson.databind.serializerprovider.findvalueserializer(serializerprovider.java:445)     @ com.fasterxml.jackson.databind.ser.impl.propertyserializermap.findandaddsecondaryserializer(propertyserializermap.java:95)     @ com.fasterxml.jackson.databind.ser.std.asarrayserializerbase._findandadddynamic(asarrayserializerbase.java:268)     @ com.fasterxml.jackson.databind.ser.impl.indexedlistserializer.serializecontents(indexedlistserializer.java:96)     @ com.fasterxml.jackson.databind.ser.impl.indexedlistserializer.serializecontents(indexedlistserializer.java:21)     @ com.fasterxml.jackson.databind.ser.std.asarrayserializerbase.serialize(asarrayserializerbase.java:183)     @ com.fasterxml.jackson.databind.ser.beanpropertywriter.serializeasfield(beanpropertywriter.java:505)     @ com.fasterxml.jackson.databind.ser.std.beanserializerbase.serializefields(beanserializerbase.java:639)     @ com.fasterxml.jackson.databind.ser.beanserializer.serialize(beanserializer.java:152)     @ com.fasterxml.jackson.databind.ser.defaultserializerprovider.serializevalue(defaultserializerprovider.java:114)     @ com.fasterxml.jackson.databind.objectmapper.writevalue(objectmapper.java:1887)     @ org.springframework.http.converter.json.mappingjackson2httpmessageconverter.writeinternal(mappingjackson2httpmessageconverter.java:204)     ... 63 more caused by: java.lang.illegalargumentexception: specified map empty     @ java.util.enummap.<init>(enummap.java:176)     @ com.fasterxml.jackson.databind.util.enumvalues.<init>(enumvalues.java:26)     @ com.fasterxml.jackson.databind.util.enumvalues.constructfromname(enumvalues.java:50)     @ com.fasterxml.jackson.databind.util.enumvalues.construct(enumvalues.java:33)     @ com.fasterxml.jackson.databind.ser.std.enumserializer.construct(enumserializer.java:82)     @ com.fasterxml.jackson.databind.ser.basicserializerfactory.buildenumserializer(basicserializerfactory.java:838)     @ com.fasterxml.jackson.databind.ser.basicserializerfactory.findserializerbyprimarytype(basicserializerfactory.java:402)     @ com.fasterxml.jackson.databind.ser.beanserializerfactory._createserializer2(beanserializerfactory.java:217)     @ com.fasterxml.jackson.databind.ser.beanserializerfactory.createserializer(beanserializerfactory.java:152)     @ com.fasterxml.jackson.databind.serializerprovider._createuntypedserializer(serializerprovider.java:1077)     @ com.fasterxml.jackson.databind.serializerprovider._createandcacheuntypedserializer(serializerprovider.java:1056)     ... 79 more 

i sure "volist" has 1 object.

why "specified map empty" ?

does 1 see problem before ?

ok fault :-(. deal 1 'enum' attribute in 'volist' have not define element it. below:

public class usertype { } 

just other information...


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -