So this seems like a great utility, I can never seem to get configurations to correctly work in my plugins so I was looking for a good utility to use. That being said, when I try to implement, I get the following error
Caused by: com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'playerData'
at com.typesafe.config.impl.SimpleConfig.findKey(SimpleConfig.java:124) ~[SimpleConfig.class:?]
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:145) ~[SimpleConfig.class:?]
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:159) ~[SimpleConfig.class:?]
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:164) ~[SimpleConfig.class:?]
at com.typesafe.config.impl.SimpleConfig.getObject(SimpleConfig.java:218) ~[SimpleConfig.class:?]
at com.typesafe.config.impl.SimpleConfig.getConfig(SimpleConfig.java:224) ~[SimpleConfig.class:?]
at com.typesafe.config.impl.SimpleConfig.getConfig(SimpleConfig.java:33) ~[SimpleConfig.class:?]
at org.cobalt.studios.cobaltim.configuration.ConfigMapper.loadClass(ConfigMapper.java:175) ~[ConfigMapper.class:?]
at org.cobalt.studios.cobaltim.configuration.ConfigManager.initConfig(ConfigManager.java:20) ~[ConfigManager.class:?]
at org.cobalt.studios.cobaltim.configuration.ConfigManager.<init>(ConfigManager.java:14) ~[ConfigManager.class:?]
at org.cobalt.studios.cobaltim.CobaltIM.onServerStart(CobaltIM.java:40) ~[CobaltIM.class:?]
... 30 more
I was searching through the source code to identify the error (the key in question was a Map containing one entry for default values and population. The only difference made was mapping the library classes into main package code. Is there a reason it is not creating or populating correctly? Or is there extra methods I just am missing that are required to be used? I used your example posts on GitHub to setup my Config class so I am curious what I am doing wrong.
Hi,
I guess you added an annotated field to your mapped class after the mapper generated a config file. The mapper wont write missing config sections into the file and thats why this exception is thrown. Im aware of this issue and i plan to fix it.
I think I have figured my problem out. It seems like the server is not properly injecting the Game dependency into my plugin. Not exactly sure why as I have tried both field injection and method injection and it seems like both do not inject correctly. So I don’t know how to fix that, but it doesn’t seem to be an issue with your library as of yet.