OBJLoader throws NumberFormatException in Nightly

Hello there,



ever since a month or so (that’s about when I last checked) I get a NumberFormatException when loading a OBJ file. It worked before, so I’m at a loss at why it does not work.

Here the exception:


ERROR jMonkeyEngine.core: java.lang.Number
FormatException: For input string: "10 2 4"
at java.lang.NumberFormatException.forInputString (NumberFormatException.java:65)
java.lang.Integer.parseInt (Integer.java:481)
java.lang.Integer.parseInt (Integer.java:514)
com.jme3.scene.plugins.OBJLoader.readFace (OBJLoader.java:246)
com.jme3.scene.plugins.OBJLoader.readLine (OBJLoader.java:366)
com.jme3.scene.plugins.OBJLoader.load (OBJLoader.java:565)
com.jme3.asset.DesktopAssetManager.loadAsset (DesktopAssetManager.java:273)
com.jme3.asset.DesktopAssetManager.loadModel (DesktopAssetManager.java:408)
com.jme3.asset.DesktopAssetManager.loadModel (DesktopAssetManager.java:418)
sun.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2)
sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)


And the file that's causing the exception:

v 0.246265 -0.064546 0.200000
v 0.047053 -0.015471 -0.200000
v 0.246266 0.064546 0.200000
v 0.047053 0.015471 -0.200000
v 0.195735 -0.010244 -0.132422
v 0.195735 0.010244 -0.132422
v 0.411635 -0.037672 0.132422
v 0.411635 0.037672 0.132422
v -0.000000 -0.075884 0.200000
v 0.000000 -0.015471 -0.200000
v 0.000000 0.075884 0.200000
v 0.000000 0.015471 -0.200000
f 10 2 4
f 10 4 12
f 1 9 11
f 1 11 3
f 12 4 11
f 4 3 11
f 9 1 2
f 9 2 10
f 7 8 6
f 7 6 5
f 2 1 5
f 1 7 5
f 3 4 6
f 3 6 8
f 1 3 7
f 3 8 7
f 4 2 5
f 4 5 6
v -0.246265 -0.064546 0.200000
v -0.047053 -0.015471 -0.200000
v -0.246266 0.064546 0.200000
v -0.047053 0.015471 -0.200000
v -0.195735 -0.010244 -0.132422
v -0.195735 0.010244 -0.132422
v -0.411635 -0.037672 0.132422
v -0.411635 0.037672 0.132422
v 0.000000 -0.075884 0.200000
v -0.000000 -0.015471 -0.200000
v -0.000000 0.075884 0.200000
v -0.000000 0.015471 -0.200000
usemtl (null)
s off
f 22 14 16
f 22 16 24
f 13 21 23
f 13 23 15
f 24 16 23
f 16 15 23
f 21 13 14
f 21 14 22
f 19 20 18
f 19 18 17
f 14 13 17
f 13 19 17
f 15 16 18
f 15 18 20
f 13 15 19
f 15 20 19
f 16 14 17
f 16 17 18
v 0.042427 -0.042427 -0.500000
v 0.100000 -0.100000 0.269412
v -0.100000 -0.100000 0.269412
v -0.042427 -0.042427 -0.500000
v 0.017046 0.042427 -0.500000
v 0.100000 0.100000 0.269413
v -0.100000 0.100000 0.269412
v -0.017046 0.042427 -0.500000
v 0.068639 -0.041317 0.486322
v -0.068639 -0.041317 0.486322
v 0.041317 0.041317 0.486322
v -0.041317 0.041317 0.486322
usemtl Material
s off
f 26 33 27
f 33 34 27
f 27 34 31
f 34 36 31
f 26 30 33
f 30 35 33
f 30 31 36
f 30 36 35
s 1
f 33 35 34
f 35 36 34
s off
f 29 25 28
f 29 28 32
f 27 31 28
f 31 32 28
f 26 30 27
f 30 31 27
f 25 29 30
f 25 30 26
f 29 32 31
f 29 31 30
f 25 26 27
f 25 27 28


The file has been exported by blender, so I'd assume it should work. From what I can gather from the OBJLoader source code, the problem lies inside the readFace method. Anyone who could shed a light on this issue?

Kind regards,
MHOOO

Which build are you getting this on?

Your question made me wary, so I rechecked. Turns out I had the old nightly still in my classpath and I no longer get the error with the newest (i.e. todays, 18. April 2012 nightly build).



I apologize for the noise :frowning:



Kind regards,

MHOOO

@mhooo said:
Your question made me wary, so I rechecked. Turns out I had the old nightly still in my classpath and I no longer get the error with the newest (i.e. todays, 18. April 2012 nightly build).


Just be careful.. the nightlies come with a big sticker that says "WATCH OUT!". Especially after @Momoko_Fan put up a rather big commit the other night :)

@mhooo said:
I apologize for the noise :(


We like noise :)
1 Like