Menu

Time conversion problem

Peter Wang
2008-11-21
2013-06-03
  • Peter Wang

    Peter Wang - 2008-11-21

    Hello,

    I've just started using Domingo to interface with Lotus Notes calendars.
    I'm having a problem with time items.  When getting them with
    DDocument.getItemValueDate(), they come out one hour later than what they
    should be.  When setting them with setItemValueDate(), they end up being one
    hour early.

    The times I'm working with are all in CET (GMT+1).  I think there are double
    additions going on.  If I comment out the following lines I get the times I
    expect (of course, it's just a hack, not meant as a fix).

    Any ideas?

    Peter

        protected DateTime createDateTime(final Calendar calendar) {
            final Calendar correct = (Calendar) calendar.clone();
            try {
                TimeZone gmtZone = TimeZone.getTimeZone("GMT");
                correct.setTimeZone(gmtZone);
                TimeZone timeZone = calendar.getTimeZone();
                // correct.add(Calendar.SECOND, -timeZone.getOffset(correct.getTimeInMillis()) / MILLIS_PER_SECOND);
                final DateTime dateTime = session.createDateTime(correct);
                int zoneValue = getNotesTimeZoneValue(timeZone, calendar.getTimeInMillis());
                dateTime.convertToZone(zoneValue, timeZone.inDaylightTime(calendar.getTime()));
                if (!isDateSet(correct)) {
                    dateTime.setAnyDate();
                } else if (!isTimeSet(correct)) {
                    dateTime.setAnyTime();
                }
                return dateTime;
            } catch (NotesException e) {
                error("Cannot convert calendar to DateTime", e);
            }
            return null;
        }

        protected Calendar createCalendar(final DateTime dateTime) {
            final Date date = createDate(dateTime);
            if (date == null) {
                return null;
            }
            TimeZone zone = getTimeZone(dateTime);
            Calendar calendar = Calendar.getInstance(zone);
            calendar.setTime(date);
            if (!isTimeSet(dateTime)) {
                calendar.add(Calendar.MILLISECOND, zone.getOffset(calendar.getTimeInMillis()));
                return new GregorianDate(calendar.getTime());
            } else if (!isDateSet(dateTime)) {
                calendar.add(Calendar.MILLISECOND, zone.getOffset(calendar.getTimeInMillis()));
                return new GregorianTime(calendar);
            } else {
                // calendar.add(Calendar.MILLISECOND, -getOffset(dateTime));
                calendar.add(Calendar.MILLISECOND, -zone.getOffset(calendar.getTimeInMillis()));
                return new GregorianDateTime(calendar);
            }
        }

     
    • Nobody/Anonymous

      Hello Peter,

      thank you for your problem report. We have spent many days especially for the date/time handling in domingo do have a correkt conversion of time values between Java and Lotus Notes. We also have a comprehensive test-suite for such issues to check the behaviour against different versions of Lotus Notes, but ther might still be a problem.
      To fully understand your problem, please try to answer the following questions (all of them might influence the time handling):

      1. Are you connecting via local-call or remote (DIIOP)?
      2. Which exact version of Lotus Notes or Domino are you using?
      3. Which exact version of Java are you using?
      4. Are you connecting to a Lotus Notes Client or to a Lotus Domino server?
      5. What are the time-zone settings of your operation system?
      6. What are the time-zone settings of your Lotus Notes client or Lotus Domino server?
      7. Please run the Testsuite [1] and send us information about all errors if any occurs
      8. Especially check the DateTimeTest [2] which performs many different time conversions e.g. between different time zones
      9. If the DateTimeTest [2] doesn't report any error, please extend the test to reproduce your problem.

      If you complete all questions, you have a good chance for a fast solution.

      Best regards,
      Kurt

      [1] http://domingo.cvs.sourceforge.net/viewvc/domingo/domingo/src/test/de/bea/domingo/AllStandardTests.java
      [2] http://domingo.cvs.sourceforge.net/viewvc/domingo/domingo/src/test/de/bea/domingo/DateTimeTest.java

       
      • Peter Wang

        Peter Wang - 2008-11-24

        Hi,

        I think I have maven set up correctly, but I've never used it before.
        `make dist' fails quite late with this error:

            >> Unable to obtain goal [dist:prepare-bin-filesystem]
            >> /home/pwa/.maven/cache/maven-xdoc-plugin-1.10.1/src/maven/site.jsl (No such file or directory)

        I can see many .jars and .classes in the target directory so I think the
        process went mostly okay.

        Is there some documentation describing how to run the test suite or a single
        test?  I guessed `maven -Dtestcase=DateTimeTest test:single` but got the
        message:

            >> Unable to obtain goal [test:single]
            >> Test DateTimeTest failed

        Similarly for `maven -Dtestcase=de.bea.domingo.DateTimeTest test:single`.

        Thanks.
        Peter

         
        • Nobody/Anonymous

          The test-suite needs a domino server to run properly and is not used by maven.
          The suite is implemented as a JUnit test, but actually it is an integration test, but it makes sence to use the features of JUnit too.

          Please start the test-suite in your IDE manually by running the class src/test/de.bea.domingo.AllStandardTests or one of the concrete test classes as a JUnit-Test. You can configure the tests in the file test.properties in the folder/package.

          Hope this helps.
          - Kurt

           
          • Peter Wang

            Peter Wang - 2008-11-26

            Thank you, that helps.  I ran DateTimeTest and TimeZoneTest.  The
            backtraces of failing tests are below.  The console output for the
            first failed case is as follows:

            [2008.11.26 11:26:35] Domingo Thread 0: INFO:  Thread started
            [2008.11.26 11:26:35] Domingo Thread 0: DEBUG: initialize Thread
            [2008.11.26 11:26:35] Domingo Thread 0: DEBUG: Local Notes Client not accessable; only remote connections possible
            -> testReplaceItemValueDateGregorianDateTime: Month: 0, Zone: Australia/Melbourne
            Sat Jan 17 15:59:58 EST 2004 zone: Australia/Melbourne
            Sat Jan 17 14:59:58 EST 2004 zone: Australia/Melbourne

            The testReplaceItemValueDateGregorianDateTimeKuwaitWinter failure
            seems to be spurious, as I couldn't reproduce it when I reran it.

            Peter

            Backtraces:
            ------------------------------------------------------------

            DateTimeTest
            de.bea.domingo.DateTimeTest
            testReplaceItemValueDateGregorianDateTimeWinter(de.bea.domingo.DateTimeTest)
            junit.framework.AssertionFailedError: expected:<0> but was:<-60>
                at junit.framework.Assert.fail(Assert.java:47)
                at junit.framework.Assert.failNotEquals(Assert.java:280)
                at junit.framework.Assert.assertEquals(Assert.java:64)
                at junit.framework.Assert.assertEquals(Assert.java:133)
                at junit.framework.Assert.assertEquals(Assert.java:139)
                at de.bea.domingo.DateTimeTest.assertValidCalendar(DateTimeTest.java:581)
                at de.bea.domingo.DateTimeTest.testReplaceItemValueDateGregorianDateTime(DateTimeTest.java:138)
                at de.bea.domingo.DateTimeTest.testReplaceItemValueDateGregorianDateTimeWinter(DateTimeTest.java:54)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at junit.framework.TestCase.runTest(TestCase.java:164)
                at junit.framework.TestCase.runBare(TestCase.java:130)
                at junit.framework.TestResult$1.protect(TestResult.java:106)
                at junit.framework.TestResult.runProtected(TestResult.java:124)
                at junit.framework.TestResult.run(TestResult.java:109)
                at junit.framework.TestCase.run(TestCase.java:120)
                at junit.framework.TestSuite.runTest(TestSuite.java:230)
                at junit.framework.TestSuite.run(TestSuite.java:225)
                at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
                at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

            testReplaceItemValueDateGregorianDateTimeKuwaitWinter(de.bea.domingo.DateTimeTest)
            de.bea.domingo.service.NotesServiceRuntimeException: de.bea.domingo.proxy.DocumentProxy: Cannot set calendar value of item test
                at de.bea.domingo.service.NotesServiceFactory.invoke(NotesServiceFactory.java:382)
                at de.bea.domingo.service.NotesInvocationHandler.invoke(NotesInvocationHandler.java:87)
                at $Proxy2.replaceItemValue(Unknown Source)
                at de.bea.domingo.DateTimeTest.testReplaceItemValueDateGregorianDateTime(DateTimeTest.java:133)
                at de.bea.domingo.DateTimeTest.testReplaceItemValueDateGregorianDateTimeKuwaitWinter(DateTimeTest.java:114)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at junit.framework.TestCase.runTest(TestCase.java:164)
                at junit.framework.TestCase.runBare(TestCase.java:130)
                at junit.framework.TestResult$1.protect(TestResult.java:106)
                at junit.framework.TestResult.runProtected(TestResult.java:124)
                at junit.framework.TestResult.run(TestResult.java:109)
                at junit.framework.TestCase.run(TestCase.java:120)
                at junit.framework.TestSuite.runTest(TestSuite.java:230)
                at junit.framework.TestSuite.run(TestSuite.java:225)
                at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
                at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
            Caused by: de.bea.domingo.proxy.NotesProxyRuntimeException: de.bea.domingo.proxy.DocumentProxy: Cannot set calendar value of item test
                at de.bea.domingo.proxy.BaseProxy.newRuntimeException(BaseProxy.java:718)
                at de.bea.domingo.proxy.BaseDocumentProxy.replaceItemValue(BaseDocumentProxy.java:250)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at de.bea.domingo.service.InvocationTask.run(InvocationTask.java:102)
                at de.bea.domingo.threadpool.SimpleThreadPool.run(SimpleThreadPool.java:369)
                at de.bea.domingo.proxy.DNotesThread.run(DNotesThread.java:244)
            Caused by: de.bea.domingo.exception.DominoException: [4000] Error while bulk recycling objects
                at de.bea.domingo.proxy.BaseProxy.newRuntimeException(BaseProxy.java:717)
                ... 8 more

            testReplaceItemValueDateGregorianCalendarWinter(de.bea.domingo.DateTimeTest)
            junit.framework.AssertionFailedError: expected:<0> but was:<-60>
                at junit.framework.Assert.fail(Assert.java:47)
                at junit.framework.Assert.failNotEquals(Assert.java:280)
                at junit.framework.Assert.assertEquals(Assert.java:64)
                at junit.framework.Assert.assertEquals(Assert.java:133)
                at junit.framework.Assert.assertEquals(Assert.java:139)
                at de.bea.domingo.DateTimeTest.assertValidCalendar(DateTimeTest.java:581)
                at de.bea.domingo.DateTimeTest.testReplaceItemValueDateGregorianCalendar(DateTimeTest.java:237)
                at de.bea.domingo.DateTimeTest.testReplaceItemValueDateGregorianCalendarWinter(DateTimeTest.java:151)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at junit.framework.TestCase.runTest(TestCase.java:164)
                at junit.framework.TestCase.runBare(TestCase.java:130)
                at junit.framework.TestResult$1.protect(TestResult.java:106)
                at junit.framework.TestResult.runProtected(TestResult.java:124)
                at junit.framework.TestResult.run(TestResult.java:109)
                at junit.framework.TestCase.run(TestCase.java:120)
                at junit.framework.TestSuite.runTest(TestSuite.java:230)
                at junit.framework.TestSuite.run(TestSuite.java:225)
                at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
                at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

            testReplaceItemValueListGregorianDateTimeWinter(de.bea.domingo.DateTimeTest)
            junit.framework.AssertionFailedError: expected:<0> but was:<-60>
                at junit.framework.Assert.fail(Assert.java:47)
                at junit.framework.Assert.failNotEquals(Assert.java:280)
                at junit.framework.Assert.assertEquals(Assert.java:64)
                at junit.framework.Assert.assertEquals(Assert.java:133)
                at junit.framework.Assert.assertEquals(Assert.java:139)
                at de.bea.domingo.DateTimeTest.assertValidCalendar(DateTimeTest.java:581)
                at de.bea.domingo.DateTimeTest.assertEqualsDateTimeList(DateTimeTest.java:566)
                at de.bea.domingo.DateTimeTest.testReplaceItemValueListGregorianDateTime(DateTimeTest.java:410)
                at de.bea.domingo.DateTimeTest.testReplaceItemValueListGregorianDateTimeWinter(DateTimeTest.java:325)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at junit.framework.TestCase.runTest(TestCase.java:164)
                at junit.framework.TestCase.runBare(TestCase.java:130)
                at junit.framework.TestResult$1.protect(TestResult.java:106)
                at junit.framework.TestResult.runProtected(TestResult.java:124)
                at junit.framework.TestResult.run(TestResult.java:109)
                at junit.framework.TestCase.run(TestCase.java:120)
                at junit.framework.TestSuite.runTest(TestSuite.java:230)
                at junit.framework.TestSuite.run(TestSuite.java:225)
                at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
                at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

            testReplaceItemValueListGregorianDateTimeSummer(de.bea.domingo.DateTimeTest)
            junit.framework.AssertionFailedError: expected:<0> but was:<-60>
                at junit.framework.Assert.fail(Assert.java:47)
                at junit.framework.Assert.failNotEquals(Assert.java:280)
                at junit.framework.Assert.assertEquals(Assert.java:64)
                at junit.framework.Assert.assertEquals(Assert.java:133)
                at junit.framework.Assert.assertEquals(Assert.java:139)
                at de.bea.domingo.DateTimeTest.assertValidCalendar(DateTimeTest.java:581)
                at de.bea.domingo.DateTimeTest.assertEqualsDateTimeList(DateTimeTest.java:566)
                at de.bea.domingo.DateTimeTest.testReplaceItemValueListGregorianDateTime(DateTimeTest.java:410)
                at de.bea.domingo.DateTimeTest.testReplaceItemValueListGregorianDateTimeSummer(DateTimeTest.java:330)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at junit.framework.TestCase.runTest(TestCase.java:164)
                at junit.framework.TestCase.runBare(TestCase.java:130)
                at junit.framework.TestResult$1.protect(TestResult.java:106)
                at junit.framework.TestResult.runProtected(TestResult.java:124)
                at junit.framework.TestResult.run(TestResult.java:109)
                at junit.framework.TestCase.run(TestCase.java:120)
                at junit.framework.TestSuite.runTest(TestSuite.java:230)
                at junit.framework.TestSuite.run(TestSuite.java:225)
                at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
                at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

            testReplaceItemValueDateRangeGregorianDateTimeWinter(de.bea.domingo.DateTimeTest)
            junit.framework.AssertionFailedError: expected:<0> but was:<-60>
                at junit.framework.Assert.fail(Assert.java:47)
                at junit.framework.Assert.failNotEquals(Assert.java:280)
                at junit.framework.Assert.assertEquals(Assert.java:64)
                at junit.framework.Assert.assertEquals(Assert.java:133)
                at junit.framework.Assert.assertEquals(Assert.java:139)
                at de.bea.domingo.DateTimeTest.assertValidCalendar(DateTimeTest.java:581)
                at de.bea.domingo.DateTimeTest.assertEqualsDateRange(DateTimeTest.java:601)
                at de.bea.domingo.DateTimeTest.testReplaceItemValueDateRange(DateTimeTest.java:536)
                at de.bea.domingo.DateTimeTest.testReplaceItemValueDateRangeGregorianDateTime(DateTimeTest.java:494)
                at de.bea.domingo.DateTimeTest.testReplaceItemValueDateRangeGregorianDateTimeWinter(DateTimeTest.java:417)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at junit.framework.TestCase.runTest(TestCase.java:164)
                at junit.framework.TestCase.runBare(TestCase.java:130)
                at junit.framework.TestResult$1.protect(TestResult.java:106)
                at junit.framework.TestResult.runProtected(TestResult.java:124)
                at junit.framework.TestResult.run(TestResult.java:109)
                at junit.framework.TestCase.run(TestCase.java:120)
                at junit.framework.TestSuite.runTest(TestSuite.java:230)
                at junit.framework.TestSuite.run(TestSuite.java:225)
                at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
                at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

            testReplaceItemValueDateRangeGregorianDateTimeSummer(de.bea.domingo.DateTimeTest)
            junit.framework.AssertionFailedError: expected:<0> but was:<-60>
                at junit.framework.Assert.fail(Assert.java:47)
                at junit.framework.Assert.failNotEquals(Assert.java:280)
                at junit.framework.Assert.assertEquals(Assert.java:64)
                at junit.framework.Assert.assertEquals(Assert.java:133)
                at junit.framework.Assert.assertEquals(Assert.java:139)
                at de.bea.domingo.DateTimeTest.assertValidCalendar(DateTimeTest.java:581)
                at de.bea.domingo.DateTimeTest.assertEqualsDateRange(DateTimeTest.java:601)
                at de.bea.domingo.DateTimeTest.testReplaceItemValueDateRange(DateTimeTest.java:536)
                at de.bea.domingo.DateTimeTest.testReplaceItemValueDateRangeGregorianDateTime(DateTimeTest.java:494)
                at de.bea.domingo.DateTimeTest.testReplaceItemValueDateRangeGregorianDateTimeSummer(DateTimeTest.java:422)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at junit.framework.TestCase.runTest(TestCase.java:164)
                at junit.framework.TestCase.runBare(TestCase.java:130)
                at junit.framework.TestResult$1.protect(TestResult.java:106)
                at junit.framework.TestResult.runProtected(TestResult.java:124)
                at junit.framework.TestResult.run(TestResult.java:109)
                at junit.framework.TestCase.run(TestCase.java:120)
                at junit.framework.TestSuite.runTest(TestSuite.java:230)
                at junit.framework.TestSuite.run(TestSuite.java:225)
                at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
                at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

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

            TimeZoneTest
            de.bea.domingo.TimeZoneTest
            testTimezones(de.bea.domingo.TimeZoneTest)
            junit.framework.AssertionFailedError: wrong item value expected:<1186016399> but was:<1185991199>
                at junit.framework.Assert.fail(Assert.java:47)
                at junit.framework.Assert.failNotEquals(Assert.java:280)
                at junit.framework.Assert.assertEquals(Assert.java:64)
                at junit.framework.Assert.assertEquals(Assert.java:133)
                at de.bea.domingo.TimeZoneTest.testTimezones(TimeZoneTest.java:62)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at junit.framework.TestCase.runTest(TestCase.java:164)
                at junit.framework.TestCase.runBare(TestCase.java:130)
                at junit.framework.TestResult$1.protect(TestResult.java:106)
                at junit.framework.TestResult.runProtected(TestResult.java:124)
                at junit.framework.TestResult.run(TestResult.java:109)
                at junit.framework.TestCase.run(TestCase.java:120)
                at junit.framework.TestSuite.runTest(TestSuite.java:230)
                at junit.framework.TestSuite.run(TestSuite.java:225)
                at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
                at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

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

             
      • Peter Wang

        Peter Wang - 2008-11-25

        1. Remote.

        2. Lotus Domino Server, Release 8.0

        3.
        java version "1.6.0_06"
        Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
        Java HotSpot(TM) 64-Bit Server VM (build 10.0-b22, mixed mode)

        4. connecting to Domino server

        5. Australian Eastern Standard Time.  I've also tested with CET.

        6. CET

        7,8,9. I couldn't figure out how to run the test suite.

        However, I can reproduce the problem with a short program:
        (sorry if the indentation is ruined)

        ///////////////////////////////////////////////////////////
        import java.util.Calendar;
        import java.util.GregorianCalendar;
        import java.util.TimeZone;

        public class MyDateTimeTest {

            public static int MILLIS_PER_SECOND = 1000;

            public static void main(String[] args) {
                TimeZone.setDefault(TimeZone.getTimeZone("CET"));
                // TimeZone.setDefault(TimeZone.getTimeZone("Australia/Melbourne"));

                final Calendar calendar = new GregorianCalendar();
                calendar.set(2008, Calendar.NOVEMBER, 25, 12, 0);
                System.out.println("calendar: " + calendar.getTime());

                // from InternationalProxy.createDateTime
                final Calendar correct = (Calendar) calendar.clone();
                System.out.println("correct0: " + correct.getTime());

                TimeZone gmtZone = TimeZone.getTimeZone("GMT");
                correct.setTimeZone(gmtZone);
                System.out.println("correct1: " + correct.getTime());

                TimeZone timeZone = calendar.getTimeZone();
                correct.add(Calendar.SECOND, -timeZone.getOffset(correct.getTimeInMillis()) / MILLIS_PER_SECOND);
                System.out.println("correct2: " + correct.getTime());
            }
        }
        ///////////////////////////////////////////////////////////

        The output is:

        calendar: Tue Nov 25 12:00:30 CET 2008
        correct0: Tue Nov 25 12:00:30 CET 2008
        correct1: Tue Nov 25 12:00:30 CET 2008
        correct2: Tue Nov 25 11:00:30 CET 2008

        And if I change the timezone to Australia/Melbourne (GMT+11):

        calendar: Tue Nov 25 12:00:30 EST 2008
        correct0: Tue Nov 25 12:00:30 EST 2008
        correct1: Tue Nov 25 12:00:30 EST 2008
        correct2: Tue Nov 25 01:00:30 EST 2008

        Peter

         
    • blackdoor

      blackdoor - 2008-11-21

      I am having issues with the date being what I expect also.  To answer your questions about my configuration:
      1. Local?  Using:  (Let me know if that does not answer your question)
                      DNotesFactory factory = DNotesFactory.getInstance();
              DSession session = factory.getSession(server, username, password);
      2.  Lotus Notes Client is 7.0.2, Server is 7.0.3
      3.  Sun's JDK 1.6.0_05
      4.  server
      5.  Windows XP : Date and Time Properties -->  GMT-06:00 Central Time
      6. GMT -6  (Trusting admins to give me correct answer)
      7.  Not sure how to run it so will get back to you when I have it done or needing help.
      8.  Same as 7.
      9.  Same as 7.

       
    • blackdoor

      blackdoor - 2008-11-21

      7.  I tried running 'maven site' and am getting a dependency error of:
             Trying to get missing dependencies (and updated snapshots) required by domingo:
      - Attempting to download javax.j2ee:j2ee:1.3:jar from file://C:\opt\Apache\mave
      \shared\repository
      - Attempting to download javax.j2ee:j2ee:1.3:jar from http://maven-plugins.sour
      eforge.net/repository/maven-plugins/
      - Attempting to download javax.j2ee:j2ee:1.3:jar from http://www.ibiblio.org/ma
      en/
      -------------------------------------------------------------------------------
      >> The build cannot continue because of the following unsatisfied dependency:
      - javax.j2ee:j2ee:1.3:jar (try downloading from http://java.sun.com/\)

      How do I resolve this?  I am barely Maven literate so I am sure its something simple.

       
    • blackdoor

      blackdoor - 2008-11-21

      I found this:   http://domingo.sourceforge.net/domingo-connector/faq.html

      Went to sun and the oldest I can download is J2EE 1.4.  Do I really need 1.3 and if so how do I get it?

       
      • Kurt Riede

        Kurt Riede - 2008-11-22

        Hello Andrew,

        you can download j2ee 1.3 here;
        http://java.sun.com/j2ee/1.3/download.html

        Best regards,
        Kurt

         
        • Kurt Riede

          Kurt Riede - 2008-11-22

          Please also note this:
          http://maven.apache.org/maven-1.x/reference/standard-sun-jar-names.html

          You must place the j2ee-1.3.jar file in your local repository manually.

           
        • blackdoor

          blackdoor - 2008-11-24

          Maybe I am blind, but I do not see the actual 1.3 download.
          I see specs, tutorials, and other links but not 1.3.
          Please advise.

           
          • Peter Wang

            Peter Wang - 2008-11-24

            Hi Andrew, I'm just embarking on running the test suite now myself.
            I believe this is the correct link: http://java.sun.com/j2ee/sdk_1.3/

            Peter

             
            • blackdoor

              blackdoor - 2008-11-24

              Thanks.  I was able to download 1.3 and have it in the local maven repository.  I am still getting the error downloading vdoclet:qdox:current:jar

              Any thoughts?

               
              • Peter Wang

                Peter Wang - 2008-11-24

                I downloaded them manually from here:
                http://www.astrogrid.org/maven/vdoclet/jars/

                Peter

                 
    • blackdoor

      blackdoor - 2008-11-21

      Well, I copied a J2EE 1.5 jar and named it j2ee-1.3.jar just to keep moving.  I am now getting this error:

      Trying to get missing dependencies (and updated snapshots) required by Maven Ta
      klist Plug-in:
      - Attempting to download vdoclet:qdox:current:jar from file://C:\opt\Apache\mav
      n\shared\repository
      - Attempting to download vdoclet:qdox:current:jar from http://maven-plugins.sou
      ceforge.net/repository/maven-plugins/
      - Attempting to download vdoclet:qdox:current:jar from http://www.ibiblio.org/m
      ven/
      -------------------------------------------------------------------------------
      >> Unable to obtain goal [site]
      >> The build cannot continue because of the following unsatisfied dependency:
      - vdoclet:qdox:current:jar

      -------------------------------------------------------------------------------
      BUILD FAILED

       

Log in to post a comment.