[Geoserver-devel] was GeoServer 2.20.2 built with Java 11?

The reason I'm asking is I just tried to repro an old Jira and enabled WFS to download shapezip, but running into the dreaded ByteBuffer error while downloading.

this is:

Versie 2.20.2
Revisie 1ef0697b8485d4ef9c760ad410b8d049725e7a66
Datum 24-Jan-2022 00:05
GeoTools 26.2 (rev 64c409b2a537142993932e706c3f9c6e9efa7529)
GeoWebCache 1.20.1 (rev 1.20.x/68f4e6bb663682ab9c8c2ccd0bb2a7dd7ad5d685)

on
up2date Ubuntu 18.04.6 LTS

with

Java Private Build: 1.8.0_312 (OpenJDK 64-Bit Server VM)

This server normally has WFS turned off, and in general we tend to run on Java 11..

2022-02-17 15:13:01,407 ERROR [geoserver.ows] -
java.lang.NoSuchMethodError: java.nio.ByteBuffer.limit(I)Ljava/nio/ByteBuffer;
  at org.geotools.data.PrjFileReader.<init>(PrjFileReader.java:84)
  at org.geotools.data.PrjFileReader.<init>(PrjFileReader.java:64)
  at org.geotools.data.shapefile.ShapefileSetManager.openPrjReader(ShapefileSetManager.java:152)
  at org.geotools.data.shapefile.ShapefileFeatureSource.readAttributes(ShapefileFeatureSource.java:499)
  at org.geotools.data.shapefile.ShapefileFeatureSource.buildFeatureType(ShapefileFeatureSource.java:454)
  at org.geotools.data.shapefile.ShapefileFeatureStore.buildFeatureType(ShapefileFeatureStore.java:142)
  at org.geotools.data.store.ContentFeatureSource.getAbsoluteSchema(ContentFeatureSource.java:338)
  at org.geotools.data.store.ContentFeatureSource.getSchema(ContentFeatureSource.java:307)
  at org.geotools.data.store.ContentFeatureStore.getWriter(ContentFeatureStore.java:116)
  at org.geotools.data.store.ContentDataStore.getFeatureWriter(ContentDataStore.java:381)
  at org.geotools.data.store.ContentDataStore.getFeatureWriter(ContentDataStore.java:412)
  at org.geotools.data.shapefile.ShapefileDumper$StoreWriter.createStoreAndWriter(ShapefileDumper.java:92)
  at org.geotools.data.shapefile.ShapefileDumper$StoreWriter.<init>(ShapefileDumper.java:86)
  at org.geotools.data.shapefile.ShapefileDumper.getStoreWriter(ShapefileDumper.java:460)
  at org.geotools.data.shapefile.ShapefileDumper.getStoreWriter(ShapefileDumper.java:420)
  at org.geotools.data.shapefile.ShapefileDumper.dump(ShapefileDumper.java:241)
  at org.geotools.data.shapefile.ShapefileDumper.dump(ShapefileDumper.java:185)

That is not good, I expect it would be geotools made with Java 11 if you are seeing that problem.

Actually I may have been made with Java 11 as Jenkins was updated by Torben from Java 8 to Java 11; and if the release job did not explicitly ask for a JDK to use it may end up with the “system default”.

Checking geotools-release:

