Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-30566

(8.0.z) UnsupportedTemporalTypeException when serializing java.sql.Date with formatter containing time component fields

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • None
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • Workaround Exists
    • Hide

      Don't use time component in the formatter

      or

      Use java.sql.Timestamp instead of java.sql.Date

      Show
      Don't use time component in the formatter or Use java.sql.Timestamp instead of java.sql.Date
    • Hide

      The steps to reproduce the issue:

      1. unzip the attached zip files.
      2. go to root of the kichensink project and run the command: mvn clean package
      3. deploy generated war: mvn wildfly: deploy
      4. open the page: http://localhost:8080/kitchensink/index.jsf
      5. You can see the page fails with error "java.time.temporal.UnsupportedTemporalTypeException: Unsupported field: HourOfDay"

      The invocation of json processing is in the SesnEJB class's method generateIngotNoRelationshipJson(String numberSerial) which is called in MemberListProducer.retrieveAllMembersOrderedByName()

      Show
      The steps to reproduce the issue: unzip the attached zip files. go to root of the kichensink project and run the command: mvn clean package deploy generated war: mvn wildfly: deploy open the page: http://localhost:8080/kitchensink/index.jsf You can see the page fails with error "java.time.temporal.UnsupportedTemporalTypeException: Unsupported field: HourOfDay" The invocation of json processing is in the SesnEJB class's method generateIngotNoRelationshipJson(String numberSerial) which is called in MemberListProducer.retrieveAllMembersOrderedByName()

      SqlDateSerializer throws

      java.time.temporal.UnsupportedTemporalTypeException: Unsupported field: HourOfDay
      

      when serializing java.sql.Date with formatter containing time component fields.
      This is the expected result. However, in Yasson 1.0.5 (JBEAP 7.4), serialization is successfully done as the java.sql.Date with formatter is processed by: [1]

      AbstractDateTypeSerializer.formatWithFormatter()
      

      [1] https://github.com/eclipse-ee4j/yasson/blob/77f6c1f62582b47987549eadb4c64506dd4058c8/src/main/java/org/eclipse/yasson/internal/serializer/AbstractDateTypeSerializer.java#L55

              lvydra Lukas Vydra
              lvydra Lukas Vydra
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: