No loader registered for type "xml"

i got this error running a project i havent run in about a month, nothings changed except perhaps jmonkey itself was updated i think (i think from 3.0.4 to 3.0.5?). it used to run fine before. i fired it up to check out how i did something in it… anyways…

this is the line that is triggering the error:

tgScreen = new Screen(app, “Interface/MenuSystem/Style/style_map.xml”);

and it throws this exception

Problem loading style map: java.lang.IllegalStateException: No loader registered for type “xml”

if i remove my custom style map so its just new Screen(app); then it works fine, but of course i dont have my custom style map.

has something changed recently in tonegodgui or jme such that i have to set up the gui differently now or manually add the asset loader or something?

tgScreen = new Screen(app, “Interface/MenuSystem/Style/style_map.xml”);

Hi,

it must be [java]tgScreen = new Screen(app, “Interface/MenuSystem/Style/style_map.gui.xml”); [/java] the loader in this case is for type “gui.xml”

1 Like

@icamefromspace

Yep yep… As @b00n stated, the xml loader was swapped out for something specific for the GUI so it didn’t trample on other peoples need for specific xml loaders.

The extensions are now .gui.xml

i see, the change makes sense. i shall change my file name. thanks for the info sascha and tonegod.

1 Like

@t0neg0d I had the same problem. I changed to “Interface/MenuSystem/Style/style_map.gui.xml”. But now I get: No loader registered for type “gui.xml”. What’s wrong? :stuck_out_tongue:

Btw the version of tonegodgui I’m using was checked out of svn 2014-04-04.

@tuffe said: @t0neg0d I had the same problem. I changed to "Interface/MenuSystem/Style/style_map.gui.xml". But now I get: No loader registered for type "gui.xml". What's wrong? :p

Btw the version of tonegodgui I’m using was checked out of svn 2014-04-04.

Make sure all local tonegodGUI xml files are renamed with this extension and also make sure that the local style_map.gui.xml file is pointing to files with the new extension.

Let me know if this was the issue or not, and we need to, we keep trying til we figure it out.

@t0neg0d I changed the style to the default def/style_map.gui.xml files that came with tonegodgui (in the src directory). All of the xml files had the gui.xml extension. Still get the error.

@t0neg0d I checked out the latest version, and now it works. :stuck_out_tongue:

@t0neg0d Actually, it does not work.

It works if I restart the JVM, but I usually don’t. If I try to restart my game without restarting the JVM, it does not work.

@tuffe said: @t0neg0d Actually, it does not work.

It works if I restart the JVM, but I usually don’t. If I try to restart my game without restarting the JVM, it does not work.

This has to be some sort of caching issue.

OS? Possibility of needing a reboot?

@t0neg0d

In Screen private static boolean initializedLoader; should not be static! :stuck_out_tongue:

@t0neg0d

Hi! I have seen you active in other threads, so I just wanted to make sure that you have not missed this one. There’s no rush though, I have changed it myself for now. :slight_smile: If you had used git I could have submitted a patch, but I don’t use svn. :stuck_out_tongue:

Thanks for this… I’ll get it updated!

And yes, I missed the update posts… so sorry!

@t0neg0d

Of course, if initializedLoader is not static, it has no reason to exist. But it whether or not a loader needs to be registered depends on the AssetManager object, not the Screen class. Out of curiosity, I checked, and it appears as if adding a loader, even though it has already been added, is not a problem:

[java]
public void addLoader(final Class<? extends AssetLoader> loaderType, String … extensions){
// Synchronized access must be used for any ops on classToLoaderMap
ImplThreadLocal local = new ImplThreadLocal(loaderType, extensions);
for (String extension : extensions){
extension = extension.toLowerCase();
synchronized (classToLoaderMap){
classToLoaderMap.put(loaderType, local);
extensionToLoaderMap.put(extension, local);
}
}
}[/java]