5 Replies Latest reply on May 20, 2008 7:57 PM by Newsgroup_User

    Coldfusion to Java date issue

    akhurana
      I am sending a date to a customers weblogic code which is throwing this error. I need help converting a date entered on a form to the java date format.

      weblogic.jms.common.JMSException: Error deserializing object
      at weblogic.jms.common.ObjectMessageImpl.getObject(ObjectMessageImpl.java:144)
      at com.xxx.iag.billing.framework.server.ServerMessageHandler.onMessage(ServerMessageHandler. java:349)
      at com.xxx.iag.billing.framework.server.ServerMessageHandler.run(ServerMessageHandler.java:4 05)
      at java.lang.Thread.run(Thread.java:534)
      Caused by: java.lang.ClassNotFoundException: coldfusion.runtime.OleDateTime
        • 1. Re: Coldfusion to Java date issue
          Level 7
          akhurana wrote:
          > I am sending a date to a customers weblogic code which is throwing this error.
          > I need help converting a date entered on a form to the java date format.
          >
          > weblogic.jms.common.JMSException: Error deserializing object
          > at
          > weblogic.jms.common.ObjectMessageImpl.getObject(ObjectMessageImpl.java:144)
          > at
          > com.xxx.iag.billing.framework.server.ServerMessageHandler.onMessage(ServerMessag
          > eHandler.java:349)
          > at
          > com.xxx.iag.billing.framework.server.ServerMessageHandler.run(ServerMessageHandl
          > er.java:405)
          > at java.lang.Thread.run(Thread.java:534)
          > Caused by: java.lang.ClassNotFoundException: coldfusion.runtime.OleDateTime


          if it can handle java epoch offset, you can try getTime()

          yourDateVar.getTime()

          it's not documented btw.
          • 2. Re: Coldfusion to Java date issue
            akhurana Level 1
            Paul,
            I need to send in fixed dates (start and end), so epoch is not really an option and the formats need to be "mm/dd/yyyy". Any help at this point will be really helpful.

            Ankush
            • 3. Re: Coldfusion to Java date issue
              Level 7
              akhurana wrote:
              > Paul, I need to send in fixed dates (start and end), so epoch is not really
              > an option and the formats need to be "mm/dd/yyyy". Any help at this point
              > will be really helpful.

              not sure i'm following, java epoch offsets *are* dates (to java). in any case if
              that app is looking for date strings, just use dateFormat() on it.
              • 4. Re: Coldfusion to Java date issue
                akhurana Level 1
                Paul,
                Their sample code does this:

                hnmReq.setDate("DateFrom", new Date(fromDate));
                where the fromDate variable is set to just a date in this format: mm/dd/yy:

                Their dump shows the value set to this format: [ Tue May 20 00:00:00 EDT 2008 ] for 05/20/2008

                I need to get this done in coldfusion. The "LONG" format does not give the date/time in the format above and they see the java.lang.ClassNotFoundException: coldfusion.runtime.OleDateTime

                error on their end.

                Ankush

                • 5. Re: Coldfusion to Java date issue
                  Level 7
                  akhurana wrote:
                  > hnmReq.setDate("DateFrom", new Date(fromDate));
                  > where the fromDate variable is set to just a date in this format: mm/dd/yy:

                  where fromDate is a string? if so that's old java Date(). did you try the java
                  epoch offsets?

                  > Their dump shows the value set to this format: [ Tue May 20 00:00:00 EDT 2008
                  > ] for 05/20/2008

                  while i think the java epoch should work, you can create a dateFormat mask to
                  replicate that:

                  "ddd mmm dd 00:00:00 EDT yyyy"

                  i guess you might also try creating a java Date() & passing that to it:

                  <cfscript>
                  now=now().getTime();
                  aDate=createObject("java","java.util.Date").init(now);
                  </cfscript>