Modify

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#22081 closed defect (othersoftware)

java.lang.IllegalAccessError: class com.sun.media.imageioimpl.plugins.pnm.PNMImageWriter (in unnamed module ) cannot access class

Reported by: baptiste.millemathias@… Owned by: team
Priority: normal Milestone:
Component: Core Version: tested
Keywords: template_report unamed module linux flatpak Cc:

Description

What steps will reproduce the problem?

  1. I start JOSM
  2. I click the button "download data" and download a zone
  3. BANG

What is the expected result?

What happens instead?

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

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2022-04-04 22:26:00 +0200 (Mon, 04 Apr 2022)
Revision:18427
Build-Date:2022-04-05 01:30:55
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (18427 fr) Linux Freedesktop.org 21.08.13 (Flatpak runtime)
Memory Usage: 587 MB / 1976 MB (313 MB allocated, but free)
Java version: 17.0.1+12, Flathub, OpenJDK 64-Bit Server VM
Look and Feel: javax.swing.plaf.metal.MetalLookAndFeel
Screen: :0.0 1920×1080 (scaling 1.00×1.00)
Maximum Screen Size: 1920×1080
Best cursor sizes: 16×16→16×16, 32×32→32×32
Environment variable LANG: fr_FR.UTF-8
System property file.encoding: UTF-8
System property sun.jnu.encoding: UTF-8
Locale info: fr_FR
Numbers with default locale: 1234567890 -> 1234567890
Desktop environment: GNOME

Plugins:
+ FixAddresses (35893)
+ HouseNumberTaggingTool (35951)
+ Mapillary (2.0.0-beta.9)
+ OpeningHoursEditor (35924)
+ apache-commons (35924)
+ apache-http (35924)
+ auto_tools (81)
+ buildings_tools (35951)
+ continuosDownload (99)
+ ejml (35924)
+ geotools (35959)
+ http2 (35921)
+ jackson (35958)
+ jaxb (35952)
+ jna (35924)
+ jts (35924)
+ merge-overlap (35893)
+ native_password_manager (35893)
+ opendata (35910)
+ openqa (0.3.0)
+ reverter (35893)
+ scripting (30798)
+ terracer (35893)
+ todo (30306)
+ tofix (490)
+ undelete (35893)
+ utilsplugin2 (35951)

Tagging presets:
+ https://raw.githubusercontent.com/osmlab/name-suggestion-index/main/dist/presets/nsi-josm-presets.min.xml

Map paint styles:
- https://github.com/bastik/mapcss-tools/raw/osm/mapnik2mapcss/osm-results/mapnik.zip
+ https://josm.openstreetmap.de/josmfile?page=Styles/MapWithAI&zip=1

