Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestCanvas crashes with LWJGL3 #1192

Closed
stephengold opened this issue Sep 20, 2019 · 14 comments · Fixed by #1868
Closed

TestCanvas crashes with LWJGL3 #1192

stephengold opened this issue Sep 20, 2019 · 14 comments · Fixed by #1868
Assignees

Comments

@stephengold
Copy link
Member

Current master branch on Windows:

INFO JmeDesktopSystem 10:35:35 AM Running on jMonkeyEngine 3.3-6918
 * Branch: master
 * Git Hash: 46a52af
 * Build Date: 2019-09-20
SEVERE JmeDesktopSystem 10:35:35 AM CRITICAL ERROR: Context class is missing!
Make sure jme3_lwjgl-ogl is on the classpath.
java.lang.ClassNotFoundException: com.jme3.system.lwjgl.LwjglCanvas
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at com.jme3.system.JmeDesktopSystem.newContextLwjgl(JmeDesktopSystem.java:196)
	at com.jme3.system.JmeDesktopSystem.newContext(JmeDesktopSystem.java:279)
	at com.jme3.system.JmeSystem.newContext(JmeSystem.java:159)
	at com.jme3.app.LegacyApplication.createCanvas(LegacyApplication.java:510)
	at jme3test.awt.TestCanvas.createCanvas(TestCanvas.java:217)
	at jme3test.awt.TestCanvas.main(TestCanvas.java:248)
Exception in thread "main" java.lang.NullPointerException
	at com.jme3.system.JmeDesktopSystem.newContext(JmeDesktopSystem.java:280)
	at com.jme3.system.JmeSystem.newContext(JmeSystem.java:159)
	at com.jme3.app.LegacyApplication.createCanvas(LegacyApplication.java:510)
	at jme3test.awt.TestCanvas.createCanvas(TestCanvas.java:217)
	at jme3test.awt.TestCanvas.main(TestCanvas.java:248)

The same test app works fine with LWJGL2 on Windows.

I'm not sure what ever happened to jme3_lwjgl-ogl.

@stephengold
Copy link
Member Author

Similar crash with LWJGL3 on Linux. How hard would it be to implement LwjglCanvas for LWJGL3?

@stephengold stephengold added this to the LWJGLv3 Issues milestone Sep 20, 2019
@tonihele
Copy link
Contributor

I guess it requires similar tactic than https://github.com/LWJGLX/lwjgl3-awt.

@jseinturier
Copy link
Contributor

jseinturier commented Jan 26, 2020

Hello.

I've submitted the PR #1150 to solve this problem but it is not accepted at this time.

The PR #1150 enables to render a Jmonkey scene within any AWT component and is independent from LWJGL version.

@stephengold
Copy link
Member Author

@jseinturier Do you understand why 1150 hasn't been integrated yet?

@stephengold
Copy link
Member Author

This issue is still present in JME v3.4.0-beta4.

@stephengold
Copy link
Member Author

TestSafeCanvas also crashes, with a very similar stack trace:

May 14, 2021 10:23:49 PM com.jme3.system.JmeDesktopSystem initialize
INFO: Running on jMonkeyEngine 3.4.0-SNAPSHOT
 * Branch: v3.4
 * Git Hash: 7b82356
 * Build Date: 2021-05-14
May 14, 2021 10:23:49 PM com.jme3.system.JmeDesktopSystem newContextLwjgl
SEVERE: CRITICAL ERROR: Context class is missing!
Make sure jme3_lwjgl-ogl is on the classpath.
java.lang.ClassNotFoundException: com.jme3.system.lwjgl.LwjglCanvas
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at com.jme3.system.JmeDesktopSystem.newContextLwjgl(JmeDesktopSystem.java:199)
	at com.jme3.system.JmeDesktopSystem.newContext(JmeDesktopSystem.java:275)
	at com.jme3.system.JmeSystem.newContext(JmeSystem.java:165)
	at com.jme3.app.LegacyApplication.createCanvas(LegacyApplication.java:542)
	at jme3test.awt.TestSafeCanvas.main(TestSafeCanvas.java:24)

Exception in thread "main" java.lang.NullPointerException
	at com.jme3.system.JmeDesktopSystem.newContext(JmeDesktopSystem.java:276)
	at com.jme3.system.JmeSystem.newContext(JmeSystem.java:165)
	at com.jme3.app.LegacyApplication.createCanvas(LegacyApplication.java:542)
	at jme3test.awt.TestSafeCanvas.main(TestSafeCanvas.java:24)

@stephengold
Copy link
Member Author

Still an issue in "master" branch as of January 2022.

@stephengold
Copy link
Member Author

Caused by the lack of a "com.jme3.system.lwjgl.LwjglCanvas" class in jme3-lwjgl3, obviously.

@pavly-gerges
Copy link
Contributor

I will investigate into this.

@dcr31000
Copy link

I'm beginning (and start learning) with jMonkeyEngine and got this issue.
Do you have a workaround to start developing ? (Maybe use a previous version ? jme2 ?)

@pavly-gerges
Copy link
Contributor

I'm beginning (and start learning) with jMonkeyEngine and got this issue. Do you have a workaround to start developing ? (Maybe use a previous version ? jme2 ?)

Just use lwjgl3 native window GLFW, or lwjgl-2 if you are using swing/AWT and want to utilize jme3 app within a swing application.

@stephengold
Copy link
Member Author

I'm beginning (and start learning) with jMonkeyEngine and got this issue.

For support, I recommend joining the JMonkeyEngine forum and asking your questions there: https://hub.jmonkeyengine.org/

@tonihele tonihele self-assigned this Nov 20, 2022
@tonihele
Copy link
Contributor

tonihele commented Nov 20, 2022

I can try to fix this. I already created an awful working demo. I'll get it to somewhat nice shape. Try to get feature parity with the LWJGL 2 one and make a PR. Then at least it is implemented and can be improved upon later.

Pic or didn't happen:
image

@stephengold
Copy link
Member Author

Thanks @tonihele . This looks promising.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants