com.sun.xml.bind.api.AccessorException: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection

Kuali JIRA | Jonathan Keller | 5 years ago
  1. 0

    It looks like some of the attributes in the KEW user preferences table are being used to hold JSON objects. However, if the JSON does not un-marshal properly, you get a class cast exception like the below. This resulted in a problem in KFS where routing to one of the main testing users failed (silently) until the user options table was purged. The code which performs this type of conversion should be guarded against format errors so that the property is simply ignored (and deleted?) if parsing fails. {noformat} 2012-06-04 13:26:47,659 [http-8080-26] u:/d: INFO org.apache.cxf.interceptor.LoggingOutInterceptor :: Outbound Message --------------------------- ID: 15705 Response-Code: 500 Encoding: UTF-8 Content-Type: text/xml Headers: {} Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soap:mustUnderstand="1"><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="Signature-31409"> <ds:SignedInfo> <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/> <ds:Reference URI="#id-31410"> <ds:Transforms> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> </ds:Transforms> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <ds:DigestValue>yiHj7C0HzgoLawH9202859xae8s=</ds:DigestValue> </ds:Reference> </ds:SignedInfo> <ds:SignatureValue> enBPUer+spVlHAEUg+YdcQmN25bW+oU8/YtqAQRpQWuR+OToR8M0UpKDGpDGpphHBxHFyqwpt3Yi i8udHxLIN3vuxIsPpU6MSnrGLWP4WSe+OlELbf26mSPH/qSkSR7YrGC4rFIax3aVpem+UWqtCCIU rr6HwOLWyr7TYkttYT0= </ds:SignatureValue> <ds:KeyInfo Id="KeyId-ADE1032ECE8A0D0C27133883080764947114"> <wsse:SecurityTokenReference xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="STRId-ADE1032ECE8A0D0C27133883080764947115"><ds:X509Data> <ds:X509IssuerSerial> <ds:X509IssuerName>CN=rice</ds:X509IssuerName> <ds:X509SerialNumber>1192039189</ds:X509SerialNumber> </ds:X509IssuerSerial> </ds:X509Data></wsse:SecurityTokenReference> </ds:KeyInfo> </ds:Signature></wsse:Security></soap:Header><soap:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="id-31410"><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Marshalling Error: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection</faultstring></soap:Fault></soap:Body></soap:Envelope> -------------------------------------- 2012-06-04 13:26:51,707 [http-8080-3] u:/d: INFO org.apache.cxf.interceptor.LoggingInInterceptor :: Inbound Message ---------------------------- ID: 15706 Address: http://rice.stg.kfs.kuali.org/kr-stg/remoting/soap/kew/v2_0/preferencesService Encoding: UTF-8 Http-Method: POST Content-Type: text/xml; charset=UTF-8 Headers: {Accept=[*/*], cache-control=[no-cache], connection=[keep-alive], Content-Length=[1882], content-type=[text/xml; charset=UTF-8], host=[rice.stg.kfs.kuali.org], pragma=[no-cache], SOAPAction=[""], user-agent=[Apache CXF 2.3.8], x-kuali-app-ver=[branches/release-5-0 (rev: 38560) 2012-06-04_11-52-39], x-kuali-env=[stg], x-kuali-rice-ver=[2.0.2-SNAPSHOT]} Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soap:mustUnderstand="1"><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="Signature-2639"> <ds:SignedInfo> <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/> <ds:Reference URI="#id-2640"> <ds:Transforms> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> </ds:Transforms> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <ds:DigestValue>NLVZm/AgnKcNC2/M4BYXH8RzdYA=</ds:DigestValue> </ds:Reference> </ds:SignedInfo> <ds:SignatureValue> tk2rnliVm6UcVOsSgCzjLIrIGSogUmKDH+x3/EPLf7hx7Jo8Je3T4msd6TU+os/VNsxcq2C8VU5S vLeBhN6tqDxZPfZimTxLCX6prXs4VomIlnFWAYbM+phRWfF6Q33QFCKOT3tM2fgOva6Nl7FM3pEl QsDTfdR987munGHKldg= </ds:SignatureValue> <ds:KeyInfo Id="KeyId-DF281A43FEB0EF8FE213388308116993959"> <wsse:SecurityTokenReference xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="STRId-DF281A43FEB0EF8FE213388308116993960"><ds:X509Data> <ds:X509IssuerSerial> <ds:X509IssuerName>CN=rice</ds:X509IssuerName> <ds:X509SerialNumber>1192039189</ds:X509SerialNumber> </ds:X509IssuerSerial> </ds:X509Data></wsse:SecurityTokenReference> </ds:KeyInfo> </ds:Signature></wsse:Security></soap:Header><soap:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="id-2640"><getPreferences xmlns="http://rice.kuali.org/kew/v2_0" xmlns:ns2="http://rice.kuali.org/core/v2_0"><principalId>4318506633</principalId></getPreferences></soap:Body></soap:Envelope> -------------------------------------- 2012-06-04 13:26:51,737 [http-8080-3] u:/d: WARN org.apache.cxf.phase.PhaseInterceptorChain :: Interceptor for {http://rice.kuali.org/kew/v2_0}preferencesService#{http://rice.kuali.org/kew/v2_0}getPreferences has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: Marshalling Error: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:257) at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:169) at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:119) at org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:77) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:113) at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:102) at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:464) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:188) at org.kuali.rice.ksb.messaging.servlet.CXFServletControllerAdapter.handleRequest(CXFServletControllerAdapter.java:47) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at org.kuali.rice.ksb.messaging.servlet.KSBDispatcherServlet.service(KSBDispatcherServlet.java:138) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.kuali.rice.krad.web.filter.HideWebInfFilter.doFilter(HideWebInfFilter.java:69) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:679) Caused by: javax.xml.bind.MarshalException - with linked exception: [com.sun.istack.SAXException2: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection com.sun.xml.bind.api.AccessorException: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection] at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:318) at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:172) at org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder.java:548) at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:232) ... 34 more Caused by: com.sun.istack.SAXException2: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection com.sun.xml.bind.api.AccessorException: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:246) at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:261) at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:343) at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:696) at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.serializeBody(SingleElementNodeProperty.java:152) at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:340) at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:696) at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:152) at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:189) at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(ElementBeanInfoImpl.java:316) at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:323) at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:72) at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:494) at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:315) ... 37 more Caused by: com.sun.xml.bind.api.AccessorException: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection at com.sun.xml.bind.v2.runtime.reflect.AdaptedAccessor.get(AdaptedAccessor.java:74) at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.serializeBody(SingleElementNodeProperty.java:127) at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:340) ... 48 more Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection at org.kuali.rice.core.api.util.jaxb.MultiValuedStringMapAdapter$MultiValuedStringMapEntry.<init>(MultiValuedStringMapAdapter.java:118) at org.kuali.rice.core.api.util.jaxb.MultiValuedStringMapAdapter.marshal(MultiValuedStringMapAdapter.java:64) at org.kuali.rice.core.api.util.jaxb.MultiValuedStringMapAdapter.marshal(MultiValuedStringMapAdapter.java:55) at com.sun.xml.bind.v2.runtime.reflect.AdaptedAccessor.get(AdaptedAccessor.java:72) ... 50 more {noformat}

    Kuali JIRA | 5 years ago | Jonathan Keller
    com.sun.xml.bind.api.AccessorException: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection
  2. 0

    It looks like some of the attributes in the KEW user preferences table are being used to hold JSON objects. However, if the JSON does not un-marshal properly, you get a class cast exception like the below. This resulted in a problem in KFS where routing to one of the main testing users failed (silently) until the user options table was purged. The code which performs this type of conversion should be guarded against format errors so that the property is simply ignored (and deleted?) if parsing fails. {noformat} 2012-06-04 13:26:47,659 [http-8080-26] u:/d: INFO org.apache.cxf.interceptor.LoggingOutInterceptor :: Outbound Message --------------------------- ID: 15705 Response-Code: 500 Encoding: UTF-8 Content-Type: text/xml Headers: {} Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soap:mustUnderstand="1"><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="Signature-31409"> <ds:SignedInfo> <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/> <ds:Reference URI="#id-31410"> <ds:Transforms> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> </ds:Transforms> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <ds:DigestValue>yiHj7C0HzgoLawH9202859xae8s=</ds:DigestValue> </ds:Reference> </ds:SignedInfo> <ds:SignatureValue> enBPUer+spVlHAEUg+YdcQmN25bW+oU8/YtqAQRpQWuR+OToR8M0UpKDGpDGpphHBxHFyqwpt3Yi i8udHxLIN3vuxIsPpU6MSnrGLWP4WSe+OlELbf26mSPH/qSkSR7YrGC4rFIax3aVpem+UWqtCCIU rr6HwOLWyr7TYkttYT0= </ds:SignatureValue> <ds:KeyInfo Id="KeyId-ADE1032ECE8A0D0C27133883080764947114"> <wsse:SecurityTokenReference xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="STRId-ADE1032ECE8A0D0C27133883080764947115"><ds:X509Data> <ds:X509IssuerSerial> <ds:X509IssuerName>CN=rice</ds:X509IssuerName> <ds:X509SerialNumber>1192039189</ds:X509SerialNumber> </ds:X509IssuerSerial> </ds:X509Data></wsse:SecurityTokenReference> </ds:KeyInfo> </ds:Signature></wsse:Security></soap:Header><soap:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="id-31410"><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Marshalling Error: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection</faultstring></soap:Fault></soap:Body></soap:Envelope> -------------------------------------- 2012-06-04 13:26:51,707 [http-8080-3] u:/d: INFO org.apache.cxf.interceptor.LoggingInInterceptor :: Inbound Message ---------------------------- ID: 15706 Address: http://rice.stg.kfs.kuali.org/kr-stg/remoting/soap/kew/v2_0/preferencesService Encoding: UTF-8 Http-Method: POST Content-Type: text/xml; charset=UTF-8 Headers: {Accept=[*/*], cache-control=[no-cache], connection=[keep-alive], Content-Length=[1882], content-type=[text/xml; charset=UTF-8], host=[rice.stg.kfs.kuali.org], pragma=[no-cache], SOAPAction=[""], user-agent=[Apache CXF 2.3.8], x-kuali-app-ver=[branches/release-5-0 (rev: 38560) 2012-06-04_11-52-39], x-kuali-env=[stg], x-kuali-rice-ver=[2.0.2-SNAPSHOT]} Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soap:mustUnderstand="1"><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="Signature-2639"> <ds:SignedInfo> <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/> <ds:Reference URI="#id-2640"> <ds:Transforms> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> </ds:Transforms> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <ds:DigestValue>NLVZm/AgnKcNC2/M4BYXH8RzdYA=</ds:DigestValue> </ds:Reference> </ds:SignedInfo> <ds:SignatureValue> tk2rnliVm6UcVOsSgCzjLIrIGSogUmKDH+x3/EPLf7hx7Jo8Je3T4msd6TU+os/VNsxcq2C8VU5S vLeBhN6tqDxZPfZimTxLCX6prXs4VomIlnFWAYbM+phRWfF6Q33QFCKOT3tM2fgOva6Nl7FM3pEl QsDTfdR987munGHKldg= </ds:SignatureValue> <ds:KeyInfo Id="KeyId-DF281A43FEB0EF8FE213388308116993959"> <wsse:SecurityTokenReference xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="STRId-DF281A43FEB0EF8FE213388308116993960"><ds:X509Data> <ds:X509IssuerSerial> <ds:X509IssuerName>CN=rice</ds:X509IssuerName> <ds:X509SerialNumber>1192039189</ds:X509SerialNumber> </ds:X509IssuerSerial> </ds:X509Data></wsse:SecurityTokenReference> </ds:KeyInfo> </ds:Signature></wsse:Security></soap:Header><soap:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="id-2640"><getPreferences xmlns="http://rice.kuali.org/kew/v2_0" xmlns:ns2="http://rice.kuali.org/core/v2_0"><principalId>4318506633</principalId></getPreferences></soap:Body></soap:Envelope> -------------------------------------- 2012-06-04 13:26:51,737 [http-8080-3] u:/d: WARN org.apache.cxf.phase.PhaseInterceptorChain :: Interceptor for {http://rice.kuali.org/kew/v2_0}preferencesService#{http://rice.kuali.org/kew/v2_0}getPreferences has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: Marshalling Error: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:257) at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:169) at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:119) at org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:77) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:113) at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:102) at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:464) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:188) at org.kuali.rice.ksb.messaging.servlet.CXFServletControllerAdapter.handleRequest(CXFServletControllerAdapter.java:47) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at org.kuali.rice.ksb.messaging.servlet.KSBDispatcherServlet.service(KSBDispatcherServlet.java:138) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.kuali.rice.krad.web.filter.HideWebInfFilter.doFilter(HideWebInfFilter.java:69) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:679) Caused by: javax.xml.bind.MarshalException - with linked exception: [com.sun.istack.SAXException2: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection com.sun.xml.bind.api.AccessorException: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection] at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:318) at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:172) at org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder.java:548) at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:232) ... 34 more Caused by: com.sun.istack.SAXException2: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection com.sun.xml.bind.api.AccessorException: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:246) at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:261) at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:343) at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:696) at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.serializeBody(SingleElementNodeProperty.java:152) at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:340) at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:696) at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:152) at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:189) at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(ElementBeanInfoImpl.java:316) at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:323) at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:72) at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:494) at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:315) ... 37 more Caused by: com.sun.xml.bind.api.AccessorException: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection at com.sun.xml.bind.v2.runtime.reflect.AdaptedAccessor.get(AdaptedAccessor.java:74) at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.serializeBody(SingleElementNodeProperty.java:127) at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:340) ... 48 more Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection at org.kuali.rice.core.api.util.jaxb.MultiValuedStringMapAdapter$MultiValuedStringMapEntry.<init>(MultiValuedStringMapAdapter.java:118) at org.kuali.rice.core.api.util.jaxb.MultiValuedStringMapAdapter.marshal(MultiValuedStringMapAdapter.java:64) at org.kuali.rice.core.api.util.jaxb.MultiValuedStringMapAdapter.marshal(MultiValuedStringMapAdapter.java:55) at com.sun.xml.bind.v2.runtime.reflect.AdaptedAccessor.get(AdaptedAccessor.java:72) ... 50 more {noformat}

    Kuali JIRA | 5 years ago | Jonathan Keller
    com.sun.xml.bind.api.AccessorException: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection
  3. 0

    Serialization issu

    GitHub | 3 years ago | ydeshayes
    play.api.Application$$anon$1: Execution exception[[ClassCastException: java.lang.String cannot be cast to java.util.Collection]]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    find with DBQuery.is() fails for collection fields with ClassCastException

    GitHub | 2 months ago | ractive
    java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection
  6. 0

    Allow single "aud" in JWT without need for JSON array format?

    GitHub | 1 year ago | sdoxsee
    java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassCastException

      java.lang.String cannot be cast to java.util.Collection

      at org.kuali.rice.core.api.util.jaxb.MultiValuedStringMapAdapter$MultiValuedStringMapEntry.<init>()
    2. org.kuali.rice
      MultiValuedStringMapAdapter.marshal
      1. org.kuali.rice.core.api.util.jaxb.MultiValuedStringMapAdapter$MultiValuedStringMapEntry.<init>(MultiValuedStringMapAdapter.java:118)
      2. org.kuali.rice.core.api.util.jaxb.MultiValuedStringMapAdapter.marshal(MultiValuedStringMapAdapter.java:64)
      3. org.kuali.rice.core.api.util.jaxb.MultiValuedStringMapAdapter.marshal(MultiValuedStringMapAdapter.java:55)
      3 frames
    3. Old JAXB Runtime
      MarshallerImpl.write
      1. com.sun.xml.bind.v2.runtime.reflect.AdaptedAccessor.get(AdaptedAccessor.java:72)
      2. com.sun.xml.bind.v2.runtime.reflect.AdaptedAccessor.get(AdaptedAccessor.java:74)
      3. com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.serializeBody(SingleElementNodeProperty.java:127)
      4. com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:340)
      5. com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:246)
      6. com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:261)
      7. com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:343)
      8. com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:696)
      9. com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.serializeBody(SingleElementNodeProperty.java:152)
      10. com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:340)
      11. com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:696)
      12. com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:152)
      13. com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:189)
      14. com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(ElementBeanInfoImpl.java:316)
      15. com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:323)
      16. com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:72)
      17. com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:494)
      18. com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:315)
      18 frames