Jme physics for JME 2.0 -> No physics implementation was registered nor found

Hello everyone



I have a problem with the jme physics for JME 2.0. The story is as follows. I already downloaded from SVN the latest source code of jme physics from http://code.google.com/p/jmephysics/ and I succesfully compiled it. Then I took that generated .jar file and I added it as a lib for my test project that has some physics basic testing (a box falling, and it already works perfect with JME 1.0). Then I succesfully compiled this test project and I already added the -Djava.library.path="libnatives" where the latest (from the mentioned SVN) odejava.dll is located, and of course I also added the latest (from the mentioned SVN) odejava-jni.jar, and when I run it, in the line

setPhysicsSpace( PhysicsSpace.create() );

I get this runtime error:



22/04/2009 11:30:41 AM com.jmex.physics.PhysicsSpace scanAvailableImplementations

INFO: Physics implementation 'com.jmex.physics.impl.physx.PhysXSpace$PhysXFactory' not present.

22/04/2009 11:30:41 AM com.jmex.physics.PhysicsSpace scanAvailableImplementations

INFO: Physics implementation 'com.jmex.physics.impl.ode.OdePhysicsSpace$OdeFactory' not present.

22/04/2009 11:30:41 AM com.jmex.physics.PhysicsSpace scanAvailableImplementations

INFO: Physics implementation 'com.jmex.physics.impl.joode.JoodePhysicsSpace$JoodeFactory' not present.

22/04/2009 11:30:41 AM com.jmex.physics.PhysicsSpace scanAvailableImplementations

INFO: Physics implementation 'com.jmex.physics.impl.jbullet.JBulletPhysicsSpace$JBulletFactory' not present.

22/04/2009 11:30:41 AM class prueba.HelloWorld start()

GRAVE: Exception in game loop

java.lang.IllegalStateException: No physics implementation was registered nor found!

        at com.jmex.physics.PhysicsSpace.create(PhysicsSpace.java:348)




Can someone help me? I mean I have read a lot of forums about jme-physics for JME 2.0 and I have followed all those indications, so I don't know what is happening. Please help,  I want jme physics to work with JME 2.0. Farewell.



Agustin

make sure -Djava.library.path is correctly set, i think you'll get that error if the .dll is not found

You'll need to use the odejava.jar if I'm not mistaken, not the odejava-jni.jar.

Umm nope (nymon and Core-Dump) I already had that configured, so that was not the solution. Hey everyone, I finally solved this problem on my own and for those lost souls who suffered with this I'm going to explain the solution. For those others who are lazy and don't want to compile jme physics for JME 2.0 then you can email me and I'll send you the .jar or if there is an option to publish it on the internet I would do it without any prob.


  1. First you have to download the source from http://code.google.com/p/jmephysics/source/checkout with SVN


  2. Then you have to create a project of type class library in netbeans (I used this IDE). You can create it anywhere in your pc


  3. Go to the downloaded source of step 1 and being on the root directory go to src and copy all its content and then paste it under the src folder of the project created in step 2.


  4. Go to the downloaded source of step 1 and on the root dir go to impl/ode/src and copy all its content and then paste it under the src folder of the project created in step 2. If it asks to overwrite click on Yes everything


  5. In the project of step 2, as a library (Add as a jar option in netbeans) add the odejava-jni.jar that already comes in svn/impl/ode/lib. And then with the same option add all the .jar libraries that come in the JME_2.0_Distribution.zip that you can download on http://code.google.com/p/jmonkeyengine/downloads/list


  6. Compile the project succesfully and now you have your .jar for physics in JME 2.0 (my jar is called JME2Physics.jar!)



    I was having that exception BECAUSE I didn't know I had to make step 4, I mean I wasn't including the source files for the IMPLEMENTATION!!! That is why the system never found any implementation of physics. And obviously don't forget that you have to add the -Djava.library.path for the natives and the odejava-jni.jar in the game/application that is going to use the JME2Physics.jar





    Feel free for questions or suggestions. I hope this can help you. Farewell.



    Agustin

    condeagustin@hotmail.com



    Colombia, the best country!!
condeagustin said:
For those others who are lazy and don't want to compile jme physics for JME 2.0 then you can email me and I'll send you the .jar or if there is an option to publish it on the internet I would do it without any prob.

I definitely am too lazy right now and would appreciate a odejava.jar :)
You can use https://www.box.net/ or http://www.mediafire.com/ .

I'm trying to test https://sourceforge.net/projects/projecteva/ and have the same problem "INFO: Physics implementation 'com.jmex.physics.impl.physx.PhysXSpace$PhysXFactory' not present." etc

Thanks!

the odejava-jni.jar and dll's / so's can be found here:

http://code.google.com/p/jmephysics/source/browse/#svn/trunk/impl/ode/lib