maven/java settings:
 [1mApache Maven 3.6.3 [m
Maven home: /usr/share/maven
Java version: 1.8.0_212, vendor: AdoptOpenJDK, runtime: /var/lib/jenkins/tools/hudson.model.JDK/OpenJDK_8u212/jdk8u212-b03/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-91-generic", arch: "amd64", family: "unix"

Checking geotools-release-publish:

maven/java settings: [https://build.geoserver.org/view/release/job/geotools-release-publish/37/consoleFull](https://build.geoserver.org/view/release/job/geotools-release-publish/37/consoleFull)
+ mvn -version
 [1mApache Maven 3.6.3 [m
Maven home: /usr/share/maven
Java version: 1.8.0_212, vendor: AdoptOpenJDK, runtime: /var/lib/jenkins/tools/hudson.model.JDK/OpenJDK_8u212/jdk8u212-b03/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-91-generic", arch: "amd64", family: "unix"
+ echo MAVEN_FLAGS=

Checking geoserver-release: https://build.geoserver.org/view/release/job/geoserver-release/41/consoleFull

  • logs:
maven/java settings:
 [1mApache Maven 3.6.3 [m
Maven home: /usr/share/maven
Java version: 1.8.0_212, vendor: AdoptOpenJDK, runtime: /var/lib/jenkins/tools/hudson.model.JDK/OpenJDK_8u212/jdk8u212-b03/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-91-generic", arch: "amd64", family: "unix"

checking geoserver-release-publish:

Unable to confirm what was used

  • configuration: Says OpenJDK8u212

Cannot see Java 11 being used.

···


Jody Garnett

Can you check some of the gt and gs jars please, we should be able to confirm:

jar xvf gt-wfs-26.2.jar META-INF

Or extract a class file and use javap -v | grep major

···


Jody Garnett

downloaded and extracted the war from the server, the manifest file in gt-main-26.2.jar says

Manifest-Version: 1.0

Created-By: Apache Maven 3.6.3

Built-By: jenkins

Build-Jdk: 11.0.13

Class-Path: gt-referencing-26.2.jar ejml-ddense-0.34.jar ejml-core-0.34.

  jar commons-pool-1.5.4.jar gt-metadata-26.2.jar gt-opengis-26.2.jar sys

  tems-common-2.0.2.jar unit-api-2.0.jar indriya-2.0.2.jar uom-lib-common

  -2.0.jar javax.inject-1.jar si-quantity-2.0.1.jar si-units-2.0.1.jar ja

  karta.annotation-api-1.3.4.jar net.opengis.ows-26.2.jar org.w3.xlink-26

  .2.jar org.eclipse.emf.common-2.15.0.jar org.eclipse.emf.ecore-2.15.0.j

  ar org.eclipse.emf.ecore.xmi-2.15.0.jar jgridshift-core-1.3.jar Geograp

  hicLib-Java-1.49.jar gt-http-26.2.jar jts-core-1.18.2.jar commons-text-

  1.6.jar commons-lang3-3.8.1.jar jackson-core-2.10.5.jar jai_core-1.1.3.

  jar

Automatic-Module-Name: org.geotools.main

Build-Timestamp: 23-Jan-2022 04:52

Git-Revision: 64c409b2a537142993932e706c3f9c6e9efa7529

Project-Version: 26.2

which is identicat to the one from the geoserver.war I just downloaded from sourceforge:

Manifest-Version: 1.0

Automatic-Module-Name: org.geotools.main

Build-Timestamp: 23-Jan-2022 08:56

Built-By: jenkins

Class-Path: gt-referencing-26.2.jar ejml-ddense-0.34.jar ejml-core-0.3

  4.jar commons-pool-1.5.4.jar gt-metadata-26.2.jar gt-opengis-26.2.jar

   systems-common-2.0.2.jar unit-api-2.0.jar indriya-2.0.2.jar uom-lib-

  common-2.0.jar javax.inject-1.jar si-quantity-2.0.1.jar si-units-2.0.

  1.jar jakarta.annotation-api-1.3.4.jar net.opengis.ows-26.2.jar org.w

  3.xlink-26.2.jar org.eclipse.emf.common-2.15.0.jar org.eclipse.emf.ec

  ore-2.15.0.jar org.eclipse.emf.ecore.xmi-2.15.0.jar jgridshift-core-1

  .3.jar GeographicLib-Java-1.49.jar gt-http-26.2.jar jts-core-1.18.2.j

  ar commons-text-1.6.jar commons-lang3-3.8.1.jar jackson-core-2.10.5.j

  ar jai_core-1.1.3.jar

Project-Version: 26.2

Git-Revision: 64c409b2a537142993932e706c3f9c6e9efa7529

Created-By: Apache Maven 3.6.3

Build-Jdk: 1.8.0_212

On 17-02-2022 21:13, Jody Garnett wrote:

Can you check some of the gt and gs jars please, we should be able to confirm:

jar xvf gt-wfs-26.2.jar META-INF

Or extract a class file and use javap -v <class file> | grep major

this wil tell you the class level, but not the compiler version.
In fact both are the same:

javap -v -classpath /tmp/___oigs/download/geoserver-2.20.2-war/WEB-INF/lib/gt-main-26.2.jar org.geotools.data.PrjFileReader | grep version

   minor version: 0
   major version: 52

javap -v -classpath /tmp/___oigs/oigs-server/WEB-INF/lib/gt-main-26.2.jar org.geotools.data.PrjFileReader | grep version

   minor version: 0
   major version: 52

checking for the problematic method call

javap -v -classpath /tmp/___oigs/download/geoserver-2.20.2-war/WEB-INF/lib/gt-main-26.2.jar org.geotools.data.PrjFileReader | grep ByteBuffer.limit

    #12 = Methodref #107.#109 // java/nio/ByteBuffer.limit:(I)Ljava/nio/Buffer;
         53: invokevirtual #12 // Method java/nio/ByteBuffer.limit:(I)Ljava/nio/Buffer;

javap -v -classpath /tmp/___oigs/oigs-server/WEB-INF/lib/gt-main-26.2.jar org.geotools.data.PrjFileReader | grep ByteBuffer.limit

    #12 = Methodref #107.#109 // java/nio/ByteBuffer.limit:(I)Ljava/nio/Buffer;
         53: invokevirtual #12 // Method java/nio/ByteBuffer.limit:(I)Ljava/nio/Buffer;

there seems nothing wrong with that.

As I said, this is server doesn't do WFS normally and it's built into a suite of legacy webapps with a fairly specific config using SQL Server, which was the reason for taking a quick peak trying to repro some old GS Jira's against mssql.
Since nobody else complained so far, I'm blaming our setup.

anyway thanks for talking the time to read this far, back to paid work

Mark

--
Jody Garnett

On Thu, 17 Feb 2022 at 12:05, Jody Garnett <jody.garnett@anonymised.com <mailto:jody.garnett@anonymised.com>> wrote:

    That is not good, I expect it would be geotools made with Java 11 if
    you are seeing that problem.

    Actually I may have been made with Java 11 as Jenkins was updated by
    Torben from Java 8 to Java 11; and if the release job did not
    explicitly ask for a JDK to use it may end up with the "system default".

    Checking geotools-release:
    - parameters:
    https://build.geoserver.org/view/release/job/geotools-release/52/parameters/
    <https://build.geoserver.org/view/release/job/geotools-release/52/parameters/&gt;
    - logs:
    https://build.geoserver.org/view/release/job/geotools-release/52/consoleFull
    <https://build.geoserver.org/view/release/job/geotools-release/52/consoleFull&gt;

    maven/java settings:
      [1mApache Maven 3.6.3 [m
    Maven home: /usr/share/maven
    Java version: 1.8.0_212, vendor: AdoptOpenJDK, runtime: /var/lib/jenkins/tools/hudson.model.JDK/OpenJDK_8u212/jdk8u212-b03/jre
    Default locale: en_US, platform encoding: UTF-8
    OS name: "linux", version: "5.4.0-91-generic", arch: "amd64", family: "unix"

    Checking geotools-release-publish:
    - parameters:
    https://build.geoserver.org/view/release/job/geotools-release-publish/37/parameters/
    <https://build.geoserver.org/view/release/job/geotools-release-publish/37/parameters/&gt;
    - logs:

    maven/java settings:https://build.geoserver.org/view/release/job/geotools-release-publish/37/consoleFull
    + mvn -version
      [1mApache Maven 3.6.3 [m
    Maven home: /usr/share/maven
    Java version: 1.8.0_212, vendor: AdoptOpenJDK, runtime: /var/lib/jenkins/tools/hudson.model.JDK/OpenJDK_8u212/jdk8u212-b03/jre
    Default locale: en_US, platform encoding: UTF-8
    OS name: "linux", version: "5.4.0-91-generic", arch: "amd64", family: "unix"
    + echo MAVEN_FLAGS=

    Checking geoserver-release:
    https://build.geoserver.org/view/release/job/geoserver-release/41/consoleFull
    <https://build.geoserver.org/view/release/job/geoserver-release/41/consoleFull&gt;
    - logs:

    maven/java settings:
      [1mApache Maven 3.6.3 [m
    Maven home: /usr/share/maven
    Java version: 1.8.0_212, vendor: AdoptOpenJDK, runtime: /var/lib/jenkins/tools/hudson.model.JDK/OpenJDK_8u212/jdk8u212-b03/jre
    Default locale: en_US, platform encoding: UTF-8
    OS name: "linux", version: "5.4.0-91-generic", arch: "amd64", family: "unix"

    checking geoserver-release-publish:
    - logs:
    https://build.geoserver.org/view/release/job/geoserver-release-publish/28/consoleFull
    <https://build.geoserver.org/view/release/job/geoserver-release-publish/28/consoleFull&gt;

    Unable to confirm what was used

    - configuration: Says OpenJDK8u212

    Cannot see Java 11 being used.
      --
    Jody Garnett

    On Thu, 17 Feb 2022 at 06:33, Mark Prins <mc.prins@anonymised.com
    <mailto:mc.prins@anonymised.com>> wrote:

        The reason I'm asking is I just tried to repro an old Jira and
        enabled
        WFS to download shapezip, but running into the dreaded
        ByteBuffer error
        while downloading.

        this is:

        Versie 2.20.2
        Revisie 1ef0697b8485d4ef9c760ad410b8d049725e7a66
        Datum 24-Jan-2022 00:05
        GeoTools 26.2 (rev 64c409b2a537142993932e706c3f9c6e9efa7529)
        GeoWebCache 1.20.1 (rev
        1.20.x/68f4e6bb663682ab9c8c2ccd0bb2a7dd7ad5d685)

        on
        up2date Ubuntu 18.04.6 LTS

        with

        Java Private Build: 1.8.0_312 (OpenJDK 64-Bit Server VM)

        This server normally has WFS turned off, and in general we tend
        to run
        on Java 11..

        2022-02-17 15:13:01,407 ERROR [geoserver.ows] -
        java.lang.NoSuchMethodError:
        java.nio.ByteBuffer.limit(I)Ljava/nio/ByteBuffer;
          at
        org.geotools.data.PrjFileReader.<init>(PrjFileReader.java:84)
          at
        org.geotools.data.PrjFileReader.<init>(PrjFileReader.java:64)
          at
        org.geotools.data.shapefile.ShapefileSetManager.openPrjReader(ShapefileSetManager.java:152)
          at
        org.geotools.data.shapefile.ShapefileFeatureSource.readAttributes(ShapefileFeatureSource.java:499)
          at
        org.geotools.data.shapefile.ShapefileFeatureSource.buildFeatureType(ShapefileFeatureSource.java:454)
          at
        org.geotools.data.shapefile.ShapefileFeatureStore.buildFeatureType(ShapefileFeatureStore.java:142)
          at
        org.geotools.data.store.ContentFeatureSource.getAbsoluteSchema(ContentFeatureSource.java:338)
          at
        org.geotools.data.store.ContentFeatureSource.getSchema(ContentFeatureSource.java:307)
          at
        org.geotools.data.store.ContentFeatureStore.getWriter(ContentFeatureStore.java:116)
          at
        org.geotools.data.store.ContentDataStore.getFeatureWriter(ContentDataStore.java:381)
          at
        org.geotools.data.store.ContentDataStore.getFeatureWriter(ContentDataStore.java:412)
          at
        org.geotools.data.shapefile.ShapefileDumper$StoreWriter.createStoreAndWriter(ShapefileDumper.java:92)
          at
        org.geotools.data.shapefile.ShapefileDumper$StoreWriter.<init>(ShapefileDumper.java:86)
          at
        org.geotools.data.shapefile.ShapefileDumper.getStoreWriter(ShapefileDumper.java:460)
          at
        org.geotools.data.shapefile.ShapefileDumper.getStoreWriter(ShapefileDumper.java:420)
          at
        org.geotools.data.shapefile.ShapefileDumper.dump(ShapefileDumper.java:241)
          at
        org.geotools.data.shapefile.ShapefileDumper.dump(ShapefileDumper.java:185)

        _______________________________________________
        Geoserver-devel mailing list
        Geoserver-devel@lists.sourceforge.net
        <mailto:Geoserver-devel@lists.sourceforge.net>
        https://lists.sourceforge.net/lists/listinfo/geoserver-devel
        <https://lists.sourceforge.net/lists/listinfo/geoserver-devel&gt;

Today’s build of 25.5 seems to have been built with 1.8.0_212. I’ll keep an eye out as I proceed

Ian

···

Ian Turton

You are also welcome to re-run the geotools and geoserver release jobs; it should be configured for java 8 now.

Note a release of 22.x is scheduled for next week (pending a PR5677). Will that be sufficient for your upgrade?

···


Jody Garnett

Thanks Ian, … did you check the jar manifest, or just the logs?

···


Jody Garnett

I looked in the manifest, so all should be good

Ian

···

Ian Turton

Mark I have re-run the geotools-release job, and confirmed the artifacts were built with “Build-Jdk: 1.8.0_212”. Running geotools-release-publish now.

When things settle down we can update the geoserver release in place; I do not think a new release number is needed here as this was just a mistake in the build environment.

···


Jody Garnett