Last errors/warnings:
- 00005.316 E: Impossible de trouver l'image "http://www.ign.fr/institut/sites/all/themes/ign_institut/logo.png"
- 00010.873 E: <josm.userdata>/plugins/opendata/resources/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/agriculture/RegistreParcellaire.mapcss (Aucun fichier ou dossier de ce type)
- 00013.802 E: Handled by bug report queue: java.lang.IllegalAccessError: class com.sun.media.imageioimpl.plugins.pnm.PNMImageWriter (in unnamed module @0x4207609e) cannot access class sun.security.action.GetPropertyAction (in module java.base) because module java.base does not export sun.security.action to unnamed module @0x4207609e



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

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (21) of main
java.lang.IllegalAccessError: class com.sun.media.imageioimpl.plugins.pnm.PNMImageWriter (in unnamed module @0x4207609e) cannot access class sun.security.action.GetPropertyAction (in module java.base) because module java.base does not export sun.security.action to unnamed module @0x4207609e
	at com.sun.media.imageioimpl.plugins.pnm.PNMImageWriter.<clinit>(PNMImageWriter.java:111)
	at com.sun.media.imageioimpl.plugins.pnm.PNMImageWriterSpi.createWriterInstance(PNMImageWriterSpi.java:117)
	at java.desktop/javax.imageio.spi.ImageWriterSpi.createWriterInstance(ImageWriterSpi.java:351)
	at java.desktop/javax.imageio.ImageIO$ImageWriterIterator.next(ImageIO.java:851)
	at java.desktop/javax.imageio.ImageIO$ImageWriterIterator.next(ImageIO.java:835)
	at java.desktop/sun.awt.X11.XDataTransferer.getPlatformMappingsForFlavor(XDataTransferer.java:412)
	at java.desktop/sun.awt.datatransfer.DesktopDatatransferServiceImpl.getPlatformMappingsForFlavor(DesktopDatatransferServiceImpl.java:87)
	at java.datatransfer/java.awt.datatransfer.SystemFlavorMap.flavorToNativeLookup(SystemFlavorMap.java:447)
	at java.datatransfer/java.awt.datatransfer.SystemFlavorMap.getNativesForFlavor(SystemFlavorMap.java:561)
	at java.desktop/sun.awt.datatransfer.DataTransferer.getFlavorsForFormats(DataTransferer.java:458)
	at java.desktop/sun.awt.datatransfer.ClipboardTransferable.<init>(ClipboardTransferable.java:88)
	at java.desktop/sun.awt.X11.XClipboard.getContents(XClipboard.java:108)
	at org.openstreetmap.josm.gui.datatransfer.ClipboardUtils.getClipboardContent(ClipboardUtils.java:107)
	at org.openstreetmap.josm.gui.datatransfer.ClipboardUtils.getClipboardContent(ClipboardUtils.java:95)
	at org.openstreetmap.josm.gui.datatransfer.ClipboardUtils.getClipboardStringContent(ClipboardUtils.java:80)
	at org.openstreetmap.josm.gui.widgets.AbstractIdTextField.tryToPasteFromClipboard(AbstractIdTextField.java:75)
	at org.openstreetmap.josm.gui.dialogs.changeset.SingleChangesetDownloadPanel.build(SingleChangesetDownloadPanel.java:64)
	at org.openstreetmap.josm.gui.dialogs.changeset.SingleChangesetDownloadPanel.<init>(SingleChangesetDownloadPanel.java:40)
	at org.openstreetmap.josm.gui.dialogs.changeset.ChangesetCacheManager.buildToolbarPanel(ChangesetCacheManager.java:143)
	at org.openstreetmap.josm.gui.dialogs.changeset.ChangesetCacheManager.build(ChangesetCacheManager.java:315)
	at org.openstreetmap.josm.gui.dialogs.changeset.ChangesetCacheManager.<init>(ChangesetCacheManager.java:333)
	at org.openstreetmap.josm.gui.dialogs.changeset.ChangesetCacheManager.getInstance(ChangesetCacheManager.java:93)
	at org.openstreetmap.josm.gui.download.BookmarkList.load(BookmarkList.java:289)
	at org.openstreetmap.josm.gui.download.BookmarkList.<init>(BookmarkList.java:245)
	at org.openstreetmap.josm.gui.download.BookmarkSelection.addGui(BookmarkSelection.java:117)
	at org.openstreetmap.josm.gui.download.DownloadDialog.buildMainPanel(DownloadDialog.java:162)
	at org.openstreetmap.josm.gui.download.DownloadDialog.<init>(DownloadDialog.java:263)
	at org.openstreetmap.josm.gui.download.DownloadDialog.<init>(DownloadDialog.java:251)
	at org.openstreetmap.josm.gui.download.DownloadDialog.getInstance(DownloadDialog.java:92)
	at org.openstreetmap.josm.actions.DownloadAction.actionPerformed(DownloadAction.java:40)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
	at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6626)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3389)
	at java.desktop/java.awt.Component.processEvent(Component.java:6391)
	at java.desktop/java.awt.Container.processEvent(Container.java:2266)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:746)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:744)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:743)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Attachments (0)

Change History (8)

comment:1 by GerdP, 3 years ago

Seems you have something in the copy&paste buffer that causes this. Try to clear the buffer.

in reply to:  description comment:2 by anonymous, 3 years ago

Replying to baptiste.millemathias@…:

