JBullet causing crash on initialization

Hello. I’m using basic collision detection: only some moving node and several static objects on plain field.
While I’m doing init of JBullet (as described in tutorial for collision detection), it causes some weird crash. Without it everything runs nice. My initialization code is:

        bulletAppState = new BulletAppState();
        stateManager.attach(bulletAppState);

Which causes this failure:

Execution protection violation
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x20000000, pid=4464, tid=0x0000124c
#
# JRE version: Java(TM) SE Runtime Environment (8.0_111-b14) (build 1.8.0_111-b14)
# Java VM: Java HotSpot(TM) Client VM (25.111-b14 mixed mode windows-x86 )
# Problematic frame:
# C  0x20000000
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# E:\GAMES\MYGAME\JMonkeyPrj\MyJMonkeyGame\hs_err_pid4464.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
AL lib: (EE) alc_cleanup: 1 device not closed

That log file contains pretty much the same, but also includes machine registers dump, inmemory stack dump, and some fragments of binary memory dumps (not useful, for Java).

What’s wrong? I don’t even know what question should I ask Google.
Probably there’s a built-in geometrical collision detection frameworks in JME? (in case if this problem persists)

Seems like people had the same problem:

and here:


I have all the required libraries included.
I run Win7, x86.

  1. You are using native-bullet and not jBullet. In case you have both in your project it is pure luck which is picked first, so either remove bullet-native or jbullet (keep jme3-bullet)

Not useful for Java but useful for finding the bug in bullet-native where the crash occured, because Java code can’t actually crash the jvm, that is a null pointer (or something) in jni.

jme3-bullet-native contains the dll files only, so it’s important only on runtime. If I remove it, I keep getting the same error.
Adding Jbullet.jar and the stack-alloc.jar does not help too.
The project would not compile if I remove jme3-bullet.

These are only these two bullet-related libraries available.

jbullet is deprecated so I suggest you to move to native bullet (if you are using jme3.0 you can stay at jbullet but if you find a bug you wont find much help :S ). So, from bullet you just need to have: jme3-bullet and the natives depending where you are executing your game.

Once you make sure those are your libs, try again. If it doesn’t work, try the tests (sdk → new project → JME3 → JME3 Tests). You’ll find there some bullet tests.

If those fails, post the full log here.

I’ve created new project in SDK using a JME3 Tests template. I’ve located jme3test.bullet package in project tree, from context menu recompiled a single file TestBrickWall.java, and launched a single file.
So far so good:

ant -f E:\\GAMES\\MYGAME\\JMONKEY\\Jme3Tests\\JmeTests -Djavac.includes=jme3test/bullet/TestBrickWall.java -Dnb.internal.action.name=run.single -Drun.class=jme3test.bullet.TestBrickWall run-single
init:
Deleting: E:\GAMES\MYGAME\JMONKEY\Jme3Tests\JmeTests\build\built-jar.properties
deps-jar:
Updating property file: E:\GAMES\MYGAME\JMONKEY\Jme3Tests\JmeTests\build\built-jar.properties
Compiling 1 source file to E:\GAMES\MYGAME\JMONKEY\Jme3Tests\JmeTests\build\classes
Note: E:\GAMES\MYGAME\JMONKEY\Jme3Tests\JmeTests\src\jme3test\bullet\TestBrickWall.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
compile-single:
run-single:

INFO: Running on jMonkeyEngine 3.1-stable
 * Branch: HEAD
 * Git Hash: af04bf9
 * Build Date: 2017-02-19

There are some records about my system, nothing interesting. And here is the place where it has gone wrong:

2017 11:45:31 AM com.jme3.bullet.BulletAppState startPhysicsOnExecutor
SEVERE: null
java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: com/bulletphysics/collision/dispatch/CollisionConfiguration
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.util.concurrent.FutureTask.get(FutureTask.java:192)
	at com.jme3.bullet.BulletAppState.startPhysicsOnExecutor(BulletAppState.java:121)
	at com.jme3.bullet.BulletAppState.startPhysics(BulletAppState.java:162)
	at com.jme3.bullet.BulletAppState.stateAttached(BulletAppState.java:211)
	at com.jme3.app.state.AppStateManager.attach(AppStateManager.java:133)
	at jme3test.bullet.TestBrickWall.simpleInitApp(TestBrickWall.java:88)
	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.NoClassDefFoundError: com/bulletphysics/collision/dispatch/CollisionConfiguration
	at com.jme3.bullet.BulletAppState$1.call(BulletAppState.java:115)
	at com.jme3.bullet.BulletAppState$1.call(BulletAppState.java:112)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	... 1 more
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 more

2017 11:45:31 AM com.jme3.app.LegacyApplication handleError
SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main]
java.lang.NullPointerException
	at com.jme3.bullet.BulletAppState.startPhysics(BulletAppState.java:166)
	at com.jme3.bullet.BulletAppState.stateAttached(BulletAppState.java:211)
	at com.jme3.app.state.AppStateManager.attach(AppStateManager.java:133)
	at jme3test.bullet.TestBrickWall.simpleInitApp(TestBrickWall.java:88)
	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)

TestBrickWall.java:88 is the place where bulletAppState is being added.