java.lang.IllegalStateException: No ObjectCodec defined for the generator, can only serialize simple wrapper types (type passed java.util.Collec ns$UnmodifiableRandomAccessList)

Apereo Issues | Misagh Moayyed | 3 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    The OAuth20ProfileController in CAS-OAuth attempts to want to serialize and marshal all principal attributes. The JSONFactory parser seems to have a problem with multi-valued attributes, which, in my exact case was "objectclass". {code} objectclass=[top, person, organizationalPerson] {code} Exception trace: {code} FBJqRDG7Zl46MUa-https://mmoayyed.test.org> 2014-06-18 10:45:26,427 DEBUG [org.jasig.cas.web.FlowExecutionExceptionResolver] - <Ignoring the received exception due to a type mismatch> java.lang.IllegalStateException: No ObjectCodec defined for the generator, can only serialize simple wrapper types (type passed java.util.Collec ns$UnmodifiableRandomAccessList) at com.fasterxml.jackson.core.base.GeneratorBase._writeSimpleObject(GeneratorBase.java:515) at com.fasterxml.jackson.core.base.GeneratorBase.writeObject(GeneratorBase.java:262) at com.fasterxml.jackson.core.JsonGenerator.writeObjectField(JsonGenerator.java:1114) at org.jasig.cas.support.oauth.web.OAuth20ProfileController.handleRequestInternal(OAuth20ProfileController.java:100) at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) at org.jasig.cas.support.oauth.web.OAuth20WrapperController.internalHandleRequest(OAuth20WrapperController.java:79) at org.jasig.cas.support.oauth.web.BaseOAuthWrapperController.handleRequestInternal(BaseOAuthWrapperController.java:62) at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778) at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.jasig.cas.web.init.SafeDispatcherServlet.service_aroundBody2(SafeDispatcherServlet.java:128) at org.jasig.cas.web.init.SafeDispatcherServlet.service_aroundBody3$advice(SafeDispatcherServlet.java:57) at org.jasig.cas.web.init.SafeDispatcherServlet.service(SafeDispatcherServlet.java:1) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) {code} Also noticed that the code attempts to want to marshal ALL principal attributes into JSON, rather than just what attributes may be allowed for the oauth client service.

    Apereo Issues | 3 years ago | Misagh Moayyed
    java.lang.IllegalStateException: No ObjectCodec defined for the generator, can only serialize simple wrapper types (type passed java.util.Collec ns$UnmodifiableRandomAccessList)
  2. 0

    The OAuth20ProfileController in CAS-OAuth attempts to want to serialize and marshal all principal attributes. The JSONFactory parser seems to have a problem with multi-valued attributes, which, in my exact case was "objectclass". {code} objectclass=[top, person, organizationalPerson] {code} Exception trace: {code} FBJqRDG7Zl46MUa-https://mmoayyed.test.org> 2014-06-18 10:45:26,427 DEBUG [org.jasig.cas.web.FlowExecutionExceptionResolver] - <Ignoring the received exception due to a type mismatch> java.lang.IllegalStateException: No ObjectCodec defined for the generator, can only serialize simple wrapper types (type passed java.util.Collec ns$UnmodifiableRandomAccessList) at com.fasterxml.jackson.core.base.GeneratorBase._writeSimpleObject(GeneratorBase.java:515) at com.fasterxml.jackson.core.base.GeneratorBase.writeObject(GeneratorBase.java:262) at com.fasterxml.jackson.core.JsonGenerator.writeObjectField(JsonGenerator.java:1114) at org.jasig.cas.support.oauth.web.OAuth20ProfileController.handleRequestInternal(OAuth20ProfileController.java:100) at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) at org.jasig.cas.support.oauth.web.OAuth20WrapperController.internalHandleRequest(OAuth20WrapperController.java:79) at org.jasig.cas.support.oauth.web.BaseOAuthWrapperController.handleRequestInternal(BaseOAuthWrapperController.java:62) at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778) at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.jasig.cas.web.init.SafeDispatcherServlet.service_aroundBody2(SafeDispatcherServlet.java:128) at org.jasig.cas.web.init.SafeDispatcherServlet.service_aroundBody3$advice(SafeDispatcherServlet.java:57) at org.jasig.cas.web.init.SafeDispatcherServlet.service(SafeDispatcherServlet.java:1) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) {code} Also noticed that the code attempts to want to marshal ALL principal attributes into JSON, rather than just what attributes may be allowed for the oauth client service.

    Apereo Issues | 3 years ago | Misagh Moayyed
    java.lang.IllegalStateException: No ObjectCodec defined for the generator, can only serialize simple wrapper types (type passed java.util.Collec ns$UnmodifiableRandomAccessList)
  3. 0

    JsonMarshaller.writeExtras does not account for data that cannot be encoded.

    GitHub | 3 years ago | empiricalthought
    java.lang.IllegalStateException: No ObjectCodec defined for the generator, can only serialize simple wrapper types (type passed org.nuxeo.ecm.platform.usermanager.NuxeoPrincipalImpl)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    No ObjectCodec defined for the generator, ... (type passed java.sql.Time)

    GitHub | 1 year ago | io41
    java.lang.IllegalStateException: No ObjectCodec defined for the generator, can only serialize simple wrapper types (type passed java.sql.Time)

    Root Cause Analysis

    1. java.lang.IllegalStateException

      No ObjectCodec defined for the generator, can only serialize simple wrapper types (type passed java.util.Collec ns$UnmodifiableRandomAccessList)

      at com.fasterxml.jackson.core.base.GeneratorBase._writeSimpleObject()
    2. Jackson-core
      JsonGenerator.writeObjectField
      1. com.fasterxml.jackson.core.base.GeneratorBase._writeSimpleObject(GeneratorBase.java:515)
      2. com.fasterxml.jackson.core.base.GeneratorBase.writeObject(GeneratorBase.java:262)
      3. com.fasterxml.jackson.core.JsonGenerator.writeObjectField(JsonGenerator.java:1114)
      3 frames
    3. org.jasig.cas
      OAuth20ProfileController.handleRequestInternal
      1. org.jasig.cas.support.oauth.web.OAuth20ProfileController.handleRequestInternal(OAuth20ProfileController.java:100)
      1 frame
    4. Spring MVC
      AbstractController.handleRequest
      1. org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
      1 frame
    5. org.jasig.cas
      BaseOAuthWrapperController.handleRequestInternal
      1. org.jasig.cas.support.oauth.web.OAuth20WrapperController.internalHandleRequest(OAuth20WrapperController.java:79)
      2. org.jasig.cas.support.oauth.web.BaseOAuthWrapperController.handleRequestInternal(BaseOAuthWrapperController.java:62)
      2 frames
    6. Spring MVC
      FrameworkServlet.doGet
      1. org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
      2. org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
      3. org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
      4. org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
      5. org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
      6. org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
      6 frames
    7. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
      2. javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
      2 frames
    8. Jasig CAS Core
      SafeDispatcherServlet.service
      1. org.jasig.cas.web.init.SafeDispatcherServlet.service_aroundBody2(SafeDispatcherServlet.java:128)
      2. org.jasig.cas.web.init.SafeDispatcherServlet.service_aroundBody3$advice(SafeDispatcherServlet.java:57)
      3. org.jasig.cas.web.init.SafeDispatcherServlet.service(SafeDispatcherServlet.java:1)
      3 frames
    9. Glassfish Core
      ApplicationFilterChain.internalDoFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
      1 frame