[SOLVED] AssetNotFoundException: Models/X on Maven

Hi guys, this is my first post so I’ll introduce myself, I’m toneddu2000, I’m creating hobby games with the FTEQW game engine (a fork of the Quake 1 engine), but I feel I need something more ‘structured’ for my projects, so some day ago I tried for the first time JME (I knew ) and the documentation is great, so many examples, I really like it. Unfortunately my journey quite immediately stopped since I created a simple project creating a class extended by SimpleApplication and everything works except loading assets.
If I insert this line


At run JME prompts this error:

AssetNotFoundException: Models/Test/test.glb

I’m not using the SDK, but instead I’m using NetBeans with maven and Java v18. This is the pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <!-- JMONKEY ENGINE STUFF -->
        <!-- JMonkey stats -->
        <!-- Check the last version -->
        <!-- Repository for JMonkey Engine dependences -->
        <!-- JMonkey Engine dependences  -->

Of course, as stated in the guide, I created the assets folder in the main folder (the same folder where pom.xml is placed), and the Models folder is child of assets folder.

Instead, if I write


The engine loads successfully the model, because it finds in the C:\Users\myuser.m2\repository\net\sf\sociaal\jME3-testdata\\jME3-testdata- But (and this is strange), if I copy the exact content of the jar in another folder (for example Ferrari2) in the game assets folder, the loader cannot find the model!

Anyone knows why this problem occurs in my filesystem?

Thanks to anyone for any help!


Your models should be on the assets folder (on the class directory) or you will need to register an asset locator for the asset manager.

Are you using the SDK ?

This is because the models are in asset folder inside the jar and the jar is added to the class directory, so its visible in this case.

Thanks Pavl_G for the super quick response! I’m not using the SDK, just maven and netbeans. For the asset locator, I forgot to mention earlier that I tried also to use FileLocator, that should extend the interface AssetLocator

FileLocator fl = new FileLocator();

(tried with forward slashes,backslashes, trailing or not)
before loading models, but still no success

You need to register it with your assetManager :
On your void simpleInit() :

assetManager.registerLocator("C:\\myprojects\\ExampleGame", FileLocator.class);

FileLocator class will automatically look out for your root path to load your assets.

yes, that did the trick, but I had to add \assets at the end, like this:

assetManager.registerLocator("C:\\myprojects\\ExampleGame\\assets", FileLocator.class);

Thanks a lot Pavl_G for your great support!