[SOLVED] java.lang.IllegalStateException: Pointer already mapped (OpenVR 3.3.2))

If I try to start my VR Application, this error occurs:
On v3.2.2 everything worked fine

Exception in thread “main” java.lang.IllegalStateException: Pointer native@0x7ff9bd67ee20 already mapped to Proxy interface to native function@0x7ff9bd67ee20 (com.jme3.system.jopenvr.VR_IVRSystem_FnTable$ComputeDistortion_callback).
Native code may be re-using a default function pointer, in which case you may need to use a common Callback class wherever the function pointer is reused.
at com.sun.jna.CallbackReference.getCallback(CallbackReference.java:148)
at com.sun.jna.CallbackReference.getCallback(CallbackReference.java:131)
at com.sun.jna.Pointer.getValue(Pointer.java:425)
at com.sun.jna.Structure.readField(Structure.java:720)
at com.sun.jna.Structure.read(Structure.java:580)
at com.jme3.input.vr.openvr.OpenVR.initialize(OpenVR.java:202)
at com.jme3.app.VREnvironment.initialize(VREnvironment.java:482)

My code:

AppSettings settings = new AppSettings(true);
settings.put(VRConstants.SETTING_VRAPI, VRConstants.SETTING_VRAPI_OPENVR_VALUE); settings.put(VRConstants.SETTING_ENABLE_MIRROR_WINDOW, true);
VREnvironment env = new VREnvironment(settings);
if (env.isInitialized()){
VRAppState vrAppState = new VRAppState(settings, env);
vrAppState.setMirrorWindowSize(1024, 800);
Main app = new Main(vrAppState);

1 Like

Try using the lwjgl backend for openvr. You will need lwjgl3 for that to work though. In your libraries, replace jme3-lwjgl with jme3-lwjgl3 and then at the line where you select the OpenVR as the vr api to use, use the OpenVR lwjgl option.

That fixed it for me.


Thank you, it worked

1 Like