All jME3-test physics tests are throwing NoSuchMethodError : DiscreteDynamicsWorld.setPreTickCallback

I am trying to run the sample physics test found in jME3-test projects. At the beginning I was getting the following error,

SEVERE: Uncaught exception thrown in Thread[jME3 Main,6,main]
java.lang.NoClassDefFoundError: com/bulletphysics/collision/dispatch/CollisionConfiguration
	at com.jme3.bullet.BulletAppState.startPhysics(BulletAppState.java:164)
	at com.jme3.bullet.BulletAppState.stateAttached(BulletAppState.java:211)
	at com.jme3.app.state.AppStateManager.attach(AppStateManager.java:133)
	at jme3test.bullet.TestSimplePhysics.simpleInitApp(TestSimplePhysics.java:61)
	at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:220)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:130)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:211)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: com.bulletphysics.collision.dispatch.CollisionConfiguration
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 8 moreSEVERE: Uncaught exception thrown in Thread[jME3 Main,6,main]

Then I added jBullet.jar to the classpath, and now I am getting a new error,

Uncaught exception thrown in Thread[jME3 Main,6,main]
NoSuchMethodError: com.bulletphysics.dynamics.DiscreteDynamicsWorld.setPreTickCallback(Lcom/bulletphysics/dynamics/InternalTickCallback;)V

How can I solve the problem?

Hi

Try to also add this stack-alloc.jar .

Added stack-alloc.jar, but the error is still there.

SEVERE: Uncaught exception thrown in Thread[jME3 Main,6,main]
java.lang.NoSuchMethodError: com.bulletphysics.dynamics.DiscreteDynamicsWorld.setPreTickCallback(Lcom/bulletphysics/dynamics/InternalTickCallback;)V
	at com.jme3.bullet.PhysicsSpace.setTickCallback(PhysicsSpace.java:282)
	at com.jme3.bullet.PhysicsSpace.create(PhysicsSpace.java:215)
	at com.jme3.bullet.PhysicsSpace.<init>(PhysicsSpace.java:179)
	at com.jme3.bullet.BulletAppState.startPhysics(BulletAppState.java:164)
	at com.jme3.bullet.BulletAppState.stateAttached(BulletAppState.java:211)
	at com.jme3.app.state.AppStateManager.attach(AppStateManager.java:133)
	at jme3test.bullet.TestPhysicsReadWrite.simpleInitApp(TestPhysicsReadWrite.java:71)
	at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:220)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:130)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:211)
	at java.lang.Thread.run(Thread.java:745)

Ah, Sorry
same error occurred for me but adding those two libraries fixed it

Found the problem.

I was using jBullet.jar from the jBullet official website(jbullet.advel.cz).

But I should be using jBullet.jar & stack-alloc.jar found on jME github.

I searched for them on release downloads(i.e. jME 3.1 beta 1), but couldn’t find them. Are they included?

There’s currently an issue open regarding the jbullet dependencies:

The issue as become (I believe) not critical as the engine is moving further and further away from jbullet and closer to native bullet. jbullet is written in Java but is based off a very old version of bullet, while native bullet is based of newer revisions but is written in C++.

1 Like