question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NPE on config initialization - can't load saved marker file, if id contains a slash

See original GitHub issue

Issue Description: Dynmap saves configuration just fine, but it might fail to load it and throw NPE. It looks like the culprit is here: https://github.com/webbukkit/dynmap/blob/v3.0/DynmapCore/src/main/java/org/dynmap/markers/impl/MarkerSetImpl.java#L469

for(String id : areamarkernode.keySet()) {
    AreaMarkerImpl marker = new AreaMarkerImpl(id, this);   /* Make and load marker */
    if(marker.loadPersistentData(areamarkernode.getNode(id))) { // BUG: .getNode(id) returns null

In my case it was cause by the area ID containing a / character.

  • Dynmap Version: dynmap v3.1-beta3a-409
  • Server Version: Paper 1.16.2 build 185
  • Pastebin of crashlogs or other relevant logs: Are marker:
[10:14:53] [Server thread/INFO]: [dynmap] Enabling dynmap v3.1-beta3a-409*
[10:14:53] [Server thread/INFO]: [dynmap] Added 4 custom biome mappings
[10:14:53] [Server thread/INFO]: [dynmap] Using LuckPerms 5.1.66 for access control
[10:14:53] [Server thread/ERROR]: Error occurred while enabling dynmap v3.1-beta3a-409 (Is it up to date?)
java.lang.NullPointerException: null
        at org.dynmap.markers.impl.AreaMarkerImpl.loadPersistentData(AreaMarkerImpl.java:122) ~[?:?]
        at org.dynmap.markers.impl.MarkerSetImpl.loadPersistentData(MarkerSetImpl.java:471) ~[?:?]
        at org.dynmap.markers.impl.MarkerAPIImpl.loadMarkers(MarkerAPIImpl.java:717) ~[?:?]
        at org.dynmap.markers.impl.MarkerAPIImpl.initializeMarkerAPI(MarkerAPIImpl.java:384) ~[?:?]
        at org.dynmap.DynmapCore.initConfiguration(DynmapCore.java:410) ~[?:?]
        at org.dynmap.bukkit.DynmapPlugin.onEnable(DynmapPlugin.java:905) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.16.2.jar:git-Paper-185]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:380) ~[patched_1.16.2.jar:git-Paper-185]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:483) ~[patched_1.16.2.jar:git-Paper-185]
        at org.bukkit.craftbukkit.v1_16_R2.CraftServer.enablePlugin(CraftServer.java:499) ~[patched_1.16.2.jar:git-Paper-185]
        at org.bukkit.craftbukkit.v1_16_R2.CraftServer.enablePlugins(CraftServer.java:413) ~[patched_1.16.2.jar:git-Paper-185]
        at net.minecraft.server.v1_16_R2.MinecraftServer.loadWorld(MinecraftServer.java:468) ~[patched_1.16.2.jar:git-Paper-185]
        at net.minecraft.server.v1_16_R2.DedicatedServer.init(DedicatedServer.java:241) ~[patched_1.16.2.jar:git-Paper-185]
        at net.minecraft.server.v1_16_R2.MinecraftServer.w(MinecraftServer.java:939) ~[patched_1.16.2.jar:git-Paper-185]
        at net.minecraft.server.v1_16_R2.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.2.jar:git-Paper-185]
        at java.lang.Thread.run(Unknown Source) [?:?]

Circle:

[15:08:36 INFO]: [dynmap] Enabling dynmap v3.1-beta3a-409*
[15:08:37 INFO]: [dynmap] Added 4 custom biome mappings
[15:08:37 INFO]: [dynmap] Using Bukkit Permissions (superperms) for access control
[15:08:37 INFO]: [dynmap] Web interface permissions only available for online users
[15:08:38 ERROR]: Error occurred while enabling dynmap v3.1-beta3a-409 (Is it up to date?)
java.lang.NullPointerException: null
	at org.dynmap.markers.impl.CircleMarkerImpl.loadPersistentData(CircleMarkerImpl.java:104) ~[?:?]
	at org.dynmap.markers.impl.MarkerSetImpl.loadPersistentData(MarkerSetImpl.java:509) ~[?:?]
	at org.dynmap.markers.impl.MarkerAPIImpl.loadMarkers(MarkerAPIImpl.java:717) ~[?:?]
	at org.dynmap.markers.impl.MarkerAPIImpl.initializeMarkerAPI(MarkerAPIImpl.java:384) ~[?:?]
	at org.dynmap.DynmapCore.initConfiguration(DynmapCore.java:410) ~[?:?]
	at org.dynmap.bukkit.DynmapPlugin.onEnable(DynmapPlugin.java:905) ~[?:?]
	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.16.2.jar:git-Paper-185]
	at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:380) ~[patched_1.16.2.jar:git-Paper-185]
	at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:483) ~[patched_1.16.2.jar:git-Paper-185]
	at org.bukkit.craftbukkit.v1_16_R2.CraftServer.enablePlugin(CraftServer.java:499) ~[patched_1.16.2.jar:git-Paper-185]
	at org.bukkit.craftbukkit.v1_16_R2.CraftServer.enablePlugins(CraftServer.java:413) ~[patched_1.16.2.jar:git-Paper-185]
	at net.minecraft.server.v1_16_R2.MinecraftServer.loadWorld(MinecraftServer.java:468) ~[patched_1.16.2.jar:git-Paper-185]
	at net.minecraft.server.v1_16_R2.DedicatedServer.init(DedicatedServer.java:241) ~[patched_1.16.2.jar:git-Paper-185]
	at net.minecraft.server.v1_16_R2.MinecraftServer.w(MinecraftServer.java:939) ~[patched_1.16.2.jar:git-Paper-185]
	at net.minecraft.server.v1_16_R2.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.2.jar:git-Paper-185]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_262]
  • Other Relevant Data/Screenshots: Nothing
  • Steps to Replicate:
  1. Start fresh server, with new dynmap.
  2. Run: /dmarker addcircle id:prof/bloodstone
  3. Stop the server
  4. Start the server and observer errors being thrown in dynmap onEnable