Core-Dump said:

the odejava-jni.jar [...]
odejava-jni.jar does not do the trick.. :(

and you did set -Djava.library.path  to the path containing the native ode library ?

Hello



I’m sorry for keep you waiting about the .jar. Here is the link where you can download it:

http://www.box.net/shared/kkqyv530gn



The file is called JME2Physics.jar and the is the physics that works perfect with JME2.0. I even tested it on mac, linux and windows and the physics works perfectly :D. Farewell



Agustin

Oh and this is the odejava-jni.jar that i’m using for JME 2.0 http://www.box.net/shared/ht9gynmgn3. If you need the native libs (for mac, windows and linux) for the physics to work in JME 2.0 just tell me and i will upload those too



Bye

Core-Dump said:

and you did set -Djava.library.path  to the path containing the native ode library ?
No, but if I do, the game window doesn't even open (because it doesn't find lwjgl for some reason...)

I simply run java -jar eva.jar, and in a subfolder called lib/ there are

$ ls
JPhysicsBuild.jar    gluegen-rt.dll        jinput-raw.dll  jogl_awt.dll      libodejava.jnilib  lwjgl.jar              swt.jar
JavaAccessBridge.dll  gluegen-rt.jar        jinput.jar      jogl_cg.dll        libodejava.so      lwjgl_util.jar        xstream-1.3.1.jar
OpenAL32.dll          jawtaccessbridge.dll  jogl.dll        jorbis-0.0.17.jar  libodejava64.so    lwjgl_util_applet.jar
fenggui-jme2.jar      jinput-dx8.dll        jogl.jar        junit-4.1.jar      lwjgl.dll          odejava-jni.jar

I'm on arch linux 64bit and get http://pastebin.com/f733857d3 :|

does that work ?


java -jar -Djava.library.path=./lib -cp ./lib/* eva.jar



instead of ./lib/*  you might list every single jar separated by ':'
condeagustin said:

Hello

I'm sorry for keep you waiting about the .jar. Here is the link where you can download it:
http://www.box.net/shared/kkqyv530gn

The file is called JME2Physics.jar and the is the physics that works perfect with JME2.0. I even tested it on mac, linux and windows and the physics works perfectly :D. Farewell

Agustin


I tried to use this file and get the same error! There is another thing i have to do?

Well you also need the odejava-jni.jar file. I uploaded that one too. With those 2 files the physics should work in JME 2.0

hello guys

i'm got an error here

altough i've already download all condeagustin said

and configure like this

-Djava.library.path = ./lib/native





Sep 21, 2009 3:46:01 PM com.jmex.physics.PhysicsSpace scanAvailableImplementations
WARNING: Failed to use physics implementation 'com.jmex.physics.impl.ode.OdePhysicsSpace$OdeFactory' due to Exception while creating factory: java.lang.VerifyError: class com.jmex.physics.PhysicsCollisionGeometry overrides final method findPick.(Lcom/jme/math/Ray;Lcom/jme/intersection/PickResults;)V
java.lang.VerifyError: class com.jmex.physics.PhysicsCollisionGeometry overrides final method findPick.(Lcom/jme/math/Ray;Lcom/jme/intersection/PickResults;)V
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
   at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
   at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
   at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
   at com.jmex.physics.impl.ode.OdePhysicsSpace$OdeFactory.<init>(OdePhysicsSpace.java:173)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
   at com.jmex.physics.PhysicsSpace.scanAvailableImplementations(PhysicsSpace.java:366)
   at com.jmex.physics.PhysicsSpace.create(PhysicsSpace.java:340)
   at com.jmex.physics.util.SimplePhysicsGame.initSystem(SimplePhysicsGame.java:91)
   at com.jme.app.BaseGame.start(BaseGame.java:70)
   at main.Lesson1.main(Lesson1.java:36)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Sep 21, 2009 3:46:01 PM class main.Lesson1 start()
SEVERE: Exception in game loop
java.lang.IllegalStateException: No physics implementation was registered nor found!
   at com.jmex.physics.PhysicsSpace.create(PhysicsSpace.java:348)
   at com.jmex.physics.util.SimplePhysicsGame.initSystem(SimplePhysicsGame.java:91)
   at com.jme.app.BaseGame.start(BaseGame.java:70)
   at main.Lesson1.main(Lesson1.java:36)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)

I had the same problem. Did you fix it?



I fixed it removing all "final" methods from those functions in "com/jme/scene/Spatial.java" (so physics2 can override them)

For that, you need to use the source of JME instead of the library. Clean and Build again the project and should work!!



Do someone knows why those functions are "final"? is there any special reason for that?



Cheers.

hello… im new to jme physics… im getting the same error as above… i tried removing all d final methods … still not working… plz help :frowning:

sananoor.blr said:

hello.. im new to jme physics.. im getting the same error as above.. i tried removing all d final methods .. still not working.. plz help :(

Please give more information. Are you using a 64bit windows system? If yes, you will have to open the Java Preferences and select 32bit Java as the preferred one, since ODE is compiled for 32bit only.

im trying to compile one of those jme demo it gives me same error as well

guys plz help.

what is wrong guys please tell me?

i got this



init:

deps-jar:

compile:

run:

27-Oct-2010 16:44:47 com.jme.input.joystick.DummyJoystickInput

INFO: Joystick support is disabled

27-Oct-2010 16:44:47 com.jme.system.lwjgl.LWJGLDisplaySystem

INFO: LWJGL Display System created.

27-Oct-2010 16:44:47 com.jme.renderer.lwjgl.LWJGLRenderer

INFO: LWJGLRenderer created. W: 1,024 H: 768 Version: 2.1.0

27-Oct-2010 16:44:48 com.jme.renderer.AbstractCamera

INFO: Camera created.

27-Oct-2010 16:44:48 com.jmex.audio.openal.OpenALSystem setupSourcePool

INFO: max source channels: 32

27-Oct-2010 16:44:48 com.jmex.game.state.GameStateManager create

INFO: Created GameStateManager

27-Oct-2010 16:44:48 com.jme.util.lwjgl.LWJGLTimer

INFO: Timer resolution: 1000 ticks per second

27-Oct-2010 16:44:50 com.jmex.physics.PhysicsSpace scanAvailableImplementations

WARNING: Failed to use physics implementation ‘com.jmex.physics.impl.ode.OdePhysicsSpace$OdeFactory’ due to Exception while creating factory: java.lang.VerifyError: class com.jmex.physics.PhysicsCollisionGeometry overrides final method findPick.(Lcom/jme/math/Ray;Lcom/jme/intersection/PickResults;)V

java.lang.VerifyError: class com.jmex.physics.PhysicsCollisionGeometry overrides final method findPick.(Lcom/jme/math/Ray;Lcom/jme/intersection/PickResults;)V

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:620)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)

at java.net.URLClassLoader.access$000(URLClassLoader.java:56)

at java.net.URLClassLoader$1.run(URLClassLoader.java:195)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)

at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:620)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)

at java.net.URLClassLoader.access$000(URLClassLoader.java:56)

at java.net.URLClassLoader$1.run(URLClassLoader.java:195)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)

at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:620)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)

at java.net.URLClassLoader.access$000(URLClassLoader.java:56)

at java.net.URLClassLoader$1.run(URLClassLoader.java:195)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)

at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

at com.jmex.physics.impl.ode.OdePhysicsSpace$OdeFactory.(OdePhysicsSpace.java:173)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

at com.jmex.physics.PhysicsSpace.scanAvailableImplementations(PhysicsSpace.java:366)

at com.jmex.physics.PhysicsSpace.create(PhysicsSpace.java:340)

at com.jmex.physics.util.states.PhysicsGameState.(PhysicsGameState.java:48)

at com.jmedemos.stardust.gamestates.InGameState.(InGameState.java:125)

at com.jmedemos.stardust.core.Start.main(Start.java:96)

27-Oct-2010 16:44:50 com.jmedemos.stardust.core.SDExceptionHandler uncaughtException

SEVERE: caucht uncaught exception, quitting game

27-Oct-2010 16:44:50 com.jmedemos.stardust.core.SDExceptionHandler uncaughtException

SEVERE: No physics implementation was registered nor found!

java.lang.IllegalStateException: No physics implementation was registered nor found!

at com.jmex.physics.PhysicsSpace.create(PhysicsSpace.java:348)

at com.jmex.physics.util.states.PhysicsGameState.(PhysicsGameState.java:48)

at com.jmedemos.stardust.gamestates.InGameState.(InGameState.java:125)

at com.jmedemos.stardust.core.Start.main(Start.java:96)

java.lang.IllegalStateException: Shutdown in progress

at java.lang.ApplicationShutdownHooks.remove(ApplicationShutdownHooks.java:55)

at java.lang.Runtime.removeShutdownHook(Runtime.java:220)

at org.lwjgl.opengl.Display$4.run(Display.java:720)

at java.security.AccessController.doPrivileged(Native Method)

at org.lwjgl.opengl.Display.removeShutdownHook(Display.java:718)

at org.lwjgl.opengl.Display.destroy(Display.java:935)

at com.jme.system.lwjgl.LWJGLDisplaySystem.close(LWJGLDisplaySystem.java:313)

at com.jmex.game.StandardGame.quit(StandardGame.java:452)

at com.jmex.game.StandardGame.run(StandardGame.java:276)

at java.lang.Thread.run(Thread.java:619)

Java Result: -1

BUILD SUCCESSFUL (total time: 3 seconds)