Q:

Cant get my object loader to work

im trying to create a obj loader. my camera and all works perfectly if i try to just draw a triangle with code and run. but when i try to use this obj loader on a simple box created in 3ds max then it all goes to hell. 
to be specific the error goes:
exception in thread "main" java.lang.NumberFormatException: empty String
at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
at java.lang.Float.valueOf(Unknown Source)
at asdas.Loader.loadModel(Loader.java:16)
at asdas.ThreeDeeWorld.setUpBox(ThreeDeeWorld.java:43)
at asdas.ThreeDeeWorld.main(ThreeDeeWorld.java:28)

so it complains both about my loader and the way i try to draw and i cant see why? :/
This is my loader: 
public static Model loadModel(File f) throws FileNotFoundException, IOException {

    BufferedReader reader = new BufferedReader(new FileReader(f));
    Model m = new Model();
    String line; 
    while ((line = reader.readLine())!= null){
        if (line.startsWith("v ")){
            Float x = Float.valueOf(line.split(" ")[1]);
            Float y = Float.valueOf(line.split(" ")[2]);
            Float z = Float.valueOf(line.split(" ")[3]);
            m.vertices.add(new Vector3f(x,y,z));
        } else if (line.startsWith("vn ")){
            Float x = Float.valueOf(line.split(" ")[1]);
            Float y = Float.valueOf(line.split(" ")[2]);
            Float z = Float.valueOf(line.split(" ")[3]);
            m.normals.add(new Vector3f(x,y,z));
        } else if (line.startsWith("f ")){
            Vector3f vertexIndices = new Vector3f(Float.valueOf(line.split(" ")[1].split("/")[0]), 
                    Float.valueOf(line.split(" ")[2].split("/")[0]),
                    Float.valueOf(line.split(" ")[3].split("/")[0]));

            Vector3f normalIndices = new Vector3f(Float.valueOf(line.split(" ")[1].split("/")[2]), 
                    Float.valueOf(line.split(" ")[2].split("/")[2]),
                    Float.valueOf(line.split(" ")[3].split("/")[2]));
            m.faces.add(new Face(vertexIndices, normalIndices));

        }
    }
    reader.close();
    return m;

}

}
this is how i try to load and draw the obj file:
public static void setUpBox() {
    int objectDisplayList = glGenLists(1);
    glNewList(objectDisplayList, GL_COMPILE);
    asdas.Model m = null;

    try { 
         m = Loader.loadModel(new File("src/box.obj.obj"));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
                Display.destroy();
                System.exit(1);
            } catch (IOException e){
                e.printStackTrace();
                Display.destroy();
                System.exit(1);
            }
    glBegin(GL_TRIANGLES);
    for (Face face : m.faces) {
        Vector3f n1 = m.normals.get((int) face.normal.x -1);
        glNormal3f(n1.x, n1.y, n1.z);
        Vector3f v1 = m.vertices.get((int) face.vertex.x -1);
        glVertex3f(v1.x, v1.y, v1.z);
        Vector3f n2 = m.normals.get((int) face.normal.y -1);
        glNormal3f(n2.x, n2.y, n2.z);
        Vector3f v2 = m.vertices.get((int) face.vertex.y -1);
        glVertex3f(v2.x, v2.y, v2.z);
        Vector3f n3 = m.normals.get((int) face.normal.z -1);
        glNormal3f(n3.x, n3.y, n3.z);
        Vector3f v3 = m.vertices.get((int) face.vertex.z -1);
        glVertex3f(v3.x, v3.y, v3.z);

    }
    glEnd();
    glEndList();

}
my obj file looks like this: 
# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware
# File Created: 12.10.2014 15:11:35

#
# object Box001
#

v  -1.2169 0.0000 40.0295
v  -1.2169 0.0000 -42.7719
v  14.2454 0.0000 -42.7719
v  14.2454 0.0000 40.0295
v  -1.2169 32.5605 40.0295
v  14.2454 32.5605 40.0295
v  14.2454 32.5605 -42.7719
v  -1.2169 32.5605 -42.7719
# 8 vertices

vn 0.0000 -1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 0.0000 1.0000
vn 1.0000 0.0000 -0.0000
vn 0.0000 0.0000 -1.0000
vn -1.0000 0.0000 -0.0000
# 6 vertex normals

f 1//1 2//1 3//1 
f 3//1 4//1 1//1 
f 5//2 6//2 7//2 
f 7//2 8//2 5//2 
f 1//3 4//3 6//3 
f 6//3 5//3 1//3 
f 4//4 3//4 7//4 
f 7//4 6//4 4//4 
f 3//5 2//5 8//5 
f 8//5 7//5 3//5 
f 2//6 1//6 5//6 
f 5//6 8//6 2//6 
# 12 faces

I really hope one of you guys can help me figure this out since i have spend several days on this mystery so far :/

A:

If you take a look at the line starting with v, you will see something interesting...
v  -1.2169 0.0000 40.0295

v and -1.2169 are separated by a double space ("  "), not a single space, this means that when you split on a single space (" "), the extra space actually gets considered, not that anything is in between the two spaces, so you end up with a empty String
If you put in someting like...
String parts[] = line.split(" ");
for (String value : parts) {
    System.out.println("\"" + value + "\"");
}

before you try parsing the line, it will print
"v"
""
"-1.2169"
"0.0000"
"40.0295"

The simplest solution would be to start at index [2] instead of index [1], but me, personally, I'd be stripping off the leading "header" section up to the first number, but that's me...
line = line.substring(1).trim();
System.out.println(line);

Which outputs...
-1.2169 0.0000 40.0295

Now, you can just split it and use index [0], [1] and [2]...

