1 Reply Latest reply: Aug 17, 2014 12:46 AM by 1128724 RSS

    InstanceMessageUtil date format


      Dear B2B experts,


      I am using Fusion Middleware


      I am trying to use InstanceMessageUtil to retrieve instance messages from B2B instance message store. I followed the documentation to invoke this method as follows:


      InstanceMessageUtil util = new InstanceMessageUtil();

        InstanceMessage[] messages = util.getInstanceMessages("10/10/2013", "10/28/2014", "MyPartner");


      However, I received the following error:


      java.lang.StringIndexOutOfBoundsException: String index out of range: -1

              at java.lang.String.substring(String.java:1937)

              at java.lang.String.substring(String.java:1904)

              at oracle.tip.b2b.utility.InstanceMessageUtil.formatDate(InstanceMessageUtil.java:398)

              at oracle.tip.b2b.utility.InstanceMessageUtil.getInstanceMessagesForDateRange(InstanceMessageUtil.java:135)

              ... ...

      Is the exception caused by the date format?


      The documentation does not say the correct date format the method is expecting. The sample provided in JavaDoc is not clearly either (I can figure out it uses the MM/DD/YYYY format. In fact, if I want to specify a date time, will the API work?


      Your help is much appreciated.



        • 1. Re: InstanceMessageUtil date format

          After some research in command line tools, it was figured out that for, the date string should use the pattern "dd/MM/yyyy hh:mm a", where a stands for AM or PM.


          The Javadoc for the InstanceMessageUtil should be updated to reflect the change.