﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
17881	Could not load plugin, main class not found	Ralpha	Don-vip	"==== What steps will reproduce the problem?
1. Go to preferences
2. Install any plugin (tested with SimplifyArea and Utilsplugin2), click 'Update plugins'
3. (everything looks correct up until now)
4. Press 'ok' 
5. Error thrown here

==== What is the expected result?

That the plugin is enabled and works.

==== What happens instead?

An error message (on screen and in terminal)

==== Please provide any additional information below. Attach a screenshot if possible.

{{{
Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2019-06-03 00:05:30 +0200 (Mon, 03 Jun 2019)
Revision:15155
Build-Date:2019-06-02 22:10:24
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (15155 en) Linux Mint 19.1 Tessa
Memory Usage: 371 MB / 3000 MB (217 MB allocated, but free)
Java version: 11.0.3+7-Ubuntu-1ubuntu218.04.1, Oracle Corporation, OpenJDK 64-Bit Server VM
Screen: :0.0 1920x1080, :0.1 1920x1080, :0.2 1920x1080
Maximum Screen Size: 1920x1080
Java package: openjdk-11-jre:amd64-11.0.3+7-1ubuntu2~18.04.1
VM arguments: [-Djosm.restart=true, -Djava.net.useSystemProxies=true]

Last errors/warnings:
- W: No configuration settings found.  Using hardcoded default values for all pools.
- W: Region [WMS_BLOCK_v2] Resetting cache
- W: Region [WMTS_BLOCK_v2] Resetting cache
- W: Invalid jar file ''<josm.pref>/plugins/SimplifyArea.jar.new'' (exists: false, canRead: false)
- E: org.openstreetmap.josm.plugins.PluginException: An error occurred in plugin SimplifyArea. Cause: java.lang.ClassNotFoundException: org.openstreetmap.josm.plugins.simplifyarea.SimplifyAreaPlugin
- W: Disable plugin - <html>Could not load plugin 'SimplifyArea' because the plugin<br>main class 'org.openstreetmap.josm.plugins.simplifyarea.SimplifyAreaPlugin' was not found.<br>Delete from preferences?</html>
- E: org.openstreetmap.josm.plugins.PluginException: An error occurred in plugin utilsplugin2. Cause: java.lang.ClassNotFoundException: org.openstreetmap.josm.plugins.utilsplugin2.UtilsPlugin2
- W: Disable plugin - <html>Could not load plugin 'utilsplugin2' because the plugin<br>main class 'org.openstreetmap.josm.plugins.utilsplugin2.UtilsPlugin2' was not found.<br>Delete from preferences?</html>
}}}

Following message will be displayed:
[[Image(https://i.imgur.com/HoeMf7H.png)]]
Transcription of image: 
Disable plugin - Could not load plugin 'utilsplugin2' because the plugin
main class 'org.openstreetmap.josm.plugins.utilsplugin2.UtilsPlugin2' was not found.
Delete from preferences?
Disable plugin - Keep plugin

Error in terminal:

{{{
2019-07-06 23:48:31.012 SEVERE: org.openstreetmap.josm.plugins.PluginException: An error occurred in plugin utilsplugin2. Cause: java.lang.ClassNotFoundException: org.openstreetmap.josm.plugins.utilsplugin2.UtilsPlugin2
org.openstreetmap.josm.plugins.PluginException: An error occurred in plugin utilsplugin2
	at org.openstreetmap.josm.plugins.PluginInformation.loadClass(PluginInformation.java:382)
	at org.openstreetmap.josm.plugins.PluginHandler.loadPlugin(PluginHandler.java:801)
	at org.openstreetmap.josm.plugins.PluginHandler.loadPlugins(PluginHandler.java:890)
	at org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane$PluginDownloadAfterTask.run(PreferenceTabbedPane.java:172)
	at org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane.savePreferences(PreferenceTabbedPane.java:428)
	at org.openstreetmap.josm.gui.preferences.PreferenceDialog$OKAction.actionPerformed(PreferenceDialog.java:202)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
	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:6632)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
	at java.desktop/java.awt.Component.processEvent(Component.java:6397)
	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5008)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
	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.pumpEventsForFilter(EventDispatchThread.java:117)
	at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
	at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
	at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
	at java.desktop/java.awt.Dialog.show(Dialog.java:1070)
	at java.desktop/java.awt.Component.show(Component.java:1716)
	at java.desktop/java.awt.Component.setVisible(Component.java:1663)
	at java.desktop/java.awt.Window.setVisible(Window.java:1031)
	at java.desktop/java.awt.Dialog.setVisible(Dialog.java:1005)
	at org.openstreetmap.josm.gui.preferences.PreferenceDialog.setVisible(PreferenceDialog.java:143)
	at org.openstreetmap.josm.actions.PreferencesAction.run(PreferencesAction.java:112)
	at org.openstreetmap.josm.actions.PreferencesAction.actionPerformed(PreferencesAction.java:101)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
	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:6632)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
	at java.desktop/java.awt.Component.processEvent(Component.java:6397)
	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5008)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
	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)
Caused by: java.lang.ClassNotFoundException: org.openstreetmap.josm.plugins.utilsplugin2.UtilsPlugin2
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
	at org.openstreetmap.josm.plugins.PluginClassLoader.loadClass(PluginClassLoader.java:73)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:398)
	at org.openstreetmap.josm.plugins.PluginInformation.loadClass(PluginInformation.java:380)
	... 87 more

2019-07-06 23:48:31.016 WARNING: Disable plugin - <html>Could not load plugin 'utilsplugin2' because the plugin<br>main class 'org.openstreetmap.josm.plugins.utilsplugin2.UtilsPlugin2' was not found.<br>Delete from preferences?</html>
}}}

Tested this with JOSM version 15155 and JOSM version 15214 (latest).
With both JRE 8 and JRE 11

Jar file was not downloaded to ~/.josm/plugins first but later created directory after manualy adding the .josm folder.

Jar files are identical in all locations below.
utilsplugin2.jar: 
  Last modified: 14/04/2019
  sha512sum: c39cdbb3df31b12ce4d78d35022da55d66d3561bf7b1bee2c308a0aed9353b7b74cf6b740a8076b44da2355bc40aa321454be2e52c3042f64b9b9b4b59f4877a

Jar exists in: 
~/.josm/plugins/utilsplugin2.jar
~/.local/share/JOSM/plugins/utilsplugin2.jar
~/.local/share/JOSM-latest/plugins/utilsplugin2.jar


This was a clean install from JOSM."	defect	closed	normal	19.06	Core		fixed	template_report, plugin	
