l Lenny
on

 

Hi,

 

When I tried to perform SDTM validation for MH domain (medical history), below information popped out:

 

--------- System Information ---------

 Version: 1.5

     JRE: 1.8.0_25

      OS: Windows Server 2008 R2 6.1 amd64

--------------------------------------

 

java.lang.RuntimeException: org.joda.time.IllegalInstantException: Cannot parse "1987-04-12": Illegal instant due to time zone offset transition (Asia/Shanghai)

at org.opencdisc.validator.engine.BlockValidator$BlockTask.call(BlockValidator.java:477)

at org.opencdisc.validator.engine.BlockValidator$BlockTask.call(BlockValidator.java:232)

at org.opencdisc.validator.engine.BlockValidator.validate(BlockValidator.java:214)

at org.opencdisc.validator.DefaultValidator.validate(DefaultValidator.java:440)

at org.opencdisc.validator.gui.ValidatorClient$ProcessMonitor.run(ValidatorClient.java:1418)

Caused by: org.joda.time.IllegalInstantException: Cannot parse "1987-04-12": Illegal instant due to time zone offset transition (Asia/Shanghai)

at org.joda.time.format.DateTimeParserBucket.computeMillis(DateTimeParserBucket.java:390)

at org.joda.time.format.DateTimeFormatter.parseDateTime(DateTimeFormatter.java:856)

at org.joda.time.DateTime.parse(DateTime.java:144)

at org.joda.time.DateTime.parse(DateTime.java:133)

at org.opencdisc.validator.rules.expressions.functions.DyCount.compute(DyCount.java:66)

at org.opencdisc.validator.rules.expressions.Comparison.evaluate(Comparison.java:178)

at org.opencdisc.validator.rules.expressions.Expression.evaluate(Expression.java:256)

at org.opencdisc.validator.rules.AbstractScriptableValidationRule.checkExpression(AbstractScriptableValidationRule.java:107)

at org.opencdisc.validator.rules.ConditionalValidationRule.performValidation(ConditionalValidationRule.java:58)

at org.opencdisc.validator.rules.AbstractValidationRule.validate(AbstractValidationRule.java:222)

at org.opencdisc.validator.engine.BlockValidator$BlockTask.call(BlockValidator.java:359)

... 4 more

We noticed that 1987-04-12 was the date when daylight saving time began.
May I ask how could I fix this problem without changing any data value?
Thanks in advance,
Lenny

Forums: Troubleshooting and Problems

j Jozef
on September 23, 2015

Writing (and testing) software that also works correct in other countries and timezones is often a challenge.
Here is an article explaining this error and how it can be corrected in the source code:
http://stackoverflow.com/questions/5451152/how-to-handle-jodatime-illegal-instant-due-to-time-zone-offset-transition

For the software developers: any action "format" or "parse" shouls always be in a try-catch construct, like in:

try {
... formatter.parseDataTime(...)
} catch (Exception e) {
  // put some code here that e.g. writes a warning to a log file
  // the "catch" prevenst the program from breaking down...
}

Want a demo?

Let’s Talk.

We're eager to share and ready to listen.

Cookie Policy

Pinnacle 21 uses cookies to make our site easier for you to use. By continuing to use this website, you agree to our use of cookies. For more info visit our Privacy Policy.