Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception on runJosm task: Could not initialize class org.openstreetmap.josm.tools.WinRegistry #17

Open
ireun opened this issue Jul 7, 2022 · 1 comment

Comments

@ireun
Copy link

ireun commented Jul 7, 2022

Hi.

I was trying to run Mapillary JOSM plugin using "runJosm" task, I'm facing following issue:

2022-07-07 16:57:44.657 SEVERE: Handled by bug report queue: java.lang.NoClassDefFoundError: Could not initialize class org.openstreetmap.josm.tools.WinRegistry
java.lang.NoClassDefFoundError: Could not initialize class org.openstreetmap.josm.tools.WinRegistry
	at org.openstreetmap.josm.tools.PlatformHookWindows.isDotNet45Installed(PlatformHookWindows.java:628)
	at org.openstreetmap.josm.tools.PlatformHookWindows.webRequest(PlatformHookWindows.java:676)
	at org.openstreetmap.josm.tools.PlatformHookWindows.getX509Certificate(PlatformHookWindows.java:362)
	at org.openstreetmap.josm.io.CertificateAmendment.addMissingCertificates(CertificateAmendment.java:240)
	at org.openstreetmap.josm.gui.MainApplication.mainJOSM(MainApplication.java:878)
	at org.openstreetmap.josm.gui.MainApplication$3.processArguments(MainApplication.java:277)
	at org.openstreetmap.josm.gui.MainApplication.main(MainApplication.java:741)

2022-07-07 16:57:45.004 SEVERE: Unable to get Windows build number: java.lang.NoClassDefFoundError: Could not initialize class org.openstreetmap.josm.tools.WinRegistry
2022-07-07 16:57:45.236 SEVERE: java.lang.IllegalStateException: HTTP factory has not been set
java.lang.IllegalStateException: HTTP factory has not been set
	at org.openstreetmap.josm.tools.HttpClient.create(HttpClient.java:557)
	at org.openstreetmap.josm.tools.HttpClient.create(HttpClient.java:545)
	at org.openstreetmap.josm.io.CachedFile.checkLocal(CachedFile.java:491)
	at org.openstreetmap.josm.io.CachedFile.getFile(CachedFile.java:284)
	at org.openstreetmap.josm.io.CachedFile.getInputStream(CachedFile.java:227)
	at org.openstreetmap.josm.io.CachedFile.getByteContent(CachedFile.java:245)
	at org.openstreetmap.josm.gui.bugreport.JosmUpdatePanel.getTestedVersion(JosmUpdatePanel.java:70)
	at org.openstreetmap.josm.gui.bugreport.JosmUpdatePanel.readCurrentVersion(JosmUpdatePanel.java:53)
	at java.base/java.lang.Thread.run(Thread.java:833)

I've even tried to crate a new project with such build.gradle:

plugins {
    id 'java'
    id "org.openstreetmap.josm" version "0.8.2"
}

group 'org.example'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
}

josm {
    pluginName = "MyAwesomePluginName"
    josmCompileVersion = 18511
    manifest {
        description = "The description of my awesome plugin"
        mainClass = "org.openstreetmap.josm.plugins.myawesomeplugin.MyAwesomePlugin"
        minJosmVersion = 18511
    }
}

Results were the same. I'm using IntelliJ IDEA on Windows 10, Azul 17 JDK.

@ireun ireun changed the title java.lang.NoClassDefFoundError: Could not initialize class org.openstreetmap.josm.tools.WinRegistry Exception on runJosm taks: Could not initialize class org.openstreetmap.josm.tools.WinRegistry Jul 7, 2022
@ireun ireun changed the title Exception on runJosm taks: Could not initialize class org.openstreetmap.josm.tools.WinRegistry Exception on runJosm task: Could not initialize class org.openstreetmap.josm.tools.WinRegistry Jul 7, 2022
@floscher
Copy link
Owner

floscher commented Jul 8, 2022

Thank you for reporting, I'll look into it!

Edit: I can reproduce this in a Windows 10 VM with Azul JDK 17

This part of the console output seems to be the relevant portion:

2022-07-08 07:46:24.402 WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0xffffffff80000002. Windows RegCreateKeyEx(...) returned error code 5.
2022-07-08 07:46:24.417 SEVERE: java.lang.ExceptionInInitializerError. Cause: java.lang.reflect.InaccessibleObjectException: Unable to make private static native long[] java.util.prefs.WindowsPreferences.WindowsRegOpenKey(long,byte[],int) accessible: module java.prefs does not "opens java.util.prefs" to unnamed module @5d20e46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants