Hello mopar,
The few last weeks i was working on my new project.
I edited a few item-stats, after that the server won't start.
I already replaced the item.cfg with tons of other WORKING item.cfg files, but server still doesn't start.
There are no Spaces in each line, checked already.
Replaced the old itemhandler too, still doesn't work.
I had 4 Errors before, now there's 1 Error left:
Code:
Exception in thread "Thread-1"Exception in thread "main"java.lang.NoClassDefFoundError: Could not initialize class server.Server
I'm not sure why it doesn't find any class, the run.bat worked before.
*i know eclipse is better & more advanced, but it doesn't work at my windows 8 laptop alm:*
Thanks for reading, Sh0ck
**FIX:
Eclipse works now somehow,
It gives me the following errors now:
Code:
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.ArrayIndexOutOfBoundsException: 17
at server.world.ItemHandler.loadItemList(ItemHandler.java:365)
at server.world.ItemHandler.<init>(ItemHandler.java:33)
at server.Server.<clinit>(Server.java:61)
Like i said, i already replaced itemhandler class & item.cfg with a working one, but still doesn't work!
This is the method:
Code:
public boolean loadItemList(String FileName) {
String line = "";
String token = "";
String token2 = "";
String token2_2 = "";
String[] token3 = new String[10];
boolean EndOfFile = false;
int ReadMode = 0;
BufferedReader characterfile = null;
try {
characterfile = new BufferedReader(new FileReader("./Data/cfg/"+FileName));
} catch(FileNotFoundException fileex) {
Misc.println(FileName+": file not found.");
return false;
}
try {
line = characterfile.readLine();
} catch(IOException ioexception) {
Misc.println(FileName+": error loading file.");
return false;
}
while(EndOfFile == false && line != null) {
line = line.trim();
int spot = line.indexOf("=");
if (spot > -1) {
token = line.substring(0, spot);
token = token.trim();
token2 = line.substring(spot + 1);
token2 = token2.trim();
token2_2 = token2.replaceAll("\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t", "\t");
token3 = token2_2.split("\t");
if (token.equals("item")) {
int[] Bonuses = new int[12];
for (int i = 0; i < 12; i++) {
if (token3[(6 + i)] != null) {
Bonuses[i] = Integer.parseInt(token3[(6 + i)]);
} else {
break;
}
}
newItemList(Integer.parseInt(token3[0]), token3[1].replaceAll("_", " "), token3[2].replaceAll("_", " "), Double.parseDouble(token3[4]), Double.parseDouble(token3[4]), Double.parseDouble(token3[6]), Bonuses);
}
} else {
if (line.equals("[ENDOFITEMLIST]")) {
try { characterfile.close(); } catch(IOException ioexception) { }
return true;
}
}
try {
line = characterfile.readLine();
} catch(IOException ioexception1) { EndOfFile = true; }
}
try { characterfile.close(); } catch(IOException ioexception) { }
return false;
}
}