Opened 2 years ago

Closed 2 years ago

#2387 closed defect (fixed)

22.04 tomcat9 with openjdk8 JSP compilation error

Reported by: kalxas Owned by: kalxas
Priority: major Milestone: OSGeoLive15.0
Component: OSGeoLive Keywords: java8
Cc: osgeolive@…

Description

Change History (6)

comment:1 by kalxas, 2 years ago

I have tried to compile tomcat9 with Java8 and I got this error:

setup-bnd:

compile-prepare:
     [copy] Copying 1 file to /<<PKGBUILDDIR>>/java/org/apache/catalina/startup
     [copy] Copying 1 file to /<<PKGBUILDDIR>>/webapps/docs

download-validate:

validate:

compile:
    [javac] Compiling 1778 source files to /<<PKGBUILDDIR>>/output/classes
    [javac] Support for javac --release has been added in Java9 ignoring it
    [javac] /<<PKGBUILDDIR>>/java/org/apache/jasper/compiler/JDTCompiler.java:40: error: cannot access IProblem
    [javac] import org.eclipse.jdt.core.compiler.IProblem;
    [javac]                                     ^
    [javac]   bad class file: /usr/share/java/eclipse-jdt-core.jar(org/eclipse/jdt/core/compiler/IProblem.class)
    [javac]     class file has wrong version 55.0, should be 52.0
    [javac]     Please remove or make sure it appears in the correct subdirectory of the classpath.

BUILD FAILED
/<<PKGBUILDDIR>>/build.xml:978: Compile failed; see the compiler error output for details.

Total time: 2 seconds
dh_auto_build: error: ant -propertyfile ./debian/ant.properties -Duser.name debian -Ddistribution.name=Ubuntu embed-jars deploy returned exit code 1
make[1]: *** [debian/rules:11: override_dh_auto_build] Error 25
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:8: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
--------------------------------------------------------------------------------
Build finished at 2022-07-30T08:21:28Z

comment:2 by kalxas, 2 years ago

Looks like eclipse-jdt-core is Java 11 only:

http://archive.ubuntu.com/ubuntu/pool/universe/e/eclipse-jdt-core/eclipse-jdt-core_4.21-1.debian.tar.xz

Source: eclipse-jdt-core
Section: java
Priority: optional
Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>
Uploaders: Emmanuel Bourg <ebourg@apache.org>
Build-Depends:
 debhelper-compat (= 13),
 default-jdk (>= 2:1.11),
 ant,
 libeclipse-core-filesystem-java,
 libeclipse-core-contenttype-java,
 libeclipse-core-jobs-java,
 libeclipse-core-runtime-java,
 libeclipse-core-resources-java,
 libeclipse-text-java,
 libeclipse-osgi-java,
 libequinox-app-java,
 libequinox-common-java,
 libequinox-preferences-java,
 libequinox-registry-java,
 eclipse-debian-helper

comment:3 by kalxas, 2 years ago

Tried to build with Java 8 and obviously it failed:

dh build --buildsystem=eclipse_bundles
   dh_update_autotools_config -O--buildsystem=eclipse_bundles
   dh_autoreconf -O--buildsystem=eclipse_bundles
   dh_auto_configure -O--buildsystem=eclipse_bundles
   dh_auto_build -O--buildsystem=eclipse_bundles
	ant -Dbasedir . -Dbundledir . -f debian/build.xml org.eclipse.jdt.annotation org.eclipse.jdt.apt.core org.eclipse.jdt.apt.pluggable.core org.eclipse.jdt.compiler.apt org.eclipse.jdt.compiler.tool org.eclipse.jdt.core -Duser.name debian
Buildfile: /<<PKGBUILDDIR>>/debian/build.xml

org.eclipse.jdt.annotation:
     [echo] Building bundle '' (org.eclipse.jdt.annotation:2.2.600)
    [mkdir] Created dir: /<<PKGBUILDDIR>>/org.eclipse.jdt.annotation/target/classes
    [touch] Creating /<<PKGBUILDDIR>>/org.eclipse.jdt.annotation/target/dependencies
    [mkdir] Created dir: /<<PKGBUILDDIR>>/org.eclipse.jdt.annotation/target/sources
     [copy] Copying 6 files to /<<PKGBUILDDIR>>/org.eclipse.jdt.annotation/target/sources
    [javac] Compiling 6 source files to /<<PKGBUILDDIR>>/org.eclipse.jdt.annotation/target/classes
    [javac] Support for javac --release has been added in Java9 ignoring it
    [javac] Creating empty /<<PKGBUILDDIR>>/org.eclipse.jdt.annotation/target/classes/org/eclipse/jdt/annotation/package-info.class
     [copy] Copying 9 files to /<<PKGBUILDDIR>>/org.eclipse.jdt.annotation/target/classes
      [jar] Building jar: /<<PKGBUILDDIR>>/org.eclipse.jdt.annotation/target/org.eclipse.jdt.annotation.jar
     [copy] Copying 1 file to /<<PKGBUILDDIR>>/org.eclipse.jdt.annotation/target

org.eclipse.jdt.core:
     [echo] Building bundle 'Java Development Tools Core' (org.eclipse.jdt.core:3.27.0)
    [mkdir] Created dir: /<<PKGBUILDDIR>>/org.eclipse.jdt.core/target/classes
    [touch] Creating /<<PKGBUILDDIR>>/org.eclipse.jdt.core/target/dependencies
    [mkdir] Created dir: /<<PKGBUILDDIR>>/org.eclipse.jdt.core/target/sources
     [copy] Copying 1496 files to /<<PKGBUILDDIR>>/org.eclipse.jdt.core/target/sources
    [javac] Compiling 1496 source files to /<<PKGBUILDDIR>>/org.eclipse.jdt.core/target/classes
    [javac] Support for javac --release has been added in Java9 ignoring it
    [javac] /<<PKGBUILDDIR>>/org.eclipse.jdt.core/target/sources/org/eclipse/jdt/core/IBuffer.java:16: error: cannot access IResource
    [javac] import org.eclipse.core.resources.IResource;
    [javac]                                  ^
    [javac]   bad class file: /usr/share/java/eclipse-core-resources.jar(org/eclipse/core/resources/IResource.class)
    [javac]     class file has wrong version 55.0, should be 52.0
    [javac]     Please remove or make sure it appears in the correct subdirectory of the classpath.

BUILD FAILED
/<<PKGBUILDDIR>>/debian/build.xml:72: The following error occurred while executing this line:
/usr/share/eclipse-debian-helper/build-eclipse-bundle.xml:64: Compile failed; see the compiler error output for details.

Total time: 2 seconds
dh_auto_build: error: ant -Dbasedir . -Dbundledir . -f debian/build.xml org.eclipse.jdt.annotation org.eclipse.jdt.apt.core org.eclipse.jdt.apt.pluggable.core org.eclipse.jdt.compiler.apt org.eclipse.jdt.compiler.tool org.eclipse.jdt.core -Duser.name debian returned exit code 1
make: *** [debian/rules:6: build] Error 25
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
--------------------------------------------------------------------------------
Build finished at 2022-07-30T08:29:34Z

comment:4 by kalxas, 2 years ago

Owner: changed from osgeolive@… to kalxas
Priority: blockercritical

Workaround from Ubuntu issue applied:

https://github.com/OSGeo/OSGeoLive/commit/43773534c829b4ab14949b051e038672314e5906

I was able to start 52N SOS after applying the above patch.

comment:5 by kalxas, 2 years ago

Priority: criticalmajor
Status: newassigned

comment:6 by kalxas, 2 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.