Modify

Opened 13 months ago

Last modified 13 months ago

#23009 new defect

UnsupportedClassVersionError: org/openstreetmap/josm/plugins/damn/DamnPlugin has been compiled by a more recent version of Java

Reported by: anonymous Owned by: qeef
Priority: normal Milestone:
Component: Plugin damn Version: tested
Keywords: template_report Cc:

Description

What steps will reproduce the problem?

What is the expected result?

What happens instead?

Please provide any additional information below. Attach a screenshot if possible.

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2023-06-02 17:23:29 +0200 (Fri, 02 Jun 2023)
Build-Date:2023-06-03 01:31:02
Revision:18746
Relative:URL: ^/trunk

Identification: JOSM/1.5 (18746 en) Windows 10 64-Bit
OS Build number: Windows 10 Pro 2009 (19045)
Memory Usage: 340 MB / 747 MB (203 MB allocated, but free)
Java version: 1.8.0_371-b11, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Screen: \Display0 1366×768 (scaling 1.00×1.00)
Maximum Screen Size: 1366×768
Best cursor sizes: 16×16→32×32, 32×32→32×32
System property file.encoding: Cp1252
System property sun.jnu.encoding: Cp1252
Locale info: en_US
Numbers with default locale: 1234567890 -> 1234567890

Plugins:
+ BuildingGeneralization (36)
+ DirectDownload (36031)
+ DirectUpload (36031)
+ apache-commons (36034)
+ apache-http (35924)
+ buildings_tools
+ damn
+ graphview (36079)
+ jna (36005)
+ mapathoner
+ mapwithai
+ markseen
+ merge-overlap
+ osm-obj-info (66)
+ scripting
+ utilsplugin2 (36079)

Map paint styles:
+ https://josm.openstreetmap.de/josmfile?page=Styles/MapWithAI&zip=1
+ https://github.com/MissingMaps/josm_styles/archive/master.zip
+ https://github.com/osmlab/appledata/archive/josm_paint_inline_validation.zip

Last errors/warnings:
- 00040.872 W: Failed to scan file 'jts.jar.new' for plugin information. Skipping.
- 00049.672 W: java.util.zip.ZipException: error in opening zip file
- 00049.674 W: PluginException: : org.openstreetmap.josm.plugins.PluginException: Invalid jar file '<josm.pref>\plugins\jts.jar.new'
- 00049.677 W: Failed to scan file 'jts.jar.new' for plugin information. Skipping.
- 00052.566 W: Failed to install plugin '<josm.pref>\plugins\jts.jar' from temporary download file '<josm.pref>\plugins\jts.jar.new'. error in opening zip file: java.util.zip.ZipException: error in opening zip file
- 00484.083 W: java.net.UnknownHostException: api.openstreetmap.org
- 00484.088 E: java.net.UnknownHostException: api.openstreetmap.org
- 00484.092 E: org.openstreetmap.josm.io.OsmTransferException: Could not connect to the OSM server. Please check your internet connection.. Cause: java.net.UnknownHostException: api.openstreetmap.org
- 00544.620 W: Plugin scripting requires Java version 11. The current Java version is 8. You have to update Java in order to use this plugin.
- 00552.619 E: Handled by bug report queue: java.lang.UnsupportedClassVersionError: org/openstreetmap/josm/plugins/damn/DamnPlugin has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0



=== REPORTED CRASH DATA ===
BugReportExceptionHandler#handleException:
No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: main (1)
java.lang.UnsupportedClassVersionError: org/openstreetmap/josm/plugins/damn/DamnPlugin has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(Unknown Source)
	at java.security.SecureClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.access$100(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at org.openstreetmap.josm.plugins.PluginClassLoader.loadClass(PluginClassLoader.java:74)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Unknown Source)
	at org.openstreetmap.josm.plugins.PluginInformation.loadClass(PluginInformation.java:402)
	at org.openstreetmap.josm.plugins.PluginHandler.loadPlugin(PluginHandler.java:810)
	at org.openstreetmap.josm.plugins.PluginHandler.loadPlugins(PluginHandler.java:898)
	at org.openstreetmap.josm.plugins.PluginHandler.loadLatePlugins(PluginHandler.java:950)
	at org.openstreetmap.josm.gui.MainApplication.loadLatePlugins(MainApplication.java:1247)
	at org.openstreetmap.josm.gui.MainApplication.mainJOSM(MainApplication.java:962)
	at org.openstreetmap.josm.gui.MainApplication$3.processArguments(MainApplication.java:277)
	at org.openstreetmap.josm.gui.MainApplication.main(MainApplication.java:742)

Attachments (0)

Change History (7)

comment:1 by stoecker, 13 months ago

Component: CorePlugin damn
Owner: changed from team to qeef

comment:2 by gaben, 13 months ago

Is it a plugin issue? I think JOSM should show a warning for such cases.

in reply to:  2 comment:3 by taylor.smock, 13 months ago

Replying to gaben:

Is it a plugin issue? I think JOSM should show a warning for such cases.

We (kind of) do. We just aren't catching the exception of the plugin was compiled incorrectly. See source:trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java@18763:648-654,691#L648. We are depending upon the plugin to properly report what version of Java they require.

comment:4 by taylor.smock, 13 months ago

Summary: JOSM FAILLIG LUNCHUnsupportedClassVersionError: org/openstreetmap/josm/plugins/damn/DamnPlugin has been compiled by a more recent version of Java

comment:5 by qeef, 13 months ago

I am sorry, I do not know how to setup Gradle properly. I set the build in Debian unstable with jdk 8 again, so, please, try to update to the JOSM damn plugin v0.11.3 and let me know here if the problem is solved.

https://git.sr.ht/~qeef/damn-plugin/commit/7ccca00f9b2c9cddafb5a1e61bf5796f6e872ae1

Also, I welcome help on the damn plugin maintenance. Thanks.

in reply to:  5 comment:6 by gaben, 13 months ago

Yesterday I almost published a patch for this exact code part to show at least a notification.

Even if there is no exception error like in this ticket, if the plugin requires a newer Java version, the user does not get informed in any way. I know the console output exists, but who checks that among normal users?

In summary:

  • UnsupportedClassVersionError should be caught as it's straightforward what's the cause, why and how can be fixed
  • the min Java version in the damn plugin should be fixed.

Both seem achievable with minimal effort.

Replying to qeef:

I am sorry, I do not know how to setup Gradle properly.

In the build.gradle file add the corrsponding Plugin-Minimum-Java-Version described in DevelopersGuide/DevelopingPlugins#ThemanifestfileforaJOSMplugin via the josm-gradle-plugin (docs for Kotlin here).

in reply to:  5 comment:7 by taylor.smock, 13 months ago

Replying to qeef:

Also, I welcome help on the damn plugin maintenance. Thanks.

We could stick it in the GitHub JOSM group. I don't know how you feel about GitHub, but AFAIK it is the only git source control system with support for subversion clients. Which is needed if we want to add it to the JOSM svn checkout (for plugins).

As a heads up, we are starting to move JOSM over to the newer Jakarta JSON libraries. The interface is effectively the same as javax.json (and is pretty much the same code; when Oracle open-sourced the javax.json libraries, they didn't allow them to keep using the javax root-level package). You should be able to do a mass search and replace of javax.json with jakarta.json.

See #22432 (r18723) and #22941.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain qeef.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from qeef to the specified user.
Next status will be 'needinfo'. The owner will be changed from qeef to anonymous.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from qeef to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.