Identification: JOSM/1.5 (18427 fr) Linux Freedesktop.org 21.08.13 (Flatpak runtime)
Java version: 17.0.1+12, Flathub, OpenJDK 64-Bit Server VM
Look and Feel: javax.swing.plaf.metal.MetalLookAndFeel

Last errors/warnings:
- 00013.802 E: Handled by bug report queue: java.lang.IllegalAccessError: class com.sun.media.imageioimpl.plugins.pnm.PNMImageWriter (in unnamed module @0x4207609e) cannot access class sun.security.action.GetPropertyAction (in module java.base) because module java.base does not export sun.security.action to unnamed module @0x4207609e

How do you start JOSM?
The "unamed module" looks like you are missing some options on startup:
--add-exports=java.base/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

Similar to #21059 and #21540.

Last edited 3 years ago by skyper (previous) (diff)

comment:3 by anonymous, 3 years ago

I use the flatpak version

comment:4 by skyper, 3 years ago

Well, the flatpak version needs to add the java option in its wrapper similar to our wrapper (/usr/bin/josm) in the *.deb, trunk/native/linux/tested/usr/bin/josm?rev=18297#L64 and following.
Alternatively, you could use following command from the terminal:

java --add-modules java.scripting,java.sql --add-exports=java.base/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 -Djosm.restart=true -Djava.net.useSystemProxies=true -jar ${path_to_josm_jar}

comment:5 by skyper, 3 years ago

Keywords: unamed module linux flatpak added
Summary: JOSM keeps crashingjava.lang.IllegalAccessError: class com.sun.media.imageioimpl.plugins.pnm.PNMImageWriter (in unnamed module ) cannot access class

comment:6 by taylor.smock, 3 years ago

I'm looking at a PR for the flatpak so that they actually use our start script (with a few modifications).

  • native/linux/tested/usr/bin/josm

    diff --git a/native/linux/tested/usr/bin/josm b/native/linux/tested/usr/bin/josm
    index 9149e68926..459299ebd8 100755
    a b set -e  
    44
    55# First, the alternative (if known to work) or users preference as defined by $JAVA_HOME. Next, use OpenJDK.
    66# Override to a specific one using $JAVACMD
    7 ALTERNATIVE_JDK=$(readlink -n -f /etc/alternatives/java)
     7ALTERNATIVE_JDK=$(readlink -n -f /etc/alternatives/java || echo "")
    88
    99# Let's get the current architecture -- needed for multiarchified Java
    1010ARCH=$(dpkg --print-architecture 2> /dev/null || true)
    ARCH=$(dpkg --print-architecture 2> /dev/null || true)  
    1212JAVA_CMDS="$JAVA_HOME/bin/java"
    1313
    1414# If OpenJDK is only available headless, do not try it
     15if [[ ! -z "$(which dpkg)" ]]; then
    1516if dpkg --get-selections "openjdk-*-jre" | grep install$ > /dev/null \
    1617|| dpkg --get-selections "openjdk-*-jre:$ARCH" | grep install$ > /dev/null ; then
    1718        # LTS versions in decreased order
    if dpkg --get-selections "openjdk-*-jre" | grep install$ > /dev/null \  
    2930        # Development version(s)
    3031        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-18-openjdk/bin/java /usr/lib/jvm/java-18-openjdk-$ARCH/bin/java"
    3132fi
     33fi
    3234# Undetermined version
    3335JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/default-java/bin/java /usr/bin/java"
    3436

Reasoning:

  • L7 exits with 1 if the file doesn't exist. Which brings in the set -e.
  • L15/L33: dpkg isn't available on non-Debian distributions

I don't know if we want to add these to our copy of the start scripts.

PR submitted ( https://github.com/flathub/org.openstreetmap.josm/pull/52 ).

Last edited 3 years ago by taylor.smock (previous) (diff)

comment:7 by taylor.smock, 3 years ago

Resolution: othersoftware
Status: newclosed

This should now be fixed in the flatpak. I presume it is immediately available, but I'm not 100% certain on that.

comment:8 by anonymous, 3 years ago

Thanks for the follow-up on this issue

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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