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

EasyMock/Mockito no longer works with Java 9 b148+



    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 7.0
    • Fix Version/s: 6.4, 7.0
    • Component/s: Tests
    • Labels:


      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



              • Assignee:
                uschindler Uwe Schindler
                uschindler Uwe Schindler
              • Votes:
                0 Vote for this issue
                5 Start watching this issue


                • Created: