#22990 closed defect (fixed)
jakarta.json.JsonException: Provider org.glassfish.json.JsonProviderImpl could not be instantiated: java.lang.ClassCastException: class org.glassfish.json.JsonProviderImpl cannot be cast to class jakarta.json.spi.JsonProvider (org.glassfish.json.JsonProviderImpl and jakarta.json.spi.JsonProvider are in unnamed module of loader 'app')
Reported by: | sebastic | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 23.07 |
Component: | Core | Version: | tested |
Keywords: | Cc: |
Description (last modified by )
The Debian package throws and exception at startup after the update to r18746:
Revision:18746 Is-Local-Build:false Build-Date:2023-06-06 03:52:38 Debian-Release:0.0.svn18746+dfsg-1~exp1 Build-Name:Debian Identification: JOSM/1.5 (18746 Debian en) Linux Debian GNU/Linux 12 (bookworm) Memory Usage: 160 MB / 3918 MB (64 MB allocated, but free) Java version: 17.0.6+10-Debian-1, Debian, OpenJDK 64-Bit Server VM Look and Feel: javax.swing.plaf.metal.MetalLookAndFeel Screen: :0.0 1920×1200 (scaling 1.00×1.00) Maximum Screen Size: 1920×1200 Best cursor sizes: 16×16→16×16, 32×32→32×32 Environment variable LANG: en_US.UTF-8 System property file.encoding: UTF-8 System property sun.jnu.encoding: UTF-8 Locale info: en_US Numbers with default locale: 1234567890 -> 1234567890 Desktop environment: KDE Java package: openjdk-17-jre:amd64-17.0.6+10-1 Java ATK Wrapper package: libatk-wrapper-java:all-0.40.0-3 libcommons-compress-java: libcommons-compress-java:all-1.22-1 libcommons-logging-java: libcommons-logging-java:all-1.2-3 fonts-noto: fonts-noto:all-20201225-1 liboauth-signpost-java: liboauth-signpost-java:all-1.2.1.2-3 VM arguments: [--module-path=/usr/share/openjfx/lib, --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web, -Djosm.restart=true, -Djava.net.useSystemProxies=true, --add-exports=java.<user.name>e/sun.security.action=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED] Plugins: + AddrInterpolation + DirectUpload + FixAddresses + HouseNumberTaggingTool + OpeningHoursEditor + RoadSigns + SimplifyArea + apache-commons + buildings_tools + editgpx + ejml + geotools + jackson + jaxb (35952) + jts + opendata + pbf + poly + reverter + terracer + todo + turnlanes + turnrestrictions + utilsplugin2 + waydownloader + wikipedia Tagging presets: + /usr/share/josm/data/defaultpresets.xml Map paint styles: - /usr/share/josm/styles/standard/potlatch2.mapcss - <josm.pref>/plugins/ods-bag/Ods-bag-style-0.6.8.mapcss Last errors/warnings: - 00016.150 E: Handled by bug report queue: jakarta.json.JsonException: Provider org.glassfish.json.JsonProviderImpl could not be instantiated: java.lang.ClassCastException: class org.glassfish.json.JsonProviderImpl cannot be cast to class jakarta.json.spi.JsonProvider (org.glassfish.json.JsonProviderImpl and jakarta.json.spi.JsonProvider are in unnamed module of loader 'app'). Cause: java.lang.ClassCastException: class org.glassfish.json.JsonProviderImpl cannot be cast to class jakarta.json.spi.JsonProvider (org.glassfish.json.JsonProviderImpl and jakarta.json.spi.JsonProvider are in unnamed module of loader 'app') === REPORTED CRASH DATA === BugReportExceptionHandler#handleException: No data collected. Warning issued by: BugReportExceptionHandler#handleException === STACK TRACE === Thread: main (1) jakarta.json.JsonException: Provider org.glassfish.json.JsonProviderImpl could not be instantiated: java.lang.ClassCastException: class org.glassfish.json.JsonProviderImpl cannot be cast to class jakarta.json.spi.JsonProvider (org.glassfish.json.JsonProviderImpl and jakarta.json.spi.JsonProvider are in unnamed module of loader 'app') at jakarta.json.spi.JsonProvider.provider(JsonProvider.java:89) at jakarta.json.Json.createParser(Json.java:85) at org.openstreetmap.josm.tools.Territories.initializeExternalData(Territories.java:196) at org.openstreetmap.josm.tools.Territories.initializeExternalData(Territories.java:190) at org.openstreetmap.josm.tools.Territories.initialize(Territories.java:124) at org.openstreetmap.josm.gui.MainInitialization.lambda$beforeInitializationTasks$4(MainInitialization.java:85) at org.openstreetmap.josm.spi.lifecycle.InitializationTask.call(InitializationTask.java:33) at org.openstreetmap.josm.spi.lifecycle.Lifecycle.runInitializationTasks(Lifecycle.java:103) at org.openstreetmap.josm.spi.lifecycle.Lifecycle.initialize(Lifecycle.java:71) at org.openstreetmap.josm.gui.MainApplication.mainJOSM(MainApplication.java:959) at org.openstreetmap.josm.gui.MainApplication$3.processArguments(MainApplication.java:277) at org.openstreetmap.josm.gui.MainApplication.main(MainApplication.java:742) Caused by: java.lang.ClassCastException: class org.glassfish.json.JsonProviderImpl cannot be cast to class jakarta.json.spi.JsonProvider (org.glassfish.json.JsonProviderImpl and jakarta.json.spi.JsonProvider are in unnamed module of loader 'app') at jakarta.json.spi.JsonProvider.provider(JsonProvider.java:84) ... 11 more
Stack Overflow suggests this is be caused by javax.json being on the classpath along with jakarta.json. GeoJSONImporter.java needs to be updated before javax.json can be removed from the classpath:
$ grep javax.json src/org/openstreetmap/ -r src/org/openstreetmap/josm/gui/io/importexport/GeoJSONImporter.java:import javax.json.JsonException;
Patching this file to use jakarta.json.JsonException and removing the javax/json sources results in a build failure because org.glassfish.json also uses javax.json:
[...] [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonArrayBuilderImpl.java:63: error: cannot find symbol [javac] class JsonArrayBuilderImpl implements JsonArrayBuilder { [javac] ^ [javac] symbol: class JsonArrayBuilder [...] [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonArrayBuilderImpl.java:45: error: package javax.json does not exist [javac] import javax.json.*; [javac] ^ [...] [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonBuilderFactoryImpl.java:46: error: package javax.json does not exist [javac] import javax.json.JsonObject; [javac] ^ [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonBuilderFactoryImpl.java:47: error: package javax.json does not exist [javac] import javax.json.JsonArray; [javac] ^ [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonBuilderFactoryImpl.java:48: error: package javax.json does not exist [javac] import javax.json.JsonArrayBuilder; [javac] ^ [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonBuilderFactoryImpl.java:49: error: package javax.json does not exist [javac] import javax.json.JsonBuilderFactory; [javac] ^ [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonBuilderFactoryImpl.java:50: error: package javax.json does not exist [javac] import javax.json.JsonObjectBuilder; [javac] ^ [...] [javac] Note: /build/josm-0.0.svn18746+dfsg/src/oauth/signpost/AbstractOAuthProvider.java uses or overrides a deprecated API. [javac] Note: Recompile with -Xlint:deprecation for details. [javac] Note: Some input files use unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. [javac] 100 errors [javac] only showing the first 100 errors, of 1179 total; use -Xmaxerrs if you would like to see more BUILD FAILED /build/josm-0.0.svn18746+dfsg/build.xml:242: Compile failed; see the compiler error output for details. at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1373) at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:1092) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299) at jdk.internal.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99) at org.apache.tools.ant.Task.perform(Task.java:350) at org.apache.tools.ant.Target.execute(Target.java:449) at org.apache.tools.ant.Target.performTasks(Target.java:470) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1401) at org.apache.tools.ant.Project.executeTarget(Project.java:1374) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1264) at org.apache.tools.ant.Main.runBuild(Main.java:818) at org.apache.tools.ant.Main.startAnt(Main.java:223) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101) Total time: 11 seconds [...]
Reverting the changes from r18723 to use javax.json instead of jakarta.json resolves the exception at startup.
Attachments (0)
Change History (20)
comment:1 by , 18 months ago
Description: | modified (diff) |
---|
comment:2 by , 18 months ago
Description: | modified (diff) |
---|
follow-up: 5 comment:3 by , 18 months ago
follow-up: 6 comment:5 by , 18 months ago
Replying to taylor.smock:
We are using Parsson for the Jakarta EE implementation, so there should be no clashes.
The presence of org.glassfish:json is a problem, that currently needs to be removed along with javax.json.
https://mvnrepository.com/artifact/org.glassfish/javax.json notes:
Note: This artifact was moved to: org.glassfish » jakarta.json
Having two providers for org.glassfish.json.JsonProviderImpl is problematic, the removal of javax.json requires the removal of org.glassfish as its reverse dependency.
Removing both javax.json & org.glassfish sources results in a successful build, but that also throws an exception on startup:
Revision:18746 Is-Local-Build:false Build-Date:2023-06-06 15:24:21 Debian-Release:0.0.svn18746+dfsg-1~exp3 Build-Name:Debian Identification: JOSM/1.5 (18746 Debian en) Linux Debian GNU/Linux 12 (bookworm) Memory Usage: 130 MB / 3918 MB (72 MB allocated, but free) Java version: 17.0.6+10-Debian-1, Debian, OpenJDK 64-Bit Server VM Look and Feel: javax.swing.plaf.metal.MetalLookAndFeel Screen: :0.0 1920×1200 (scaling 1.00×1.00) Maximum Screen Size: 1920×1200 Best cursor sizes: 16×16→16×16, 32×32→32×32 Environment variable LANG: en_US.UTF-8 System property file.encoding: UTF-8 System property sun.jnu.encoding: UTF-8 Locale info: en_US Numbers with default locale: 1234567890 -> 1234567890 Desktop environment: KDE Java package: openjdk-17-jre:amd64-17.0.6+10-1 Java ATK Wrapper package: libatk-wrapper-java:all-0.40.0-3 libcommons-compress-java: libcommons-compress-java:all-1.22-1 libcommons-logging-java: libcommons-logging-java:all-1.2-3 fonts-noto: fonts-noto:all-20201225-1 liboauth-signpost-java: liboauth-signpost-java:all-1.2.1.2-3 VM arguments: [--module-path=/usr/share/openjfx/lib, --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web, -Djosm.restart=true, -Djava.net.useSystemProxies=true, --add-exports=java.<user.name>e/sun.security.action=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED] Plugins: + AddrInterpolation + DirectUpload + FixAddresses + HouseNumberTaggingTool + OpeningHoursEditor + RoadSigns + SimplifyArea + apache-commons + buildings_tools + editgpx + ejml + geotools + jackson + jaxb (35952) + jts + opendata + pbf + poly + reverter + terracer + todo + turnlanes + turnrestrictions + utilsplugin2 + waydownloader + wikipedia Tagging presets: + /usr/share/josm/data/defaultpresets.xml Map paint styles: - /usr/share/josm/styles/standard/potlatch2.mapcss - <josm.pref>/plugins/ods-bag/Ods-bag-style-0.6.8.mapcss Last errors/warnings: - 00006.266 E: Handled by bug report queue: jakarta.json.JsonException: Provider org.glassfish.json.JsonProviderImpl not found. Cause: java.lang.ClassNotFoundException: org.glassfish.json.JsonProviderImpl === REPORTED CRASH DATA === BugReportExceptionHandler#handleException: No data collected. Warning issued by: BugReportExceptionHandler#handleException === STACK TRACE === Thread: main (1) jakarta.json.JsonException: Provider org.glassfish.json.JsonProviderImpl not found at jakarta.json.spi.JsonProvider.provider(JsonProvider.java:86) at jakarta.json.Json.createParser(Json.java:85) at org.openstreetmap.josm.tools.Territories.initializeExternalData(Territories.java:196) at org.openstreetmap.josm.tools.Territories.initializeExternalData(Territories.java:190) at org.openstreetmap.josm.tools.Territories.initialize(Territories.java:124) at org.openstreetmap.josm.gui.MainInitialization.lambda$beforeInitializationTasks$4(MainInitialization.java:85) at org.openstreetmap.josm.spi.lifecycle.InitializationTask.call(InitializationTask.java:33) at org.openstreetmap.josm.spi.lifecycle.Lifecycle.runInitializationTasks(Lifecycle.java:103) at org.openstreetmap.josm.spi.lifecycle.Lifecycle.initialize(Lifecycle.java:71) at org.openstreetmap.josm.gui.MainApplication.mainJOSM(MainApplication.java:959) at org.openstreetmap.josm.gui.MainApplication$3.processArguments(MainApplication.java:277) at org.openstreetmap.josm.gui.MainApplication.main(MainApplication.java:742) Caused by: java.lang.ClassNotFoundException: org.glassfish.json.JsonProviderImpl at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:375) at jakarta.json.spi.JsonProvider.provider(JsonProvider.java:83) ... 11 more
The current org.glassfish version in JOSM is 1.1.4, the latest upstream release is 2.0.1. Updating to a newer version which doesn't require javax.json may be a solution.
The Debian package throws and exception at startup after the update to r18746
Is this the Debian package from the Debian project repositories, or the Debian package from JOSM's repositories? I suspect the former, since you work on the Debian project package.
The former as indicated by:
Debian-Release:0.0.svn18746+dfsg-1~exp1 Build-Name:Debian
If so, can you check and see if that behavior is present in the package from JOSM's repositories?
The package from the JOSM repo doesn't throw an exception at startup, because it doesn't build the dependencies from source like the package in Debian does.
follow-up: 7 comment:6 by , 18 months ago
The org.glassfish:javax.json:1.1.4
is the implementation for javax.json:javax.json-api:1.1.4
. Regardless, the dependencies have no common class files (except for javax.json and its org.glassfish implementation, which was last changed in 2020). I have no clue how you are building the dependencies, but I suspect something is going wrong. Maybe you are building the wrong versions?
Here are the source locations for the new dependencies:
jakarta.json:jakarta.json-api:2.0.2
: https://github.com/jakartaee/jsonp-api/tree/2.0.2-RELEASE (note: I bet you are building 2.0.0 or something) EDIT: You should be able to use 2.1.x if you want to. The only reason I didn't is that it requires Java 11.org.eclipse.parsson:parsson:1.1.1
: https://github.com/eclipse-ee4j/parsson/releases/tag/1.1.1 (looks like there is a 1.1.2 version I need to update to)
Here are the file lists for javax.json:javax.json-api:1.1.4
, org.glassfish:javax.json:1.1.4
, jakarta.json:jakarta.json-api:2.0.2
, and org.eclipse.parsson:parsson:1.1.1
(note: check {{{#!comment }}}
or previous):
comment:7 by , 18 months ago
Replying to taylor.smock:
I have no clue how you are building the dependencies, but I suspect something is going wrong. Maybe you are building the wrong versions?
We extract the sources from the JOSM source JAR:
These are built before JOSM:
The JOSM build does not exclude jakarta/json/**
like it does other dependencies, that may be an issue:
comment:8 by , 18 months ago
https://github.com/elastic/elasticsearch-java/issues/55 has details on how ElasticSearch dealt with the javax.json vs. jakarta.json issue.
follow-up: 10 comment:9 by , 18 months ago
Can you check and see if the built jar has the META-INF/services/jakarta.json.spi.JsonProvider
file (with the content org.eclipse.parsson.JsonProviderImpl
)?
EDIT: If that isn't present, then something is messed up with your build. It is in the JOSM source file. If it isn't present in the built jar, then the code will try to load org.glassfish.json.JsonProviderImpl
.
comment:10 by , 18 months ago
Replying to taylor.smock:
Can you check and see if the built jar has the
META-INF/services/jakarta.json.spi.JsonProvider
file (with the contentorg.eclipse.parsson.JsonProviderImpl
)?
It does not:
$ ls -l META-INF/services/ total 8 -rw-r--r-- 1 bas bas 62 Jun 6 17:41 java.text.spi.DecimalFormatSymbolsProvider -rw-r--r-- 1 bas bas 83 Jun 6 17:41 org.apache.commons.jcs3.log.LogFactory
For the JCS service we had to patch build.xml:
<jar destfile="${dist.jar}" basedir="${build.dir}" level="${clevel}"> <!-- add attribute excludes="**/*BZip2*,**/*Bzip2*" to create a non-bzip2 supporting jar --> <manifest> <attribute name="Main-class" value="org.openstreetmap.josm.gui.MainApplication"/> <attribute name="Main-Version" value="${version.entry.commit.revision} SVN"/> <attribute name="Main-Date" value="${version.entry.commit.date}"/> <attribute name="Permissions" value="all-permissions"/> <attribute name="Codebase" value="josm.openstreetmap.de"/> <attribute name="Application-Name" value="JOSM - Java OpenStreetMap Editor"/> <attribute name="Debian-Release" value="${debian.version}"/> <attribute name="Class-Path" value="${classpathprop}"/> <!-- Java 9 stuff. Entries are safely ignored by Java 8 --> <attribute name="Add-Exports" value="java.base/sun.security.action java.desktop/com.apple.eawt java.desktop/com.sun.imageio.spi java.desktop/com.sun.imageio.plugins.jpeg javafx.graphics/com.sun.javafx.application jdk.deploy/com.sun.deploy.config" /> <attribute name="Add-Opens" value="java.base/java.lang java.base/java.nio java.base/jdk.internal.loader java.base/jdk.internal.ref java.desktop/javax.imageio.spi java.desktop/javax.swing.text.html java.prefs/java.util.prefs" /> <!-- Indicate that this jar may have version specific classes. Only used in Java9+. --> <attribute name="Multi-Release" value="true"/> </manifest> <service type="org.apache.commons.jcs3.log.LogFactory"> <provider classname="org.apache.commons.jcs3.log.JulLogFactory"/> <provider classname="org.apache.commons.jcs3.log.Log4j2Factory"/> </service> </jar>
See: #19335
EDIT: If that isn't present, then something is messed up with your build. It is in the JOSM source file. If it isn't present in the built jar, then the code will try to load
org.glassfish.json.JsonProviderImpl
.
Adding the service causes a different exception at startup:
Revision:18746 Is-Local-Build:false Build-Date:2023-06-06 18:24:10 Debian-Release:0.0.svn18746+dfsg-1~exp3 Build-Name:Debian Identification: JOSM/1.5 (18746 Debian en) Linux Debian GNU/Linux 12 (bookworm) Memory Usage: 148 MB / 3918 MB (60 MB allocated, but free) Java version: 17.0.6+10-Debian-1, Debian, OpenJDK 64-Bit Server VM Look and Feel: javax.swing.plaf.metal.MetalLookAndFeel Screen: :0.0 1920×1200 (scaling 1.00×1.00) Maximum Screen Size: 1920×1200 Best cursor sizes: 16×16→16×16, 32×32→32×32 Environment variable LANG: en_US.UTF-8 System property file.encoding: UTF-8 System property sun.jnu.encoding: UTF-8 Locale info: en_US Numbers with default locale: 1234567890 -> 1234567890 Desktop environment: KDE Java package: openjdk-17-jre:amd64-17.0.6+10-1 Java ATK Wrapper package: libatk-wrapper-java:all-0.40.0-3 libcommons-compress-java: libcommons-compress-java:all-1.22-1 libcommons-logging-java: libcommons-logging-java:all-1.2-3 fonts-noto: fonts-noto:all-20201225-1 liboauth-signpost-java: liboauth-signpost-java:all-1.2.1.2-3 VM arguments: [--module-path=/usr/share/openjfx/lib, --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web, -Djosm.restart=true, -Djava.net.useSystemProxies=true, --add-exports=java.<user.name>e/sun.security.action=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED] Plugins: + AddrInterpolation + DirectUpload + FixAddresses + HouseNumberTaggingTool + OpeningHoursEditor + RoadSigns + SimplifyArea + apache-commons + buildings_tools + editgpx + ejml + geotools + jackson + jaxb (35952) + jts + opendata + pbf + poly + reverter + terracer + todo + turnlanes + turnrestrictions + utilsplugin2 + waydownloader + wikipedia Tagging presets: + /usr/share/josm/data/defaultpresets.xml Map paint styles: - /usr/share/josm/styles/standard/potlatch2.mapcss - <josm.pref>/plugins/ods-bag/Ods-bag-style-0.6.8.mapcss Last errors/warnings: - 00012.577 E: Handled by bug report queue: java.util.ServiceConfigurationError: jakarta.json.spi.JsonProvider: Provider org.eclipse.parsson.JsonProviderImpl not found === REPORTED CRASH DATA === BugReportExceptionHandler#handleException: No data collected. Warning issued by: BugReportExceptionHandler#handleException === STACK TRACE === Thread: main (1) java.util.ServiceConfigurationError: jakarta.json.spi.JsonProvider: Provider org.eclipse.parsson.JsonProviderImpl not found at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:593) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(ServiceLoader.java:1219) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1228) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1273) at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1309) at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1393) at jakarta.json.spi.JsonProvider.provider(JsonProvider.java:69) at jakarta.json.Json.createParser(Json.java:85) at org.openstreetmap.josm.tools.Territories.initializeExternalData(Territories.java:196) at org.openstreetmap.josm.tools.Territories.initializeExternalData(Territories.java:190) at org.openstreetmap.josm.tools.Territories.initialize(Territories.java:124) at org.openstreetmap.josm.gui.MainInitialization.lambda$beforeInitializationTasks$4(MainInitialization.java:85) at org.openstreetmap.josm.spi.lifecycle.InitializationTask.call(InitializationTask.java:33) at org.openstreetmap.josm.spi.lifecycle.Lifecycle.runInitializationTasks(Lifecycle.java:103) at org.openstreetmap.josm.spi.lifecycle.Lifecycle.initialize(Lifecycle.java:71) at org.openstreetmap.josm.gui.MainApplication.mainJOSM(MainApplication.java:959) at org.openstreetmap.josm.gui.MainApplication$3.processArguments(MainApplication.java:277) at org.openstreetmap.josm.gui.MainApplication.main(MainApplication.java:742)
Adding the org.eclipse sources causes the build to fail:
[...] [javac] Files to be compiled: [...] [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/EmptyArray.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/EmptyObject.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/Json.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/JsonArray.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/JsonArrayBuilder.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/JsonBuilderFactory.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/JsonException.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/JsonMergePatch.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/JsonNumber.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/JsonObject.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/JsonObjectBuilder.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/JsonPatch.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/JsonPatchBuilder.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/JsonPointer.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/JsonReader.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/JsonReaderFactory.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/JsonString.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/JsonStructure.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/JsonValue.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/JsonValueImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/JsonWriter.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/JsonWriterFactory.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/spi/JsonProvider.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/stream/JsonCollectors.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/stream/JsonGenerationException.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/stream/JsonGenerator.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/stream/JsonGeneratorFactory.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/stream/JsonLocation.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/stream/JsonParser.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/stream/JsonParserFactory.java [javac] /build/josm-0.0.svn18746+dfsg/src/jakarta/json/stream/JsonParsingException.java [...] [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/EmptyArray.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/EmptyObject.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/Json.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/JsonArray.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/JsonArrayBuilder.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/JsonBuilderFactory.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/JsonException.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/JsonMergePatch.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/JsonNumber.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/JsonObject.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/JsonObjectBuilder.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/JsonPatch.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/JsonPatchBuilder.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/JsonPointer.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/JsonReader.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/JsonReaderFactory.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/JsonString.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/JsonStructure.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/JsonValue.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/JsonValueImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/JsonWriter.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/JsonWriterFactory.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/spi/JsonProvider.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/stream/JsonCollectors.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/stream/JsonGenerationException.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/stream/JsonGenerator.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/stream/JsonGeneratorFactory.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/stream/JsonLocation.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/stream/JsonParser.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/stream/JsonParserFactory.java [javac] /build/josm-0.0.svn18746+dfsg/src/javax/json/stream/JsonParsingException.java [...] [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/BufferPoolImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonArrayBuilderImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonBuilderFactoryImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonGeneratorFactoryImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonGeneratorImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonLocationImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonMergePatchImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonMessages.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonNumberImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonObjectBuilderImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonParserFactoryImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonParserImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonPatchBuilderImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonPatchImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonPointerImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonPrettyGeneratorImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonProviderImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonReaderFactoryImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonReaderImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonStringImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonStructureParser.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonTokenizer.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonUtil.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonWriterFactoryImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonWriterImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/MapUtil.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/NodeReference.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/UnicodeDetectingInputStream.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/api/BufferPool.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/api/JsonConfig.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/BufferPoolImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonArrayBuilderImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonBuilderFactoryImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonGeneratorFactoryImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonGeneratorImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonLocationImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonMergePatchImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonMessages.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonNumberImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonObjectBuilderImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonParserFactoryImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonParserImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonPatchBuilderImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonPatchImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonPointerImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonPrettyGeneratorImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonProviderImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonReaderFactoryImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonReaderImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonStringImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonStructureParser.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonTokenizer.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonUtil.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonWriterFactoryImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/JsonWriterImpl.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/MapUtil.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/NodeReference.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/UnicodeDetectingInputStream.java [javac] /build/josm-0.0.svn18746+dfsg/src/org/glassfish/json/api/BufferPool.java [...] [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonObjectBuilderImpl.java:33: error: package jakarta.json.JsonConfig does not exist [javac] import jakarta.json.JsonConfig.KeyStrategy; [javac] ^ [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonObjectBuilderImpl.java:400: error: cannot find symbol [javac] private final KeyStrategy property; [javac] ^ [javac] symbol: class KeyStrategy [javac] location: class DuplicateStrategy [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonObjectBuilderImpl.java:402: error: cannot find symbol [javac] private DuplicateStrategy(KeyStrategy property) { [javac] ^ [javac] symbol: class KeyStrategy [javac] location: class DuplicateStrategy [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonObjectBuilderImpl.java:59: error: cannot find symbol [javac] this.duplicateStrategy = DuplicateStrategy.strategyFromProperty(config.get(jakarta.json.JsonConfig.KEY_STRATEGY), rejectDuplicateKeys); [javac] ^ [javac] symbol: class JsonConfig [javac] location: package jakarta.json [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonObjectBuilderImpl.java:70: error: cannot find symbol [javac] this.duplicateStrategy = DuplicateStrategy.strategyFromProperty(config.get(jakarta.json.JsonConfig.KEY_STRATEGY), rejectDuplicateKeys); [javac] ^ [javac] symbol: class JsonConfig [javac] location: package jakarta.json [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonObjectBuilderImpl.java:81: error: cannot find symbol [javac] this.duplicateStrategy = DuplicateStrategy.strategyFromProperty(config.get(jakarta.json.JsonConfig.KEY_STRATEGY), rejectDuplicateKeys); [javac] ^ [javac] symbol: class JsonConfig [javac] location: package jakarta.json [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonObjectBuilderImpl.java:373: error: cannot find symbol [javac] NONE(KeyStrategy.NONE) { [javac] ^ [javac] symbol: variable KeyStrategy [javac] location: class DuplicateStrategy [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonObjectBuilderImpl.java:383: error: cannot find symbol [javac] FIRST(KeyStrategy.FIRST) { [javac] ^ [javac] symbol: variable KeyStrategy [javac] location: class DuplicateStrategy [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonObjectBuilderImpl.java:393: error: cannot find symbol [javac] LAST(KeyStrategy.LAST) { [javac] ^ [javac] symbol: variable KeyStrategy [javac] location: class DuplicateStrategy [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonParserImpl.java:385: error: method does not override or implement a method from a supertype [javac] @Override [javac] ^ [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonProviderImpl.java:161: error: cannot find symbol [javac] addKnowProperty(providerConfig, config, jakarta.json.JsonConfig.KEY_STRATEGY); [javac] ^ [javac] symbol: class JsonConfig [javac] location: package jakarta.json [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonProviderImpl.java:187: error: name clash: createObjectBuilder(Map<String,?>) in JsonProviderImpl and createObjectBuilder(Map<String,Object>) in JsonProvider have the same erasure, yet neither overrides the other [javac] public JsonObjectBuilder createObjectBuilder(Map<String, ?> map) { [javac] ^ [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonProviderImpl.java:186: error: method does not override or implement a method from a supertype [javac] @Override [javac] ^ [javac] /build/josm-0.0.svn18746+dfsg/src/org/eclipse/parsson/JsonProviderImpl.java:284: error: method does not override or implement a method from a supertype [javac] @Override [javac] ^ [javac] Note: Some input files use or override a deprecated API. [javac] Note: Recompile with -Xlint:deprecation for details. [javac] Note: Some input files use unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. [javac] 14 errors BUILD FAILED /build/josm-0.0.svn18746+dfsg/build.xml:247: Compile failed; see the compiler error output for details. at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1373) at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:1092) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299) at jdk.internal.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99) at org.apache.tools.ant.Task.perform(Task.java:350) at org.apache.tools.ant.Target.execute(Target.java:449) at org.apache.tools.ant.Target.performTasks(Target.java:470) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1401) at org.apache.tools.ant.Project.executeTarget(Project.java:1374) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1264) at org.apache.tools.ant.Main.runBuild(Main.java:818) at org.apache.tools.ant.Main.startAnt(Main.java:223) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101) Total time: 12 seconds
The JsonConfig package is indeed missing:
$ grep JsonConfig src/jakarta/json/ -rc src/jakarta/json/spi/package-info.java:0 src/jakarta/json/spi/JsonProvider.java:0 src/jakarta/json/JsonPatchBuilder.java:0 src/jakarta/json/JsonReader.java:0 src/jakarta/json/JsonNumber.java:0 src/jakarta/json/JsonArray.java:0 src/jakarta/json/JsonValue.java:0 src/jakarta/json/JsonWriter.java:0 src/jakarta/json/JsonArrayBuilder.java:0 src/jakarta/json/JsonObject.java:0 src/jakarta/json/package-info.java:0 src/jakarta/json/JsonValueImpl.java:0 src/jakarta/json/JsonObjectBuilder.java:0 src/jakarta/json/EmptyArray.java:0 src/jakarta/json/JsonMergePatch.java:0 src/jakarta/json/EmptyObject.java:0 src/jakarta/json/JsonStructure.java:0 src/jakarta/json/Json.java:0 src/jakarta/json/JsonBuilderFactory.java:0 src/jakarta/json/JsonPointer.java:0 src/jakarta/json/JsonReaderFactory.java:0 src/jakarta/json/JsonPatch.java:0 src/jakarta/json/stream/JsonGeneratorFactory.java:0 src/jakarta/json/stream/JsonGenerator.java:0 src/jakarta/json/stream/JsonCollectors.java:0 src/jakarta/json/stream/package-info.java:0 src/jakarta/json/stream/JsonLocation.java:0 src/jakarta/json/stream/JsonParsingException.java:0 src/jakarta/json/stream/JsonParser.java:0 src/jakarta/json/stream/JsonGenerationException.java:0 src/jakarta/json/stream/JsonParserFactory.java:0 src/jakarta/json/JsonString.java:0 src/jakarta/json/JsonException.java:0 src/jakarta/json/JsonWriterFactory.java:0
JsonConfig was added in 2.1.0 according to tags associated with the commit.
jakarta.json in JOSM is 2.0.2.
Updating the jakarta.json sources to 2.1.2 resolves the build failure, and the exception at startup.
Beside the JsonConfig change, jakarta.json 2.1.2 also includes this change:
private static final String DEFAULT_PROVIDER - = "org.glassfish.json.JsonProviderImpl"; + = "org.eclipse.parsson.JsonProviderImpl";
follow-up: 12 comment:11 by , 18 months ago
Updating the jakarta.json sources to 2.1.2 resolves the build failure, and the exception at startup.
Docs indicate that Jakarta Json 2.1.x is Java 11+ only. But yes, I know about that change in Jakarta Json 2.1.x (which is why it isn't used in JOSM core -- we still support Java 8). It isn't necessary, so long as the service file exists.
java.util.ServiceConfigurationError: jakarta.json.spi.JsonProvider: Provider org.eclipse.parsson.JsonProviderImpl not found
It sounds like parsson
wasn't built/included in that jar file. You've probably deleted that jar file, but if not, you can try running unzip -l ${JOSM.JAR} org/eclipse/parsson/JsonProviderImpl.class
.
src/org/eclipse/parsson/JsonObjectBuilderImpl.java:33: error: package jakarta.json.JsonConfig does not exist
I bet this is an ordering issue (as in jakarta.json.JsonConfig
isn't built before org.eclipse.parsson.JsonObjectBuilderImpl
).
Are jakarta.json
and an implementation of jakarta.json
already supplied via debian packages? Can you reuse those, instead of rebuilding them?
comment:12 by , 18 months ago
Replying to taylor.smock:
Updating the jakarta.json sources to 2.1.2 resolves the build failure, and the exception at startup.
Docs indicate that Jakarta Json 2.1.x is Java 11+ only. But yes, I know about that change in Jakarta Json 2.1.x (which is why it isn't used in JOSM core -- we still support Java 8). It isn't necessary, so long as the service file exists.
The versions of jakarta.json and the org.eclipse have a mismatch, as building org.eclipse requires jakarta.json >= 2.1.0 which provides JsonConfig.
java.util.ServiceConfigurationError: jakarta.json.spi.JsonProvider: Provider org.eclipse.parsson.JsonProviderImpl not found
It sounds like
parsson
wasn't built/included in that jar file. You've probably deleted that jar file, but if not, you can try runningunzip -l ${JOSM.JAR} org/eclipse/parsson/JsonProviderImpl.class
.
Parsson wasn't built then indeed, when its sources from josm-sources.jar were added it caused a build failure as mentioned because it requires jakarta.json.JsonConfig.
src/org/eclipse/parsson/JsonObjectBuilderImpl.java:33: error: package jakarta.json.JsonConfig does not exist
I bet this is an ordering issue (as in
jakarta.json.JsonConfig
isn't built beforeorg.eclipse.parsson.JsonObjectBuilderImpl
).
It's not an ordering issue, jakarta.json.JsonConfig was introduced in version 2.1.0 whereas the version in JOSM is 2.0.2.
org.eclipse.parsson needs to be downgraded to a version which supports jakarta.json 2.0.2, or jakarta.json needs to be upgraded to satisfy the org.eclipse.parsson 1.1.1 requirements.
Are
jakarta.json
and an implementation ofjakarta.json
already supplied via debian packages? Can you reuse those, instead of rebuilding them?
We are using the sources for almost all dependencies from josm-sources.jar to use the same versions as upstream JOSM build, dealing with different version of metadata-extractor has proven painful for example.
comment:13 by , 18 months ago
I've done a bit of debugging, and it looks like we are using jakarta.json 2.1.1 (I used ant extract-libraries
to check and see what was actually resolved).
It looks like we can just use jakarta.json 2.1.1; the only files that are compiled with a later version of Java are package-info.class
files, which we don't try to load.
comment:14 by , 18 months ago
The parsson 1.1.1 Maven build uses jakarta.json 2.1.1 (https://github.com/eclipse-ee4j/parsson/blob/1.1.1/pom.xml#L99)
The parsson 1.0.3 Maven build uses jakarta.json 2.0.2 (https://github.com/eclipse-ee4j/parsson/blob/1.0.3/pom.xml#L99)
Downgrading to parsson 1.0.3 may also be an option.
comment:15 by , 18 months ago
I'm going to update the ivy.xml
file to use 2.1.1. It is compiled (mostly) for Java 8. I have no clue why docs indicated that it required Java 11+.
comment:17 by , 17 months ago
Milestone: | 23.06 → 23.08 |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
The Debian package for JOSM 18772 fails to build:
[javac] /build/josm-0.0.svn18772+dfsg/src/org/eclipse/parsson/JsonObjectBuilderImpl.java:33: error: package jakarta.json.JsonConfig does not exist [javac] import jakarta.json.JsonConfig.KeyStrategy; [javac] ^ [javac] /build/josm-0.0.svn18772+dfsg/src/org/eclipse/parsson/JsonObjectBuilderImpl.java:400: error: cannot find symbol [javac] private final KeyStrategy property; [javac] ^ [javac] symbol: class KeyStrategy [javac] location: class DuplicateStrategy [javac] /build/josm-0.0.svn18772+dfsg/src/org/eclipse/parsson/JsonObjectBuilderImpl.java:402: error: cannot find symbol [javac] private DuplicateStrategy(KeyStrategy property) { [javac] ^ [javac] symbol: class KeyStrategy [javac] location: class DuplicateStrategy [javac] /build/josm-0.0.svn18772+dfsg/src/org/eclipse/parsson/JsonObjectBuilderImpl.java:59: error: cannot find symbol [javac] this.duplicateStrategy = DuplicateStrategy.strategyFromProperty(config.get(jakarta.json.JsonConfig.KEY_STRATEGY), rejectDuplicateKeys); [javac] ^ [javac] symbol: class JsonConfig [javac] location: package jakarta.json [javac] /build/josm-0.0.svn18772+dfsg/src/org/eclipse/parsson/JsonObjectBuilderImpl.java:70: error: cannot find symbol [javac] this.duplicateStrategy = DuplicateStrategy.strategyFromProperty(config.get(jakarta.json.JsonConfig.KEY_STRATEGY), rejectDuplicateKeys); [javac] ^ [javac] symbol: class JsonConfig [javac] location: package jakarta.json [javac] /build/josm-0.0.svn18772+dfsg/src/org/eclipse/parsson/JsonObjectBuilderImpl.java:81: error: cannot find symbol [javac] this.duplicateStrategy = DuplicateStrategy.strategyFromProperty(config.get(jakarta.json.JsonConfig.KEY_STRATEGY), rejectDuplicateKeys); [javac] ^ [javac] symbol: class JsonConfig [javac] location: package jakarta.json [javac] /build/josm-0.0.svn18772+dfsg/src/org/eclipse/parsson/JsonObjectBuilderImpl.java:373: error: cannot find symbol [javac] NONE(KeyStrategy.NONE) { [javac] ^ [javac] symbol: variable KeyStrategy [javac] location: class DuplicateStrategy [javac] /build/josm-0.0.svn18772+dfsg/src/org/eclipse/parsson/JsonObjectBuilderImpl.java:383: error: cannot find symbol [javac] FIRST(KeyStrategy.FIRST) { [javac] ^ [javac] symbol: variable KeyStrategy [javac] location: class DuplicateStrategy [javac] /build/josm-0.0.svn18772+dfsg/src/org/eclipse/parsson/JsonObjectBuilderImpl.java:393: error: cannot find symbol [javac] LAST(KeyStrategy.LAST) { [javac] ^ [javac] symbol: variable KeyStrategy [javac] location: class DuplicateStrategy [javac] /build/josm-0.0.svn18772+dfsg/src/org/eclipse/parsson/JsonParserImpl.java:385: error: method does not override or implement a method from a supertype [javac] @Override [javac] ^ [javac] /build/josm-0.0.svn18772+dfsg/src/org/eclipse/parsson/JsonProviderImpl.java:161: error: cannot find symbol [javac] addKnowProperty(providerConfig, config, jakarta.json.JsonConfig.KEY_STRATEGY); [javac] ^ [javac] symbol: class JsonConfig [javac] location: package jakarta.json [javac] /build/josm-0.0.svn18772+dfsg/src/org/eclipse/parsson/JsonProviderImpl.java:187: error: name clash: createObjectBuilder(Map<String,?>) in JsonProviderImpl and createObjectBuilder(Map<String,Object>) in JsonProvider have the same erasure, yet neither overrides the other [javac] public JsonObjectBuilder createObjectBuilder(Map<String, ?> map) { [javac] ^ [javac] /build/josm-0.0.svn18772+dfsg/src/org/eclipse/parsson/JsonProviderImpl.java:186: error: method does not override or implement a method from a supertype [javac] @Override [javac] ^ [javac] /build/josm-0.0.svn18772+dfsg/src/org/eclipse/parsson/JsonProviderImpl.java:284: error: method does not override or implement a method from a supertype [javac] @Override [javac] ^ [javac] Note: Some input files use or override a deprecated API. [javac] Note: Recompile with -Xlint:deprecation for details. [javac] Note: Some input files use unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. [javac] 14 errors
The versions in ivy.xml
are out of sync:
<dependency conf="api->default" org="jakarta.json" name="jakarta.json-api" rev="2.1.1"/> [...] <dependency conf="sources->sources" org="jakarta.json" name="jakarta.json-api" rev="2.0.2"/>
Patch:
--- ivy.xml.orig 2023-07-07 15:55:48.420781689 +0200 +++ ivy.xml 2023-07-07 15:55:58.400512648 +0200 @@ -42,7 +42,7 @@ <dependency conf="sources->sources" org="org.openstreetmap.jmapviewer" name="jmapviewer" rev="2.16"/> <dependency conf="sources->sources" org="javax.json" name="javax.json-api" rev="1.1.4"/> <dependency conf="sources->sources" org="org.glassfish" name="javax.json" rev="1.1.4"/> - <dependency conf="sources->sources" org="jakarta.json" name="jakarta.json-api" rev="2.0.2"/> + <dependency conf="sources->sources" org="jakarta.json" name="jakarta.json-api" rev="2.1.1"/> <dependency conf="sources->sources" org="org.eclipse.parsson" name="parsson" rev="1.1.1"/> <dependency conf="sources->sources" org="org.apache.commons" name="commons-jcs3-core" rev="3.1"/> <dependency conf="sources->sources" org="org.apache.commons" name="commons-compress" rev="1.23.0"/>
comment:19 by , 17 months ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:20 by , 17 months ago
Milestone: | 23.08 → 23.07 |
---|
That is funny. From the SO link,
We are using Parsson for the Jakarta EE implementation, so there should be no clashes.
Is this the Debian package from the Debian project repositories, or the Debian package from JOSM's repositories? I suspect the former, since you work on the Debian project package.
If so, can you check and see if that behavior is present in the package from JOSM's repositories?
I should change the
javax.json
inGeoJSONImporter
anyway.