[X] I have looked at all other issues and this is not a duplicate
[X] I have been able to replicate this

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
FedUpWith-Techcommented, Dec 29, 2021

Just kidding. Its fixed on 3.3beta3 at least:

%YAML 1.1
---
icons:
    monkey:
        label: monkey
sets:
    markers:
        hide: false
        circles:
            prof/bloodstone:
                markup: false
                fillOpacity: 0.35
                strokeWeight: 3
                label: prof/bloodstone
                fillColor: 16711680
                world: world
                x: 100.0
                zr: 1.0
                y: 85.0
                z: 100.0
                xr: 1.0
                strokeColor: 16711680
                strokeOpacity: 0.8
        deficon: default
        areas: {
            }
        label: Markers
        markers:
            monkey:
                world: world
                markup: false
                x: 4.0
                icon: monkey
                y: 85.0
                z: 5.0
                label: monkey
            test/marker:
                world: world
                markup: false
                x: 100.0
                icon: house
                y: 85.0
                z: 100.0
                label: test/marker
        lines: {
            }
        layerprio: 0
playersets: {
    }

No errors in console

[10:03:05 INFO]: [dynmap] Enabling dynmap v3.3-beta-3-591
[10:03:05 INFO]: [dynmap] Added 18 custom biome mappings
[10:03:05 INFO]: [dynmap] Using Bukkit Permissions (superperms) for access control
[10:03:05 INFO]: [dynmap] Web interface permissions only available for online users
[10:03:05 INFO]: [dynmap] Mod Support processing completed
[10:03:06 INFO]: [dynmap] Loaded 25 shaders.
[10:03:06 INFO]: [dynmap] Loaded 82 perspectives.
[10:03:06 INFO]: [dynmap] Loaded 22 lightings.
[10:03:06 INFO]: [dynmap] Starting enter/exit processing
[10:03:06 INFO]: [dynmap] Finish marker initialization
[10:03:06 INFO]: [dynmap] Web server started on address 0.0.0.0:8123
[10:03:06 INFO]: [dynmap] version 3.3-beta-3-591 is enabled - core version 3.3-beta-3-591
[10:03:06 INFO]: [dynmap] For support, visit https://reddit.com/r/Dynmap or our Discord at https://discord.gg/s3rd5qn
[10:03:06 INFO]: [dynmap] To report or track bugs, visit https://github.com/webbukkit/dynmap/issues
[10:03:06 INFO]: [dynmap] If you'd like to donate, please visit https://www.patreon.com/dynmap or https://ko-fi.com/michaelprimm
[10:03:06 INFO]: [dynmap] Loaded 3 maps of world 'world'.
[10:03:06 INFO]: [dynmap] Loaded 2 maps of world 'world_nether'.
[10:03:06 INFO]: [dynmap] Loaded 2 maps of world 'world_the_end'.
[10:03:06 INFO]: [dynmap] Enabled
[10:03:06 INFO]: Running delayed init tasks
[10:03:06 INFO]: Done (2.790s)! For help, type "help"

And the marker does show up on the map: image

I’ll re-mark this as fixed and close. Nice catch @JurgenKuyper

0reactions
FedUpWith-Techcommented, Dec 29, 2021

This can still be replicated in the most recent versions

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chapter 3. Beans, BeanFactory and the ApplicationContext
The BeanFactory is created and initialized with a configuration which describes all the beans. Most Spring users use a BeanFactory or ApplicationContext variant ......
Read more >
Known Issues - JFrog - JFrog Documentation
For JFrog Artifactory issues, click the issue ID for the details in JIRA. Known issues are based on the following criteria: Severity 1...
Read more >
Fix list for IBM WebSphere Application Server V8.5
IBM WebSphere Application Server provides periodic fixes for the base and Network Deployment editions of release V8.5. The following is a complete listing ......
Read more >
Release Notes 5.2 - Apache Tapestry
To upgrade from 5.1 to 5.2, most users will be able to just update the Maven dependency in their POM file (or download...
Read more >
Changelog Archive - Jenkins
Globally configured build discarders may delete old builds if a project has been configured with a more aggressive build discarder configuration since the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found