Skip to content

TestCanvas crashes with LWJGL3 #1192

Closed

Description

@stephengold

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.

Activity

  1. stephengold commented on Sep 20, 2019

    @stephengold
    MemberAuthor

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

  2. added this to the LWJGLv3 Issues milestone on Sep 20, 2019
  3. tonihele commented on Jan 26, 2020

    @tonihele
    Contributor

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

  4. jseinturier commented on Jan 26, 2020

    @jseinturier
    Contributor

    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.

  5. stephengold commented on Jan 29, 2020

    @stephengold
    MemberAuthor

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

  6. stephengold commented on May 15, 2021

    @stephengold
    MemberAuthor

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

  7. stephengold commented on May 15, 2021

    @stephengold
    MemberAuthor

    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)
    
  8. stephengold commented on Jan 18, 2022

    @stephengold
    MemberAuthor

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

  9. stephengold commented on Jan 18, 2022

    @stephengold
    MemberAuthor

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

  10. pavly-gerges commented on May 21, 2022

    @pavly-gerges
    Contributor

    I will investigate into this.

  11. dcr31000 commented on Jun 19, 2022

    @dcr31000

    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 ?)

  12. pavly-gerges commented on Jun 19, 2022

    @pavly-gerges
    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.

  13. stephengold commented on Jun 19, 2022

    @stephengold
    MemberAuthor

    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/

  14. self-assigned this
    on Nov 20, 2022
  15. tonihele commented on Nov 20, 2022

    @tonihele
    Contributor

    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

  16. stephengold commented on Nov 21, 2022

    @stephengold
    MemberAuthor

    Thanks @tonihele . This looks promising.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions