Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

139
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!