jME 2 – Webstart resource loading


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:


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) {




ResourceLocatorTool.TYPE_TEXTURE, locator);

FormatConverter converter = new MaxToJme();

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