Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2512

Remove assumption that driver code source can be accessed via a "jar"-schemed URL

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Connection Management
    • Labels:
      None

      ClientMetadataHelper assumes that the driver version is found by building an URL to the jar file using the "jar" scheme, e.g. "jar:file:/path/to/jar/mongo-java-driver-3.4.2.jar!/"

      On Java 9 this may no longer work, depending on how an application deploys the Java driver. There are three possibilities:

      1. Deployed on the classpath
        • the existing code will continue to work
      2. Deployed on the module path as a Java 8-style jar file (like we currently create):
        • tests of java 9 early access builds show that un-named modules like this can not be added to a runtime image via jlink, so the existing code looks like it will still work: the code source of the un-named module will just be an URL with the "file" scheme, as above
      3. Deployed on the module path as a Java 9-style versioned modular jar file (of our creation)
        • Replace with call to ClientMetadataHelper.class.getModule().getDescriptor().rawVersion(). This will work whether the jar file is available as a "file" scheme URL or as part of a runtime image.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: