java.lang.UnsatisfiedLinkError: com.jme3.bullet.collision.shapes.CapsuleCollisionShape.createShape(IFF)J

Hey guys…
I recently switched rom using the 3.0 sdk to 3.1… Everything works great… But when i try to run my unit tests i get the following error

[VerboseTestNG] java.lang.UnsatisfiedLinkError: com.jme3.bullet.collision.shapes.CapsuleCollisionShape.createShape(IFF)J
[VerboseTestNG] 	at com.jme3.bullet.collision.shapes.CapsuleCollisionShape.createShape(Native Method)
[VerboseTestNG] 	at com.jme3.bullet.collision.shapes.CapsuleCollisionShape.createShape(
[VerboseTestNG] 	at com.jme3.bullet.collision.shapes.CapsuleCollisionShape.<init>(
[VerboseTestNG] 	at com.jme3.bullet.control.BetterCharacterControl.getShape(
[VerboseTestNG] 	at com.jme3.lostVictories.characters.BetterSoldierControl.<init>(
[VerboseTestNG] 	at com.jme3.lostVictories.characters.Soldier.createCharacterControl(
[VerboseTestNG] 	at com.jme3.lostVictories.characters.Soldier.createCharacterControl(
[VerboseTestNG] 	at com.jme3.lostVictories.characters.GameCharacterNode.<init>(
[VerboseTestNG] 	at com.jme3.lostVictories.characters.AICharacterNode.<init>(
[VerboseTestNG] 	at com.jme3.lostVictories.characters.Soldier.<init>(
[VerboseTestNG] 	at com.jme3.lostVictories.characters.CadetCorporal.<init>(
[VerboseTestNG] 	at com.jme3.lostVictories.characters.AICharacterNodeTest.createCadetCorporal(
[VerboseTestNG] 	at

Everyhting work fine when i run the app but test dont seem to find the right native lib… I tried adding
to my project VM options but there was no change

if i do

find . -name "*.dylib" | xargs grep "com.jme3.bullet.collision.shapes.CapsuleCollisionShape"
Binary file ./libbulletjme.dylib matches

so it looks like the library is there but maybe the wrong version. Im not sure if its the wrong native library coming over from when i was using the project in 3.0 And i have no idea why it would work when i run the game but not test…

any help would be greatly appreciated

Switch to native Bullet or Add the jbullet.jar to the library

Thanks for your response @Darkchaos but i tried adding
./jmonkeyplatform/modules/ext/jbullet.jar (which came with the distribution) to my project by right clicking Libraries and adding jar/folder… But i get the same error…
im either not using the correct jar of im not adding it to the right place…

And reading some other posts… I think i might be already using native bullet as im using jm3-bullet and jme3-bullet-native not jme-jbullet

i suspect that it cant find libbulletjme.dylib when running unit test. but does find it when running the game… I have no idea how to fix it

Yeah this was my issue because most of the time the above is where users are stuck.
Reading the stack trace it definitely is a problem with native-bullet.

Have you tried deleting the dylib so it is reextracted? Because it could be that it has been changed between 3.0 and 3.1, which however usually leads to crashes instead of a proper exception.

Have you tried a clean build (build & clean, everything is redone?)
Technically the native method createShape could not find the Java Code, according to the above stack trace, which is strange.

yea tried deleting the dylib… Running the test fails with the same error. But it also does not re-extract it…
Running the game does re-extract it and the game runs fine…

But even once its been extracted… The test still fails with the same error… Its like it cant see the native lib… Should i try to put a -Djava.library.path somewhere?

cean build doesnt help either

Well then it seems to be that your tests run different from the game.
Try to find out what parameters are passed to the game and to the tests, I guess your tests just miss the libraries but they are present in the normal game