Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

138
Visualizações
Spring Jaxb2Marshaller - Date issue

I am seeing a curious thing happening when deserializing an XML response into a POJO object, specifically a date field. Here are the details:

  • The date field is represented as a long value when serializing/deserializing. The long value is supposed to be the time in millis since epoch (1970).
  • It is happening only for old dates (before 1970) where the long value is actually negative
  • The issue is that during deserialization, the negative long value is parsed into a date object with an additional offset
  • For example, if the actual value is:
    • -1570341200000
    • which is, 29/03/1920, 00:00:00 GMT+5:30
  • The date object that is deseralized gets mapped to:
    • -1570339800000
    • which is, 29/03/1920, 00:23:20 GMT+5:30
  • As you can see, the deserialized date is off by +1400 seconds.
  • The marshaller that is being used is:
    • org.springframework.oxm.jaxb.Jaxb2Marshaller

Is there some default configuration at the client side which is making the deserialization off?

I am not familiar with JAXB, so please feel free and let me know if you need any additional information.

Thanks,

about 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda