Modify

Opened 4 weeks ago

Last modified 8 days ago

#15490 new defect

NoClassDefFoundError when try run script

Reported by: RafalR Owned by: Gubaer
Priority: normal Milestone:
Component: Plugin scripting Version: tested
Keywords: java9 Cc: naoliv

Description (last modified by RafalR)

Java 9 only, with 1.8.0 everything works fine.

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2017-10-03 21:43:00 +0200 (Tue, 03 Oct 2017)
Revision:12921
Build-Date:2017-10-03 19:50:21
URL:http://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (12921 pl) Windows 8.1 64-Bit
OS Build number: Windows 8.1 Pro (9600)
Memory Usage: 220 MB / 1500 MB (101 MB allocated, but free)
Java version: 9+181, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Screen: \Display0 1366x768
Maximum Screen Size: 1366x768

Plugins:
+ Mapillary (v1.5.7)
+ OpeningHoursEditor (33185)
+ PicLayer (33385)
+ Tracer2 (33700)
+ apache-commons (33668)
+ apache-http (32699)
+ buildings_tools (33004)
+ ejml (32680)
+ geotools (33380)
+ jts (32699)
+ opendata (33617)
+ reverter (33572)
+ scripting (30773)
+ utilsplugin2 (33704)

Tagging presets:
+ https://josm.openstreetmap.de/josmfile?page=Presets/maxspeed_PL&preset
+ https://raw.githubusercontent.com/zibik/stork_nests/master/stork_preset.xml
+ https://raw.githubusercontent.com/osmlab/name-suggestion-index/master/name-suggestions.presets.xml

Validator rules:
- <josm.pref>\validator\indoorhelper.validator.mapcss

Last errors/warnings:
- E: Nie udało się zlokalizować obrazu „motorway.png'
- W: [NODE] Autostrada: Could not get presets icon motorway.png
- W: Cannot lock cache directory. Will not use disk cache
- W: No configuration settings found.  Using hardcoded default values for all pools.
- W: Cannot start IPv4 remotecontrol server on port 8111: Address already in use: NET_Bind
- W: Cannot start IPv6 remotecontrol server on port 8111: Address already in use: NET_Bind
- W: Cannot start IPv4 remotecontrol https server on port 8112: Address already in use: NET_Bind
- W: Cannot start IPv6 remotecontrol https server on port 8112: Address already in use: NET_Bind
- E: Handled by bug report queue: java.lang.NoClassDefFoundError: javax/activation/MimetypesFileTypeMap. Przyczyna: java.lang.ClassNotFoundException: javax.activation.MimetypesFileTypeMap
- W: Unable to detect current tested version of JOSM:: java.lang.NumberFormatException: For input string: "<html>12921


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

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (20) of main
java.lang.NoClassDefFoundError: javax/activation/MimetypesFileTypeMap
	at org.openstreetmap.josm.plugins.scripting.model.JSR223ScriptEngineProvider.<init>(JSR223ScriptEngineProvider.java:67)
	at org.openstreetmap.josm.plugins.scripting.model.JSR223ScriptEngineProvider.getInstance(JSR223ScriptEngineProvider.java:60)
	at org.openstreetmap.josm.plugins.scripting.ui.RunScriptService.deriveOrAskScriptEngineDescriptor(RunScriptService.java:91)
	at org.openstreetmap.josm.plugins.scripting.ui.RunScriptDialog$RunAction.actionPerformed(RunScriptDialog.java:196)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
	at java.desktop/java.awt.Component.processMouseEvent(Unknown Source)
	at java.desktop/javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.desktop/java.awt.Component.processEvent(Unknown Source)
	at java.desktop/java.awt.Container.processEvent(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue.access$500(Unknown Source)
	at java.desktop/java.awt.EventQueue$3.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$3.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.WaitDispatchSupport$2.run(Unknown Source)
	at java.desktop/java.awt.WaitDispatchSupport$4.run(Unknown Source)
	at java.desktop/java.awt.WaitDispatchSupport$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.desktop/java.awt.WaitDispatchSupport.enter(Unknown Source)
	at java.desktop/java.awt.Dialog.show(Unknown Source)
	at java.desktop/java.awt.Component.show(Unknown Source)
	at java.desktop/java.awt.Component.setVisible(Unknown Source)
	at java.desktop/java.awt.Window.setVisible(Unknown Source)
	at java.desktop/java.awt.Dialog.setVisible(Unknown Source)
	at org.openstreetmap.josm.plugins.scripting.ui.RunScriptDialog.setVisible(RunScriptDialog.java:165)
	at org.openstreetmap.josm.plugins.scripting.ui.RunScriptAction.actionPerformed(RunScriptAction.java:33)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at java.desktop/javax.swing.AbstractButton.doClick(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
	at java.desktop/java.awt.Component.processMouseEvent(Unknown Source)
	at java.desktop/javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.desktop/java.awt.Component.processEvent(Unknown Source)
	at java.desktop/java.awt.Container.processEvent(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue.access$500(Unknown Source)
	at java.desktop/java.awt.EventQueue$3.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$3.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: javax.activation.MimetypesFileTypeMap
	at java.base/java.net.URLClassLoader.findClass(Unknown Source)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	at org.openstreetmap.josm.plugins.PluginClassLoader.loadClass(PluginClassLoader.java:73)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	... 89 more

=== RUNNING THREADS ===
Thread: JCS-ElementEventQueue-Thread-1 (34) of main
java.base@9/jdk.internal.misc.Unsafe.park(Native Method)
java.base@9/java.util.concurrent.locks.LockSupport.park(Unknown Source)
java.base@9/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
java.base@9/java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)
java.base@9/java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
java.base@9/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.base@9/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.base@9/java.lang.Thread.run(Unknown Source)

Thread: message-notifier-0 (47) of main
java.base@9/jdk.internal.misc.Unsafe.park(Native Method)
java.base@9/java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
java.base@9/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(Unknown Source)
java.base@9/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
java.base@9/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
java.base@9/java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
java.base@9/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.base@9/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.base@9/java.lang.Thread.run(Unknown Source)

Thread: File Watcher (13) of main
java.base@9/jdk.internal.misc.Unsafe.park(Native Method)
java.base@9/java.util.concurrent.locks.LockSupport.park(Unknown Source)
java.base@9/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
java.base@9/java.util.concurrent.LinkedBlockingDeque.takeFirst(Unknown Source)
java.base@9/java.util.concurrent.LinkedBlockingDeque.take(Unknown Source)
java.base@9/sun.nio.fs.AbstractWatchService.take(Unknown Source)
app//org.openstreetmap.josm.io.FileWatcher.processEvents(FileWatcher.java:135)
app//org.openstreetmap.josm.io.FileWatcher$$Lambda$30/1859039536.run(Unknown Source)
java.base@9/java.lang.Thread.run(Unknown Source)

Thread: Attach Listener (5) of system

Thread: FileSystemWatchService (12) of main
java.base@9/sun.nio.fs.WindowsNativeDispatcher.GetQueuedCompletionStatus0(Native Method)
java.base@9/sun.nio.fs.WindowsNativeDispatcher.GetQueuedCompletionStatus(Unknown Source)
java.base@9/sun.nio.fs.WindowsWatchService$Poller.run(Unknown Source)
java.base@9/java.lang.Thread.run(Unknown Source)

Thread: GT authority factory disposer (36) of main
java.base@9/java.lang.Object.wait(Native Method)
java.base@9/java.util.TimerThread.mainLoop(Unknown Source)
java.base@9/java.util.TimerThread.run(Unknown Source)

Thread: Reference Handler (2) of system
java.base@9/java.lang.ref.Reference.waitForReferencePendingList(Native Method)
java.base@9/java.lang.ref.Reference.processPendingReferences(Unknown Source)
java.base@9/java.lang.ref.Reference.access$000(Unknown Source)
java.base@9/java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)

Thread: image-fetcher-0 (32) of main
java.base@9/jdk.internal.misc.Unsafe.park(Native Method)
java.base@9/java.util.concurrent.locks.LockSupport.park(Unknown Source)
java.base@9/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
java.base@9/java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)
java.base@9/java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
java.base@9/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.base@9/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.base@9/java.lang.Thread.run(Unknown Source)

Thread: AWT-EventQueue-0 (20) of main
Stacktrace see above.

Thread: Common-Cleaner (9) of InnocuousThreadGroup
java.base@9/java.lang.Object.wait(Native Method)
java.base@9/java.lang.ref.ReferenceQueue.remove(Unknown Source)
java.base@9/jdk.internal.ref.CleanerImpl.run(Unknown Source)
java.base@9/java.lang.Thread.run(Unknown Source)
java.base@9/jdk.internal.misc.InnocuousThread.run(Unknown Source)

Thread: Finalizer (3) of system
java.base@9/java.lang.Object.wait(Native Method)
java.base@9/java.lang.ref.ReferenceQueue.remove(Unknown Source)
java.base@9/java.lang.ref.ReferenceQueue.remove(Unknown Source)
java.base@9/java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)

Thread: Java2D Disposer (15) of system
java.base@9/java.lang.Object.wait(Native Method)
java.base@9/java.lang.ref.ReferenceQueue.remove(Unknown Source)
java.base@9/java.lang.ref.ReferenceQueue.remove(Unknown Source)
java.desktop@9/sun.java2d.Disposer.run(Unknown Source)
java.base@9/java.lang.Thread.run(Unknown Source)

