# Slick2d Particles loading xml returning null [closed]

I've made a particle class that creates a particle of Slick2d library, but the XML file doesn't want to load , it keeps giving me null error. I gave it the path as I do for everything but it refuses to work and its been like this for days I just cant get it to open that XML file. If anyone can help me it would be much appreciated.

try {
particleImage = new Image("res/particles/particle.png", false);
system = new ParticleSystem(particleImage,1500);

//load the xml file and add the emitter to the system
File xmlFile = new File("res/particles/bloodDown.xml");
ConfigurableEmitter emitter = ParticleIO.loadEmitter(xmlFile);
emitter.setPosition(315, 358);
} catch (Exception e) {
System.out.println("Exception: " +e.getMessage());
e.printStackTrace();
System.exit(0);
}


Entire particle class : http://pastebin.com/rBR0xpE7

Particle manager class : http://pastebin.com/N8gNFk6W

Slick 2d documentation : http://www.slick2d.org/javadoc/

My structure of workspace:

## closed as too localized by bummzack, Anko, MichaelHouse♦, Josh♦, ClassicThunderApr 25 '13 at 15:44

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

• Have you stepped through your code to identify exactly where the problem is? If the xml file is loading properly, but the returned emitter is null, then chances are there is a formatting issue with the xml file. If the xml file just never loads, then consider investigating a pathing issue. – Evan Apr 21 '13 at 5:17
• Its the path issue, I print out the path it looks fine like for everything else, its just that ConfigurableEmitter emitter = ParticleIO.loadEmitter(xmlFile); doesnt load it. – Matthew Apr 21 '13 at 6:14
• Printed out the path? I assume you know how to use breakpoints for debugging correct? Well, assuming that your File is being constructed properly(that the XML file is actually found), then the xml format may be incorrect. – Evan Apr 21 '13 at 14:39
• Well it does print out the name of the xml file that is stored inside the xml. But there is still ERROR:null java.lang.NullPointerException at javagame.ParticleManager.update(ParticleManager.java:25) , i checked 10 times with debugging and i still dont know what is wrong with it – Matthew Apr 21 '13 at 15:22
• Well what line specifically is it giving you the NRE on? That will give you a hint as to what's wrong. – Tetrad Apr 22 '13 at 3:22