Menu

Examples do not work in EST time zone

stevech10
2007-10-24
2013-06-05
  • stevech10

    stevech10 - 2007-10-24

    When running the examples, I get the following error:

    Exception in thread "main" java.lang.RuntimeException: setCurrentTime():Time zone could not be inicialized
            at ch.ethz.mxquery.query.Context.setCurrentTime(Context.java:909)
            at ch.ethz.mxquery.query.impl.PreparedStatementImpl.evaluate(PreparedStatementImpl.java:37)
            at ch.ethz.mxquery.example.MXQuery.doQuery2(MXQuery.java:253)
            at ch.ethz.mxquery.example.MXQuery.executeQuery(MXQuery.java:225)
            at ch.ethz.mxquery.example.MXQuery.main(MXQuery.java:114)

    I added additional debug to print the actual error message caught in Context.java, and the format of the timezoneOffset is: PT-300M

    I am in the USA on EST

    Looking at MXQueryDayTimeDuration.java, the first check in the parse method has the following check:

    if(input.indexOf("+") >= 0 || input.indexOf("-") > 0 )
                throw new StaticException(ErrorCodes.F0023_INVALID_VALUE_FOR_CAST_CONSTRUCTOR, "Incorrect format of the Duration value");

    Obviously, this fails because the "-" has an index of 2.

    It works OK if the time zone is GMT or any positive offset from that.

    Steve

     
    • Peter M. Fischer

      Hi Steve,

      thanks for the bug report.

      We were able to reproduce the bug, and it is now fixed in our internal builds. We will release a new version (including this and other bug fixes) to coming week or the other week. If you want to have a snapshot release in the meantime, please let me me know.

      Regards,
      Peter

       
    • Peter M. Fischer

      Now fixed in version 0.4.1

       

Log in to post a comment.

Auth0 Logo