Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting a strange NullPointerException
    primarykey
    data
    text
    <p>Not sure why i get this, here is the exception:</p> <pre><code>Exception in thread "main" java.lang.NullPointerException at org.dementhium.model.definition.ItemDefinition.loadMiscData(ItemDefinition.java:126) at org.dementhium.model.definition.ItemDefinition.init(ItemDefinition.java:104) at org.dementhium.model.World.load(World.java:127) at org.dementhium.RS2ServerBootstrap.main(RS2ServerBootstrap.java:43) </code></pre> <p>here is my loadmiscdata method:</p> <pre><code> private static void loadMiscData() throws IOException { BufferedReader reader = new BufferedReader(new FileReader("data/item/poisoningitems.txt")); String string; while ((string = reader.readLine()) != null) { String[] data = string.split(":"); int id = Integer.parseInt(data[0]); int amount = Integer.parseInt(data[1]); definitions[id].setPoisonAmount(amount); } reader = new BufferedReader(new FileReader("data/item/equipIds.txt")); while ((string = reader.readLine()) != null) { String[] data = string.split(":"); int id = Integer.parseInt(data[0]); int equipId = Integer.parseInt(data[1]); definitions[id].setEquipId(equipId); } } </code></pre> <p>line 126:</p> <pre><code> definitions[id].setEquipId(equipId); </code></pre> <p>here is part of my equipids file(wont post all because its huge):</p> <pre><code>20282:5106 20284:5107 20288:5108 20290:5109 20294:5110 20296:5111 20300:5112 20302:5113 20306:5114 20308:5115 20312:5116 20314:5117 20318:5118 20320:5119 20324:5120 20326:5121 20330:5122 20332:5123 20336:5124 20338:5125 20342:5126 20344:5127 </code></pre> <p>I have no idea why i am getting this exception...</p> <p>Thanks in advance :)</p> <p>Sorry i forgot to post definitions here it is:</p> <pre><code>private static ItemDefinition[] definitions; definitions = new ItemDefinition[MAX_SIZE]; </code></pre> <p>MAX_SIZE = 20792 btw</p> <p>for the entire class look here: <a href="http://pastebin.com/rvyMp42q" rel="nofollow">http://pastebin.com/rvyMp42q</a></p> <p>Thanks again</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload