Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-9893

EasyMock/Mockito no longer works with Java 9 b148+

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 7.0
    • Fix Version/s: 6.4, 7.0
    • Component/s: Tests
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:

      Description

      EasyMock does not work anymore with latest Java 9, because it uses cglib behind that is trying to access a protected method inside the runtime using setAccessible. This is no longer allowed by Java 9.

      Actually this is really stupid. Instead of forcefully making the protected defineClass method available to the outside, it is much more correct to just subclass ClassLoader (like the Lucene expressions module does).

      I tried updating to easymock/mockito, but all that does not work, approx 25 tests fail. The only way is to disable all Mocking tests in Java 9. The underlying issue in cglib is still not solved, master's code is here: https://github.com/cglib/cglib/blob/master/cglib/src/main/java/net/sf/cglib/core/ReflectUtils.java#L44-L62

      As we use an old stone-aged version of mockito (1.x), a fix is not expected to happen, although cglib might fix this!

      What should we do? This stupid issue prevents us from testing Java 9 with Solr completely!

      1. SOLR-9893.patch
        28 kB
        Uwe Schindler
      2. SOLR-9893.patch
        15 kB
        Uwe Schindler

        Issue Links

          Activity

          Hide
          thetaphi Uwe Schindler added a comment -

          Sample stack trace:

             [junit4] ERROR   0.38s J2 | TestManagedSchemaThreadSafety.testThreadSafety <<<
             [junit4]    > Throwable #1: java.lang.ExceptionInInitializerError
             [junit4]    >        at __randomizedtesting.SeedInfo.seed([8E654E5E1F32A757:142F5A06CCAD15A1]:0)
             [junit4]    >        at org.mockito.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:167)
             [junit4]    >        at org.mockito.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
             [junit4]    >        at org.mockito.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:217)
             [junit4]    >        at org.mockito.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145)
             [junit4]    >        at org.mockito.cglib.core.KeyFactory.create(KeyFactory.java:117)
             [junit4]    >        at org.mockito.cglib.core.KeyFactory.create(KeyFactory.java:109)
             [junit4]    >        at org.mockito.cglib.core.KeyFactory.create(KeyFactory.java:105)
             [junit4]    >        at org.mockito.cglib.proxy.Enhancer.<clinit>(Enhancer.java:70)
             [junit4]    >        at org.mockito.internal.creation.jmock.ClassImposterizer.createProxyClass(ClassImposterizer.java:85)
             [junit4]    >        at org.mockito.internal.creation.jmock.ClassImposterizer.imposterise(ClassImposterizer.java:62)
             [junit4]    >        at org.mockito.internal.creation.jmock.ClassImposterizer.imposterise(ClassImposterizer.java:56)
             [junit4]    >        at org.mockito.internal.creation.CglibMockMaker.createMock(CglibMockMaker.java:23)
             [junit4]    >        at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:26)
             [junit4]    >        at org.mockito.internal.MockitoCore.mock(MockitoCore.java:51)
             [junit4]    >        at org.mockito.Mockito.mock(Mockito.java:1243)
             [junit4]    >        at org.apache.solr.schema.TestManagedSchemaThreadSafety.createZkController(TestManagedSchemaThreadSafety.java:135)
             [junit4]    >        at org.apache.solr.schema.TestManagedSchemaThreadSafety.testThreadSafety(TestManagedSchemaThreadSafety.java:118)
             [junit4]    >        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             [junit4]    >        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
             [junit4]    >        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
             [junit4]    >        at java.base/java.lang.reflect.Method.invoke(Method.java:538)
             [junit4]    >        at java.base/java.lang.Thread.run(Thread.java:844)
             [junit4]    > Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @4cbd6df7
             [junit4]    >        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:207)
             [junit4]    >        at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:192)
             [junit4]    >        at java.base/java.lang.reflect.Method.setAccessible(Method.java:186)
             [junit4]    >        at org.mockito.cglib.core.ReflectUtils$2.run(ReflectUtils.java:57)
             [junit4]    >        at java.base/java.security.AccessController.doPrivileged(Native Method)
             [junit4]    >        at org.mockito.cglib.core.ReflectUtils.<clinit>(ReflectUtils.java:47)
             [junit4]    >        ... 55 more
             [junit4]   2> 64469 INFO  (SUITE-TestManagedSchemaThreadSafety-seed#[8E654E5E1F32A757]-worker) [    ] o.a.s.c.ZkTestServer connecting to 127.0.0.1:51648 51648
             [junit4]   2> 64474 INFO  (Thread-158) [    ] o.a.s.c.ZkTestServer connecting to 127.0.0.1:51648 51648
             [junit4]   2> 64478 INFO  (SUITE-TestManagedSchemaThreadSafety-seed#[8E654E5E1F32A757]-worker) [    ] o.a.s.SolrTestCaseJ4 ###deleteCore
             [junit4]   2> NOTE: leaving temporary files on disk at: C:\Users\Uwe Schindler\Projects\lucene\trunk-lusolr1\solr\build\solr-core\test\J2\temp\solr.schema.TestManagedSchemaThreadSafety_8E654E5E1F32A757-001
             [junit4]   2> Dez. 26, 2016 8:47:14 NACHM. com.carrotsearch.randomizedtesting.ThreadLeakControl checkThreadLeaks
             [junit4]   2> WARNUNG: Will linger awaiting termination of 2 leaked thread(s).
             [junit4]   2> NOTE: test params are: codec=Lucene70, sim=RandomSimilarity(queryNorm=false): {}, locale=so-KE, timezone=Etc/GMT+4
             [junit4]   2> NOTE: Windows 10 10.0 amd64/Oracle Corporation 9-ea (64-bit)/cpus=4,threads=1,free=188820656,total=266338304
             [junit4]   2> NOTE: All tests run in this JVM: [TestRandomFaceting, TestCharFilters, BlockJoinFacetSimpleTest, SolrCmdDistributorTest, TestTolerantUpdateProcessorRandomCloud, TestManagedSchemaThreadSafety]
             [junit4] Completed [31/670 (1!)] on J2 in 0.83s, 1 test, 1 error <<< FAILURES!
          
          Show
          thetaphi Uwe Schindler added a comment - Sample stack trace: [junit4] ERROR 0.38s J2 | TestManagedSchemaThreadSafety.testThreadSafety <<< [junit4] > Throwable #1: java.lang.ExceptionInInitializerError [junit4] > at __randomizedtesting.SeedInfo.seed([8E654E5E1F32A757:142F5A06CCAD15A1]:0) [junit4] > at org.mockito.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:167) [junit4] > at org.mockito.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) [junit4] > at org.mockito.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:217) [junit4] > at org.mockito.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145) [junit4] > at org.mockito.cglib.core.KeyFactory.create(KeyFactory.java:117) [junit4] > at org.mockito.cglib.core.KeyFactory.create(KeyFactory.java:109) [junit4] > at org.mockito.cglib.core.KeyFactory.create(KeyFactory.java:105) [junit4] > at org.mockito.cglib.proxy.Enhancer.<clinit>(Enhancer.java:70) [junit4] > at org.mockito.internal.creation.jmock.ClassImposterizer.createProxyClass(ClassImposterizer.java:85) [junit4] > at org.mockito.internal.creation.jmock.ClassImposterizer.imposterise(ClassImposterizer.java:62) [junit4] > at org.mockito.internal.creation.jmock.ClassImposterizer.imposterise(ClassImposterizer.java:56) [junit4] > at org.mockito.internal.creation.CglibMockMaker.createMock(CglibMockMaker.java:23) [junit4] > at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:26) [junit4] > at org.mockito.internal.MockitoCore.mock(MockitoCore.java:51) [junit4] > at org.mockito.Mockito.mock(Mockito.java:1243) [junit4] > at org.apache.solr.schema.TestManagedSchemaThreadSafety.createZkController(TestManagedSchemaThreadSafety.java:135) [junit4] > at org.apache.solr.schema.TestManagedSchemaThreadSafety.testThreadSafety(TestManagedSchemaThreadSafety.java:118) [junit4] > at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [junit4] > at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [junit4] > at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [junit4] > at java.base/java.lang.reflect.Method.invoke(Method.java:538) [junit4] > at java.base/java.lang.Thread.run(Thread.java:844) [junit4] > Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @4cbd6df7 [junit4] > at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:207) [junit4] > at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:192) [junit4] > at java.base/java.lang.reflect.Method.setAccessible(Method.java:186) [junit4] > at org.mockito.cglib.core.ReflectUtils$2.run(ReflectUtils.java:57) [junit4] > at java.base/java.security.AccessController.doPrivileged(Native Method) [junit4] > at org.mockito.cglib.core.ReflectUtils.<clinit>(ReflectUtils.java:47) [junit4] > ... 55 more [junit4] 2> 64469 INFO (SUITE-TestManagedSchemaThreadSafety-seed#[8E654E5E1F32A757]-worker) [ ] o.a.s.c.ZkTestServer connecting to 127.0.0.1:51648 51648 [junit4] 2> 64474 INFO (Thread-158) [ ] o.a.s.c.ZkTestServer connecting to 127.0.0.1:51648 51648 [junit4] 2> 64478 INFO (SUITE-TestManagedSchemaThreadSafety-seed#[8E654E5E1F32A757]-worker) [ ] o.a.s.SolrTestCaseJ4 ###deleteCore [junit4] 2> NOTE: leaving temporary files on disk at: C:\Users\Uwe Schindler\Projects\lucene\trunk-lusolr1\solr\build\solr-core\test\J2\temp\solr.schema.TestManagedSchemaThreadSafety_8E654E5E1F32A757-001 [junit4] 2> Dez. 26, 2016 8:47:14 NACHM. com.carrotsearch.randomizedtesting.ThreadLeakControl checkThreadLeaks [junit4] 2> WARNUNG: Will linger awaiting termination of 2 leaked thread(s). [junit4] 2> NOTE: test params are: codec=Lucene70, sim=RandomSimilarity(queryNorm=false): {}, locale=so-KE, timezone=Etc/GMT+4 [junit4] 2> NOTE: Windows 10 10.0 amd64/Oracle Corporation 9-ea (64-bit)/cpus=4,threads=1,free=188820656,total=266338304 [junit4] 2> NOTE: All tests run in this JVM: [TestRandomFaceting, TestCharFilters, BlockJoinFacetSimpleTest, SolrCmdDistributorTest, TestTolerantUpdateProcessorRandomCloud, TestManagedSchemaThreadSafety] [junit4] Completed [31/670 (1!)] on J2 in 0.83s, 1 test, 1 error <<< FAILURES!
          Hide
          markrmiller@gmail.com Mark Miller added a comment -

          I imagine this will get addressed at some point as problems bubble up. I would just leave a blocker issue open for whatever version we expect to ship on 9 and ignore those tests for java 9.

          We should probably open issues against these libs if they don't already exist.

          Show
          markrmiller@gmail.com Mark Miller added a comment - I imagine this will get addressed at some point as problems bubble up. I would just leave a blocker issue open for whatever version we expect to ship on 9 and ignore those tests for java 9. We should probably open issues against these libs if they don't already exist.
          Hide
          markrmiller@gmail.com Mark Miller added a comment -

          I am a proponent of only using one of these mock libs. It's too much to ask devs to deal with two.

          I hate even having to deal with one, but I do love how it forces devs to understand more than they want to make some changes. Changing some of these tests can be such a painful process though.

          I use simple object mocks wherever I can instead.

          Show
          markrmiller@gmail.com Mark Miller added a comment - I am a proponent of only using one of these mock libs. It's too much to ask devs to deal with two. I hate even having to deal with one, but I do love how it forces devs to understand more than they want to make some changes. Changing some of these tests can be such a painful process though. I use simple object mocks wherever I can instead.
          Hide
          thetaphi Uwe Schindler added a comment - - edited

          Hi Mark,
          I fully agree with you. I will keep this issue open as a blocker. I will first fix the remaining issues in Lucene and then check out all usages of mocking libraries. Unfortunately, as you said, we have multiple mock libs. But all have the same problem behind: CGLIB. The underlying issue is the static initializer of CGLIB's ReflectUtils. I will open a bug report on their Github account later.

          Java 9 will (hopefully) be released this summer, so we should really work on solving the remaining Java 9 issues. From my participation in OpenJDK mailing lists I know that it is unlikely they will fix the setAccessible on runtime classes (public APIs) - they only have special cases for sun.misc.Unsafe and sun.misc.ReflectUtils.

          One "quick'n'dirty" solution would be to add a command line option to the test runners in Solr only that opens "java.lang" for reflection (which is still possible). As this only affects tests and not production code, we may be able to live with this. I will also investigate that.

          Show
          thetaphi Uwe Schindler added a comment - - edited Hi Mark, I fully agree with you. I will keep this issue open as a blocker. I will first fix the remaining issues in Lucene and then check out all usages of mocking libraries. Unfortunately, as you said, we have multiple mock libs. But all have the same problem behind: CGLIB. The underlying issue is the static initializer of CGLIB's ReflectUtils. I will open a bug report on their Github account later. Java 9 will (hopefully) be released this summer, so we should really work on solving the remaining Java 9 issues. From my participation in OpenJDK mailing lists I know that it is unlikely they will fix the setAccessible on runtime classes (public APIs) - they only have special cases for sun.misc.Unsafe and sun.misc.ReflectUtils. One "quick'n'dirty" solution would be to add a command line option to the test runners in Solr only that opens "java.lang" for reflection (which is still possible). As this only affects tests and not production code, we may be able to live with this. I will also investigate that.
          Hide
          thetaphi Uwe Schindler added a comment -
          Show
          thetaphi Uwe Schindler added a comment - I opened: https://github.com/cglib/cglib/issues/93
          Hide
          julianhyde Julian Hyde added a comment -

          We are running into the same issue in Calcite/Avatica: CALCITE-1567. Do you know if there is a Mockito bug logged for this? Somewhere in https://github.com/cglib/cglib/issues/93 someone suggests that it is fixed in a later version of Mockito. If so I would like to upgrade to that version of Mockito.

          Show
          julianhyde Julian Hyde added a comment - We are running into the same issue in Calcite/Avatica: CALCITE-1567 . Do you know if there is a Mockito bug logged for this? Somewhere in https://github.com/cglib/cglib/issues/93 someone suggests that it is fixed in a later version of Mockito. If so I would like to upgrade to that version of Mockito.
          Hide
          thetaphi Uwe Schindler added a comment - - edited

          Hi Julian Hyde,

          I have no further information about this. I'd suggest to ask on the Github issue. We will disable the tests for now (using some assumeFalse("does not work", Constants.JRE_IS_MINIMUM_JAVA9)). For Solr it's a bit more work as it historically uses many mocking frameworks and all of these broke.

          It is also not easy to fix this, as CGLIB is included in shaded form and bundled with the mocking jars, so you cannot just replace cglib dependency at one central place and all would work. You have to wait for updates of all those mocking frameworks.

          Not sure how to proceed

          Show
          thetaphi Uwe Schindler added a comment - - edited Hi Julian Hyde , I have no further information about this. I'd suggest to ask on the Github issue. We will disable the tests for now (using some assumeFalse("does not work", Constants.JRE_IS_MINIMUM_JAVA9) ). For Solr it's a bit more work as it historically uses many mocking frameworks and all of these broke. It is also not easy to fix this, as CGLIB is included in shaded form and bundled with the mocking jars, so you cannot just replace cglib dependency at one central place and all would work. You have to wait for updates of all those mocking frameworks. Not sure how to proceed
          Hide
          julianhyde Julian Hyde added a comment -

          Uwe Schindler, Thanks for replying. I agree with your strategy. I've disabled our offending tests using Assume, and we can still claim that Avatica works on JDK9, albeit with less coverage.

          I am concerned that the Mockito/Cglib community seem to think that JDK9 support == adding support for new JDK9 features. Whereas we just want the same old functionality to run on a JDK9 runtime. (We can't use JDK9 features until we drop support for JDK1.7 and JDK1.8.) I'll weigh in on https://github.com/cglib/cglib/issues/93 and until then I guess we'll have to be patient.

          Show
          julianhyde Julian Hyde added a comment - Uwe Schindler , Thanks for replying. I agree with your strategy. I've disabled our offending tests using Assume, and we can still claim that Avatica works on JDK9, albeit with less coverage. I am concerned that the Mockito/Cglib community seem to think that JDK9 support == adding support for new JDK9 features. Whereas we just want the same old functionality to run on a JDK9 runtime. (We can't use JDK9 features until we drop support for JDK1.7 and JDK1.8.) I'll weigh in on https://github.com/cglib/cglib/issues/93 and until then I guess we'll have to be patient.
          Hide
          thetaphi Uwe Schindler added a comment -

          Hi,
          I was able to update Solr-Code's Test Dependencies to latest Mockito/Bytebuddy. This makes most Mocking tests works again.
          But Easymock did not release a new version (and seems no longer maintained). If somemody has time to rewrite those tests (about 13 Suites with 23 tests, only!!!!) to use Mockito, too - we would be able to run our tests with Java 9:

          Some of those tests that failed in my local run may be unrelated, this is just the output:

          [junit4] Tests with failures [seed: A99FA98E35E3349A] (first 10 out of 23):
          [junit4] - org.apache.solr.cloud.TestSolrCloudWithDelegationTokens.testDelegationTokenCancelFail
          [junit4] - org.apache.solr.core.BlobRepositoryMockingTest.testGetBlobIncrRefStringDecoder
          [junit4] - org.apache.solr.core.BlobRepositoryMockingTest.testGetBlobIncrRefString
          [junit4] - org.apache.solr.core.BlobRepositoryMockingTest.testCachedAlready
          [junit4] - org.apache.solr.core.BlobRepositoryMockingTest.testCloudOnly
          [junit4] - org.apache.solr.cloud.SyncSliceTest (suite)
          [junit4] - org.apache.solr.cloud.OverseerCollectionConfigSetProcessorTest (suite)
          [junit4] - org.apache.solr.handler.component.DistributedFacetPivotWhiteBoxTest (suite)
          [junit4] - org.apache.solr.servlet.SolrRequestParserTest.testStandardFormdataUploadLimit
          [junit4] - org.apache.solr.servlet.SolrRequestParserTest.testStandardParseParamsAndFillStreamsISO88591

          The problem with Easymock is: Old versions (Solr uses 3.0) depend on outdated cglib that has no Java 9 compatible release. Newer versions (3.4) ships with CGLIB bundled and shaded. So even if CGLIB releases a newer version, it won't help, because Easymock uses the shaded and bundled broken version. Easymock seems dead to me. So let's nuke it. Mockito is the way to go.

          For now my only chance is to disable all Easymock based tests, they are incompatible to Java 9.

          Show
          thetaphi Uwe Schindler added a comment - Hi, I was able to update Solr-Code's Test Dependencies to latest Mockito/Bytebuddy. This makes most Mocking tests works again. But Easymock did not release a new version (and seems no longer maintained). If somemody has time to rewrite those tests (about 13 Suites with 23 tests, only!!!!) to use Mockito, too - we would be able to run our tests with Java 9: Some of those tests that failed in my local run may be unrelated, this is just the output: [junit4] Tests with failures [seed: A99FA98E35E3349A] (first 10 out of 23): [junit4] - org.apache.solr.cloud.TestSolrCloudWithDelegationTokens.testDelegationTokenCancelFail [junit4] - org.apache.solr.core.BlobRepositoryMockingTest.testGetBlobIncrRefStringDecoder [junit4] - org.apache.solr.core.BlobRepositoryMockingTest.testGetBlobIncrRefString [junit4] - org.apache.solr.core.BlobRepositoryMockingTest.testCachedAlready [junit4] - org.apache.solr.core.BlobRepositoryMockingTest.testCloudOnly [junit4] - org.apache.solr.cloud.SyncSliceTest (suite) [junit4] - org.apache.solr.cloud.OverseerCollectionConfigSetProcessorTest (suite) [junit4] - org.apache.solr.handler.component.DistributedFacetPivotWhiteBoxTest (suite) [junit4] - org.apache.solr.servlet.SolrRequestParserTest.testStandardFormdataUploadLimit [junit4] - org.apache.solr.servlet.SolrRequestParserTest.testStandardParseParamsAndFillStreamsISO88591 The problem with Easymock is: Old versions (Solr uses 3.0) depend on outdated cglib that has no Java 9 compatible release. Newer versions (3.4) ships with CGLIB bundled and shaded. So even if CGLIB releases a newer version, it won't help, because Easymock uses the shaded and bundled broken version. Easymock seems dead to me. So let's nuke it. Mockito is the way to go. For now my only chance is to disable all Easymock based tests, they are incompatible to Java 9.
          Hide
          thetaphi Uwe Schindler added a comment -

          Here is the patch for the Mockito Update to be Java 9 compatible (Thanks to Rafael Winterhalter for fixing Bytebuddy).

          Show
          thetaphi Uwe Schindler added a comment - Here is the patch for the Mockito Update to be Java 9 compatible (Thanks to Rafael Winterhalter for fixing Bytebuddy).
          Hide
          thetaphi Uwe Schindler added a comment - - edited

          I found this about more or less "automated rewrite" of EasyMock tests to Mockito:

          It is not many tests, so this would be a great cleanup.

          • contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestJdbcDataSource.java
          • core/src/test/org/apache/solr/cloud/ClusterStateTest.java
          • core/src/test/org/apache/solr/cloud/OverseerCollectionConfigSetProcessorTest.java
          • core/src/test/org/apache/solr/core/BlobRepositoryMockingTest.java
          • core/src/test/org/apache/solr/core/CoreSorterTest.java
          • core/src/test/org/apache/solr/security/TestPKIAuthenticationPlugin.java
          • core/src/test/org/apache/solr/servlet/SolrRequestParserTest.java
          • solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrClientCacheTest.java

          I will work on a patch.

          Show
          thetaphi Uwe Schindler added a comment - - edited I found this about more or less "automated rewrite" of EasyMock tests to Mockito: https://wiki.magnolia-cms.com/display/DEV/Converting+Easymock-Tests+to+Mockito A script doing this: https://gist.github.com/stefanbirkner/1095194/904909cc229b6acb55c18f529e396089129e20e9 It is not many tests, so this would be a great cleanup. contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestJdbcDataSource.java core/src/test/org/apache/solr/cloud/ClusterStateTest.java core/src/test/org/apache/solr/cloud/OverseerCollectionConfigSetProcessorTest.java core/src/test/org/apache/solr/core/BlobRepositoryMockingTest.java core/src/test/org/apache/solr/core/CoreSorterTest.java core/src/test/org/apache/solr/security/TestPKIAuthenticationPlugin.java core/src/test/org/apache/solr/servlet/SolrRequestParserTest.java solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrClientCacheTest.java I will work on a patch.
          Hide
          thetaphi Uwe Schindler added a comment -

          Here is a patch that makes all of Solr working with Java 9:

          • Update Mockito to 2.6.2 (that is compatible to Java 9, because it uses ByteBuddy).
          • Disable all tests that use EasyMock. I will open a separate issue to do the migration away from IMHO "no longer maintained" EasyMock. There are scripts to do this more or less automatically.

          I will further update the patch and add missing sha1-sums and license files.

          Show
          thetaphi Uwe Schindler added a comment - Here is a patch that makes all of Solr working with Java 9: Update Mockito to 2.6.2 (that is compatible to Java 9, because it uses ByteBuddy). Disable all tests that use EasyMock. I will open a separate issue to do the migration away from IMHO "no longer maintained" EasyMock. There are scripts to do this more or less automatically. I will further update the patch and add missing sha1-sums and license files.
          Hide
          thetaphi Uwe Schindler added a comment -

          Final patch with all licenses corrected and SHA1 sums.

          I will commit this in a moment and update Policeman Jenkins to user Java 9 build 151.

          Show
          thetaphi Uwe Schindler added a comment - Final patch with all licenses corrected and SHA1 sums. I will commit this in a moment and update Policeman Jenkins to user Java 9 build 151.
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 4eafdb337ab88553506e15bc186cd06464ea14f9 in lucene-solr's branch refs/heads/master from Uwe Schindler
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=4eafdb3 ]

          SOLR-9893: Update Mockito to version 2.6.2 for Java 9 support. Disable all legacy EasyMock tests when running on Java 9 until they were migrated to Mockito

          Show
          jira-bot ASF subversion and git services added a comment - Commit 4eafdb337ab88553506e15bc186cd06464ea14f9 in lucene-solr's branch refs/heads/master from Uwe Schindler [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=4eafdb3 ] SOLR-9893 : Update Mockito to version 2.6.2 for Java 9 support. Disable all legacy EasyMock tests when running on Java 9 until they were migrated to Mockito
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit ddca27a7c6255d250d9e700efb0da0b82cd67b64 in lucene-solr's branch refs/heads/branch_6x from Uwe Schindler
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=ddca27a ]

          SOLR-9893: Update Mockito to version 2.6.2 for Java 9 support. Disable all legacy EasyMock tests when running on Java 9 until they were migrated to Mockito

          Show
          jira-bot ASF subversion and git services added a comment - Commit ddca27a7c6255d250d9e700efb0da0b82cd67b64 in lucene-solr's branch refs/heads/branch_6x from Uwe Schindler [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=ddca27a ] SOLR-9893 : Update Mockito to version 2.6.2 for Java 9 support. Disable all legacy EasyMock tests when running on Java 9 until they were migrated to Mockito
          Hide
          thetaphi Uwe Schindler added a comment -

          I opened SOLR-9966 for migrating EasyMock tests to Mockito.

          Show
          thetaphi Uwe Schindler added a comment - I opened SOLR-9966 for migrating EasyMock tests to Mockito.
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 27ec40d3f5117d22a14e179506bec8e545906077 in lucene-solr's branch refs/heads/master from Uwe Schindler
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=27ec40d ]

          SOLR-9893: For full Java 9 compatibility also update to latest Objenesis 2.5 (this allows mocking frameworks to instantiate objects without a ctor)

          Show
          jira-bot ASF subversion and git services added a comment - Commit 27ec40d3f5117d22a14e179506bec8e545906077 in lucene-solr's branch refs/heads/master from Uwe Schindler [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=27ec40d ] SOLR-9893 : For full Java 9 compatibility also update to latest Objenesis 2.5 (this allows mocking frameworks to instantiate objects without a ctor)
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 6c0ec822a6d83a186c23b0a87c9fc2b0b62c6178 in lucene-solr's branch refs/heads/branch_6x from Uwe Schindler
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=6c0ec82 ]

          SOLR-9893: For full Java 9 compatibility also update to latest Objenesis 2.5 (this allows mocking frameworks to instantiate objects without a ctor)

          Show
          jira-bot ASF subversion and git services added a comment - Commit 6c0ec822a6d83a186c23b0a87c9fc2b0b62c6178 in lucene-solr's branch refs/heads/branch_6x from Uwe Schindler [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=6c0ec82 ] SOLR-9893 : For full Java 9 compatibility also update to latest Objenesis 2.5 (this allows mocking frameworks to instantiate objects without a ctor)
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 47b25354d721a47211294690aee3096f78ccd6a4 in lucene-solr's branch refs/heads/branch_6_4 from Uwe Schindler
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=47b2535 ]

          SOLR-9893: For full Java 9 compatibility also update to latest Objenesis 2.5 (this allows mocking frameworks to instantiate objects without a ctor)

          Show
          jira-bot ASF subversion and git services added a comment - Commit 47b25354d721a47211294690aee3096f78ccd6a4 in lucene-solr's branch refs/heads/branch_6_4 from Uwe Schindler [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=47b2535 ] SOLR-9893 : For full Java 9 compatibility also update to latest Objenesis 2.5 (this allows mocking frameworks to instantiate objects without a ctor)
          Hide
          dsmiley David Smiley added a comment -

          Awesome; thanks Uwe!

          Show
          dsmiley David Smiley added a comment - Awesome; thanks Uwe!

            People

            • Assignee:
              thetaphi Uwe Schindler
              Reporter:
              thetaphi Uwe Schindler
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development