Uploaded image for project: 'Couchbase Lite'
  1. Couchbase Lite
  2. CBL-272

MessageSocketFactory.socket_open() is not accessible by C4Socket

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.7.0
    • Java-Android
    • Security Level: Public
    • None
    • CBL Sprint 1
    • 3

    Description

      com.couchbase.lite.MessageSocketFactory has package level accessor so it cannot be seen by com.couchbase.lite.internal.core.C4Socket. The socket_open() is called by using reflection which somehow works on Android but not Java. In theory, it shouldn't be working for Android too.

      Exception:

      Exception in thread "Thread-3" java.lang.RuntimeException: socket_open() method is not accessible
      	at com.couchbase.lite.internal.core.C4Socket.open(C4Socket.java:146)
      Caused by: java.lang.IllegalAccessException: class com.couchbase.lite.internal.core.C4Socket cannot access a member of class com.couchbase.lite.MessageSocketFactory with modifiers "public static"
      	at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:361)
      	at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:591)
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          Note: This is tested on Mac using Open JDK 9.0.

          pasin Pasin Suriyentrakorn added a comment - Note: This is tested on Mac using Open JDK 9.0.

          This seems to be Java only problem. Moving MessageSocketFactory and MessageSocket class to the internal package and declare the class as public would solve this issue. We will also need to move CBLStatus into internal package and change the class access level to public as well.

          pasin Pasin Suriyentrakorn added a comment - This seems to be Java only problem. Moving MessageSocketFactory and MessageSocket class to the internal package and declare the class as public would solve this issue. We will also need to move CBLStatus into internal package and change the class access level to public as well.

          Build couchbase-lite-android-2.7.0-64 contains couchbase-lite-java commit a14071c with commit message:
          CBL-272 : Move CBLStatus to internal package

          build-team Couchbase Build Team added a comment - Build couchbase-lite-android-2.7.0-64 contains couchbase-lite-java commit a14071c with commit message: CBL-272 : Move CBLStatus to internal package

          Build couchbase-lite-android-2.7.0-64 contains couchbase-lite-java-ee commit e59c298 with commit message:
          CBL-272 : Move MessageSocketFactory to internal package

          build-team Couchbase Build Team added a comment - Build couchbase-lite-android-2.7.0-64 contains couchbase-lite-java-ee commit e59c298 with commit message: CBL-272 : Move MessageSocketFactory to internal package

          People

            pasin Pasin Suriyentrakorn
            pasin Pasin Suriyentrakorn
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty