Derby
  1. Derby
  2. DERBY-5864

weme 6.2 (J2ME) runs fail to start with Failed to invoke class org.apache.derbyTesting.functionTests.tests.derbynet._Suite java.lang.reflect.InvocationTargetException

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 10.10.1.1
    • Fix Version/s: 10.10.1.1
    • Component/s: Test
    • Labels:
      None
    • Environment:
      Windows weme 6.2
      noticed trunk at revision 136330.
    • Issue & fix info:
      High Value Fix, Repro attached
    • Bug behavior facts:
      Regression Test Failure

      Description

      As in:
      http://people.apache.org/~myrnavl/derby_test_results/main/windows/testSummary-1362330.html

      All J2ME tests fail to start with the exception below loading the .derbynet._Suite.
      The root cause java.lang.UnsupportedClassVersionError: JVMCFRE003 bad major version for class=org/apache/derby/drda/NetworkServerControl, offset=6

      The derbynet tests do not need to run with J2ME but I think the tests need to be changed to not load derbynet._Suite at all now that network server compiles with the higher version.

      Failed to invoke class org.apache.derbyTesting.functionTests.tests.derbynet._Suite
      java.lang.reflect.InvocationTargetException
      at java.lang.reflect.AccessibleObject.invokeL(AccessibleObject.java:205)
      at java.lang.reflect.Method.invoke(Method.java:252)
      at org.apache.derbyTesting.functionTests.suites.AllPackages.invokeSuite(AllPackages.java:176)
      at org.apache.derbyTesting.functionTests.suites.AllPackages.suite(AllPackages.java:63)
      at org.apache.derbyTesting.functionTests.suites.All.suite(All.java:51)
      at java.lang.reflect.AccessibleObject.invokeL(AccessibleObject.java:203)
      at java.lang.reflect.Method.invoke(Method.java:252)
      at junit.runner.BaseTestRunner.getTest(BaseTestRunner.java:126)
      at junit.textui.TestRunner.start(TestRunner.java:184)
      at junit.textui.TestRunner.main(TestRunner.java:143)
      Caused by: java.lang.UnsupportedClassVersionError: JVMCFRE003 bad major version; class=org/apache/derby/drda/NetworkServerControl, offset=6
      at java.lang.ClassLoader.defineClassImpl(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:239)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:109)
      at java.net.URLClassLoader.findClassImpl(URLClassLoader.java:1073)
      at java.net.URLClassLoader.findClassImpl(URLClassLoader.java:1078)
      at java.net.URLClassLoader$LoadContext.run(URLClassLoader.java:570)
      at java.security.AccessController.doPrivileged(AccessController.java:227)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:586)
      at com.ibm.oti.vm.URLSystemClassLoader.findClass(URLSystemClassLoader.java:26)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:641)
      at com.ibm.oti.vm.URLAppClassLoader.loadClass(URLAppClassLoader.java:146)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:607)
      at java.lang.Class.forNameImpl(Native Method)
      at java.lang.Class.forName(Class.java:127)
      at org.apache.derbyTesting.junit.SecurityManagerSetup.getURL(SecurityManagerSetup.java:427)
      at org.apache.derbyTesting.junit.Derby.hasCorrectJar(Derby.java:97)
      at org.apache.derbyTesting.junit.Derby.hasServer(Derby.java:60)
      at org.apache.derbyTesting.functionTests.tests.derbynet.NetworkServerControlApiTest.suite(NetworkServerControlApiTest.java:315)
      at org.apache.derbyTesting.functionTests.tests.derbynet._Suite.suite(_Suite.java:49)
      at java.lang.reflect.AccessibleObject.invokeL(AccessibleObject.java:203)
      ... 9 more
      Failed to invoke suite():java.lang.reflect.InvocationTargetException

      I marked critical as it blocks all J2ME tests

      1. d5864-1a.diff
        3 kB
        Knut Anders Hatlen

        Issue Links

          Activity

          Kathey Marsden created issue -
          Kathey Marsden made changes -
          Field Original Value New Value
          Summary weme 6.1 (J2ME) runs fail to start with Failed to invoke class org.apache.derbyTesting.functionTests.tests.derbynet._Suite java.lang.reflect.InvocationTargetException weme 6.2 (J2ME) runs fail to start with Failed to invoke class org.apache.derbyTesting.functionTests.tests.derbynet._Suite java.lang.reflect.InvocationTargetException
          Kathey Marsden made changes -
          Bug behavior facts Regression Test Failure [ 10369 ]
          Issue & fix info High Value Fix,Repro attached [ 10422, 10424 ]
          Kathey Marsden made changes -
          Link This issue is related to DERBY-5840 [ DERBY-5840 ]
          Hide
          Kathey Marsden added a comment -

          My guess is this issue is related to this checkin for DERBY-5840. I have not confirmed.

          ------------------------------------------------------------------------
          r1361925 | kahatlen | 2012-07-16 00:22:45 -0700 (Mon, 16 Jul 2012) | 1 line

          DERBY-5840: Compile network server code with source and target level 1.5

          Show
          Kathey Marsden added a comment - My guess is this issue is related to this checkin for DERBY-5840 . I have not confirmed. ------------------------------------------------------------------------ r1361925 | kahatlen | 2012-07-16 00:22:45 -0700 (Mon, 16 Jul 2012) | 1 line DERBY-5840 : Compile network server code with source and target level 1.5
          Hide
          Knut Anders Hatlen added a comment -

          That sounds like a likely culprit. I'll take a look.

          Show
          Knut Anders Hatlen added a comment - That sounds like a likely culprit. I'll take a look.
          Hide
          Knut Anders Hatlen added a comment -

          The problem is that the test framework loads some classes from the client and the server while deciding which tests to run. Since the client and server now are compiled with target level 1.5, they won't load on most J2ME platforms.

          The attached patch makes the tests start again in OJEC 1.1 in my environment. It makes the following changes:

          • tests/derbynet/_Suite.java:
          • Utf8CcsidManagerClientTest has references to many classes in the client driver, so I moved it to the section guarded by Derby.hasClient() to prevent its suite() method from being called when the client driver is not available.
          • junit/Derby.java:
          • Made hasServer() return false immediately when running on J2ME, since the server isn't supported on that platform.
          • Reordered the checks in hasClient() so that it always returns false when running on J2ME. It already had logic for this, but it only worked as intended when the tests were running from jars.
          Show
          Knut Anders Hatlen added a comment - The problem is that the test framework loads some classes from the client and the server while deciding which tests to run. Since the client and server now are compiled with target level 1.5, they won't load on most J2ME platforms. The attached patch makes the tests start again in OJEC 1.1 in my environment. It makes the following changes: tests/derbynet/_Suite.java: Utf8CcsidManagerClientTest has references to many classes in the client driver, so I moved it to the section guarded by Derby.hasClient() to prevent its suite() method from being called when the client driver is not available. junit/Derby.java: Made hasServer() return false immediately when running on J2ME, since the server isn't supported on that platform. Reordered the checks in hasClient() so that it always returns false when running on J2ME. It already had logic for this, but it only worked as intended when the tests were running from jars.
          Knut Anders Hatlen made changes -
          Attachment d5864-1a.diff [ 12537209 ]
          Hide
          Kathey Marsden added a comment -

          +1 to the patch and thanks Knut for fixing this.
          weme 6.2 derbynet._Suite seems to run run fine with the patch with no tests run.

          ++ 'c:\cygwin\ibmsvn\ntsoftware\weme6.2/bin/j9' -Dderby.tests.trace=true -jcl:foun11 -DderbyTesting.serverhost=localhost
          -DderbyTesting.clienthost=localhost -Demma.active= '-Xbootclasspath/a:c:\cygwin\ibmsvn\ntsoftware\weme6.2/lib/jdbc.jar'
          '-Dbootcp=c:\cygwin\ibmsvn\ntsoftware\weme6.2/lib/jdbc.jar' junit.textui.TestRunner org.apache.derbyTesting.functionTes
          ts.tests.derbynet._Suite

          Time: 9.676

          OK (0 tests)

          I did not run all of suites.All but did verify it kicks off.

          Show
          Kathey Marsden added a comment - +1 to the patch and thanks Knut for fixing this. weme 6.2 derbynet._Suite seems to run run fine with the patch with no tests run. ++ 'c:\cygwin\ibmsvn\ntsoftware\weme6.2/bin/j9' -Dderby.tests.trace=true -jcl:foun11 -DderbyTesting.serverhost=localhost -DderbyTesting.clienthost=localhost -Demma.active= '-Xbootclasspath/a:c:\cygwin\ibmsvn\ntsoftware\weme6.2/lib/jdbc.jar' '-Dbootcp=c:\cygwin\ibmsvn\ntsoftware\weme6.2/lib/jdbc.jar' junit.textui.TestRunner org.apache.derbyTesting.functionTes ts.tests.derbynet._Suite Time: 9.676 OK (0 tests) I did not run all of suites.All but did verify it kicks off.
          Hide
          Knut Anders Hatlen added a comment -

          Thanks for testing the patch on weme, Kathey. I started suites.All on OJEC. Unfortunately, I took the startup flags from memory, and probably missed some, so the process eventually fell over. In any case, it seems to behave better than before, and a suites.All run I started in parallel on Java 7 ran successfully, so I checked in the patch.

          Committed revision 1363508.

          Show
          Knut Anders Hatlen added a comment - Thanks for testing the patch on weme, Kathey. I started suites.All on OJEC. Unfortunately, I took the startup flags from memory, and probably missed some, so the process eventually fell over. In any case, it seems to behave better than before, and a suites.All run I started in parallel on Java 7 ran successfully, so I checked in the patch. Committed revision 1363508.
          Knut Anders Hatlen made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Knut Anders Hatlen [ knutanders ]
          Fix Version/s 10.10.0.0 [ 12321550 ]
          Resolution Fixed [ 1 ]
          Gavin made changes -
          Workflow jira [ 12717268 ] Default workflow, editable Closed status [ 12796955 ]
          Hide
          Knut Anders Hatlen added a comment -

          [bulk update: close all resolved issues that haven't had any activity the last year]

          Show
          Knut Anders Hatlen added a comment - [bulk update: close all resolved issues that haven't had any activity the last year]
          Knut Anders Hatlen made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Myrna van Lunteren made changes -
          Component/s Test [ 11413 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          7h 5m 1 Knut Anders Hatlen 19/Jul/12 21:01
          Resolved Resolved Closed Closed
          483d 12h 13m 1 Knut Anders Hatlen 15/Nov/13 08:15

            People

            • Assignee:
              Knut Anders Hatlen
              Reporter:
              Kathey Marsden
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development