Thread: Weak reference cleaner (26) of main
java.base@9/java.lang.Object.wait(Native Method)
java.base@9/java.lang.ref.ReferenceQueue.remove(Unknown Source)
java.base@9/java.lang.ref.ReferenceQueue.remove(Unknown Source)
app//org.openstreetmap.josm.tools.ListenableWeakReference.clean(ListenableWeakReference.java:60)
app//org.openstreetmap.josm.tools.ListenableWeakReference$$Lambda$325/1313960293.run(Unknown Source)
java.base@9/java.lang.Thread.run(Unknown Source)

Thread: Timer-0 (49) of main
java.base@9/java.lang.Object.wait(Native Method)
java.base@9/java.util.TimerThread.mainLoop(Unknown Source)
java.base@9/java.util.TimerThread.run(Unknown Source)

Thread: TimerQueue (23) of system
java.base@9/jdk.internal.misc.Unsafe.park(Native Method)
java.base@9/java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
java.base@9/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(Unknown Source)
java.base@9/java.util.concurrent.DelayQueue.take(Unknown Source)
java.desktop@9/javax.swing.TimerQueue.run(Unknown Source)
java.base@9/java.lang.Thread.run(Unknown Source)

Thread: AWT-Shutdown (21) of system
java.base@9/java.lang.Object.wait(Native Method)
java.base@9/java.lang.Object.wait(Unknown Source)
java.desktop@9/sun.awt.AWTAutoShutdown.run(Unknown Source)
java.base@9/java.lang.Thread.run(Unknown Source)

Thread: WeakCollectionCleaner (37) of main
java.base@9/java.lang.Object.wait(Native Method)
java.base@9/java.lang.ref.ReferenceQueue.remove(Unknown Source)
java.base@9/java.lang.ref.ReferenceQueue.remove(Unknown Source)
org.geotools.util.WeakCollectionCleaner.run(WeakCollectionCleaner.java:77)

Thread: Signal Dispatcher (4) of system

Thread: AWT-Windows (18) of system
java.desktop@9/sun.awt.windows.WToolkit.eventLoop(Native Method)
java.desktop@9/sun.awt.windows.WToolkit.run(Unknown Source)
java.base@9/java.lang.Thread.run(Unknown Source)

Thread: DestroyJavaVM (48) of main

Thread: D3D Screen Updater (25) of system
java.base@9/java.lang.Object.wait(Native Method)
java.desktop@9/sun.java2d.d3d.D3DScreenUpdateManager.run(Unknown Source)
java.base@9/java.lang.Thread.run(Unknown Source)

Attachments (0)

Change History (4)

comment:1 Changed 3 weeks ago by RafalR

Description: modified (diff)

comment:2 Changed 8 days ago by Don-vip

Ticket #15548 has been marked as a duplicate of this ticket.

comment:3 Changed 8 days ago by Don-vip

Cc: naoliv added

How do you run JOSM? We already add the java.activation module in every possible way:

  • in the jnlp file for WebStart:
        <resources>
            <java version="1.8+" java-vm-args="--add-modules=java.activation,java.se.ee --add-exports=java.base/sun.security.util=ALL-UNNAMED --add-exports=java.base/sun.security.x509=ALL-UNNAMED --add-exports=java.desktop/com.apple.eawt=ALL-UNNAMED --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED --add-exports=javafx.graphics/com.sun.javafx.application=ALL-UNNAMED --add-exports=jdk.deploy/com.sun.deploy.config=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.desktop/javax.imageio.spi=ALL-UNNAMED --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED"/>
            <jar href="josm-latest.jar"/>
            <property name="java.util.Arrays.useLegacyMergeSort" value="true"/>
        </resources>
    
  • in the Linux startup script:
        if [ "`expr match \"${JAVACMD}\" 'java-9'`" != "0" ]; then
            JAVA_OPTS="--add-modules java.activation,java.se.ee $JAVA_OPTS"
        fi
    

We cannot do more in JOSM core. The argument has to given on the command line. So if you run JOSM with "java -jar", or by double-clicking the jar file, it's up to you to provide the argument --add-modules=java.activation, unless the plugin drops the call to javax.activation.MimetypesFileTypeMap.

comment:4 Changed 8 days ago by naoliv

Ah... indeed.
From my side I was missing --add-modules java.activation,java.se.ee
Sorry.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Gubaer.
as The resolution will be set.
to The owner will be changed from Gubaer to the specified user.
The owner will change to RafalR
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from Gubaer to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.