Well, i've been trying to learn xstream (I know its pretty easy...) but when i try to load the items from the xml document until an array, i get a null
Code:
[00:00:00]: java.lang.NullPointerException
[00:00:00]: at com.rs.worldserver.util.BanHandler.loadBans(BanHandler.java:7
6)
[00:00:00]: at com.rs.worldserver.Server.main(Server.java:121)
Thats the null i get, heres the loadBans method
Code:
public static void loadBans() {
try {
bans = (List<Ban>) XStreamUtil.getxStream().fromXML(
new FileInputStream("config/bans.xml"));
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("Loaded bans.");
}
and the xml document itself
Code:
<list>
<ban>
<playerName>Jordon</playerName>
<connectedFrom>192.168.1.1</connectedFrom>
<banType>BAN</banType>
</ban>
</list>
Well, any help would be appriciated