jME 2 – Webstart resource loading

Hi,

I am trying to get my application to work in webstart, but i get this NullPointerException:

BaseDir cannot be null.



It works fine when i run it in netbeans though.

here is where the exception is thrown:

[java]

URL modelURL = info.getURL();

URL folder = ModelLoader.class.getClassLoader()

.getResource(modelURL.getFile().substring(modelURL.getFile().indexOf(“intrivix”), modelURL.getFile().lastIndexOf(’/’)) + “/”);



SimpleResourceLocator locator = null;

try {

locator = new SimpleResourceLocator(folder);

} catch (URISyntaxException ex) {

ex.printStackTrace();

}

ResourceLocatorTool.addResourceLocator(

ResourceLocatorTool.TYPE_TEXTURE, locator);



FormatConverter converter = new MaxToJme();

converter.setProperty(“texdir”, folder);[/java]