IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

OpenGL Discussion :

JOGL "Unable to initialize JAWT"


Sujet :

OpenGL

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Invité
    Invité(e)
    Par défaut JOGL "Unable to initialize JAWT"
    Je bloque sur l'initialisation de JOGL.
    J'essaye de crée un GLCanvas, et de l'ajouter à ma fenêtre.

    Je récupère une erreur "Unable to initialize JAWT".
    Cela se produit non pas à l'instanciation du GLCanvas, mais au moment où je l'ajoute à ma fenêtre.
    Les réponses sur Google ne m'ont pas aidé.

    J'utilise :
    - Java 6
    - JOGL 2
    - Windows 7 x64

    (Je vais essayer de sortir un code propre pour tester)

  2. #2
    Invité
    Invité(e)
    Par défaut
    à noter que je n'avais pas de problème avec la version 1 de JOGL.

  3. #3
    Invité
    Invité(e)
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
     
    public class TestJOGL
    {
        public static void main(String[] args)
        {
            JFrame frame = new JFrame();
            frame.setSize(640, 480);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     
            GLCanvas canvas = new GLCanvas(new GLCapabilities(GLProfile.get(GLProfile.GL2)));
            frame.add(canvas);
     
            frame.setVisible(true);
        }
    }
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
     
    Exception in thread "main" java.lang.RuntimeException: Unable to initialize JAWT
        at com.sun.nativewindow.impl.jawt.JAWT$1.run(JAWT.java:100)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.nativewindow.impl.jawt.JAWT.getJAWT(JAWT.java:95)
        at com.sun.nativewindow.impl.jawt.windows.WindowsJAWTWindow.lockSurface(WindowsJAWTWindow.java:69)
        at com.sun.opengl.impl.GLDrawableImpl.lockSurface(GLDrawableImpl.java:130)
        at com.sun.opengl.impl.windows.wgl.WindowsWGLDrawable.setRealized(WindowsWGLDrawable.java:70)
        at javax.media.opengl.awt.GLCanvas.addNotify(GLCanvas.java:413)
        at java.awt.Container.addNotify(Unknown Source)
        at javax.swing.JComponent.addNotify(Unknown Source)
        at java.awt.Container.addNotify(Unknown Source)
        at javax.swing.JComponent.addNotify(Unknown Source)
        at java.awt.Container.addNotify(Unknown Source)
        at javax.swing.JComponent.addNotify(Unknown Source)
        at javax.swing.JRootPane.addNotify(Unknown Source)
        at java.awt.Container.addNotify(Unknown Source)
        at java.awt.Window.addNotify(Unknown Source)
        at java.awt.Frame.addNotify(Unknown Source)
        at java.awt.Window.show(Unknown Source)
        at java.awt.Component.show(Unknown Source)
        at java.awt.Component.setVisible(Unknown Source)
        at java.awt.Window.setVisible(Unknown Source)
        at TestJOGL.main(TestJOGL.java:17)
    java.lang.Exception: JAWT Surface previously locked by main
        at com.sun.nativewindow.impl.jawt.JAWTWindow.lockSurface(JAWTWindow.java:106)
        at com.sun.nativewindow.impl.jawt.windows.WindowsJAWTWindow.lockSurface(WindowsJAWTWindow.java:60)
        at com.sun.opengl.impl.GLDrawableImpl.lockSurface(GLDrawableImpl.java:130)
        at com.sun.opengl.impl.windows.wgl.WindowsWGLDrawable.setRealized(WindowsWGLDrawable.java:70)
        at javax.media.opengl.awt.GLCanvas.addNotify(GLCanvas.java:413)
        at java.awt.Container.addNotify(Unknown Source)
        at javax.swing.JComponent.addNotify(Unknown Source)
        at java.awt.Container.addNotify(Unknown Source)
        at javax.swing.JComponent.addNotify(Unknown Source)
        at java.awt.Container.addNotify(Unknown Source)
        at javax.swing.JComponent.addNotify(Unknown Source)
        at javax.swing.JRootPane.addNotify(Unknown Source)
        at java.awt.Container.addNotify(Unknown Source)
        at java.awt.Window.addNotify(Unknown Source)
        at java.awt.Frame.addNotify(Unknown Source)
        at java.awt.Window.show(Unknown Source)
        at java.awt.Component.show(Unknown Source)
        at java.awt.Component.setVisible(Unknown Source)
        at java.awt.Window.setVisible(Unknown Source)
        at TestJOGL.main(TestJOGL.java:17)
    Exception in thread "AWT-EventQueue-0" javax.media.nativewindow.NativeWindowException: JAWT Surface already locked - AWT-EventQueue-0 JAWT-Window[windowHandle 0x0, surfaceHandle 0x0, pos 0/0, size 624x442, visible true, locked true,
        config class javax.media.nativewindow.awt.AWTGraphicsConfiguration[class javax.media.nativewindow.awt.AWTGraphicsScreen[class javax.media.nativewindow.awt.AWTGraphicsDevice[type AWT, awtDevice D3DGraphicsDevice[screen=0], handle 0x0], idx 0],
        chosen    GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 0, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false],
        requested GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 0, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false],
        D3DGraphicsConfig[dev=D3DGraphicsDevice[screen=0],pixfmt=0],
        encapsulated WindowsWGLGraphicsConfiguration[class javax.media.nativewindow.DefaultGraphicsScreen[class javax.media.nativewindow.windows.WindowsGraphicsDevice[type Windows, handle 0x0], idx 0], pfdID -1, wglChoosen false,
        requested GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 0, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false],
        chosen    GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 0, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false]]],
        wrappedWindow AWT-GLCanvas[ class javax.media.nativewindow.awt.AWTGraphicsConfiguration[class javax.media.nativewindow.awt.AWTGraphicsScreen[class javax.media.nativewindow.awt.AWTGraphicsDevice[type AWT, awtDevice D3DGraphicsDevice[screen=0], handle 0x0], idx 0],
        chosen    GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 0, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false],
        requested GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 0, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false],
        D3DGraphicsConfig[dev=D3DGraphicsDevice[screen=0],pixfmt=0],
        encapsulated WindowsWGLGraphicsConfiguration[class javax.media.nativewindow.DefaultGraphicsScreen[class javax.media.nativewindow.windows.WindowsGraphicsDevice[type Windows, handle 0x0], idx 0], pfdID -1, wglChoosen false,
        requested GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 0, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false],
        chosen    GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 0, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false]]], com.sun.opengl.impl.windows.wgl.WindowsOnscreenWGLDrawable, GLEventListeners num 0 []]]
        at com.sun.nativewindow.impl.jawt.JAWTWindow.lockSurface(JAWTWindow.java:104)
        at com.sun.nativewindow.impl.jawt.windows.WindowsJAWTWindow.lockSurface(WindowsJAWTWindow.java:60)
        at com.sun.opengl.impl.GLDrawableImpl.lockSurface(GLDrawableImpl.java:130)
        at com.sun.opengl.impl.windows.wgl.WindowsOnscreenWGLContext.makeCurrentImpl(WindowsOnscreenWGLContext.java:59)
        at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:120)
        at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:141)
        at javax.media.opengl.awt.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:553)
        at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:290)
        at javax.media.opengl.awt.GLCanvas.paint(GLCanvas.java:368)
        at sun.awt.RepaintArea.paintComponent(Unknown Source)
        at sun.awt.RepaintArea.paint(Unknown Source)
        at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)

  4. #4
    Invité
    Invité(e)
    Par défaut
    un code plus complet (ça plante pareil ceci dit)
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
     
    public class TestJOGL
    {
        public static void main(String[] args)
        {
            JFrame frame = new JFrame();
            frame.setSize(640, 480);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            GLCanvas canvas = new GLCanvas();
            canvas.addGLEventListener(new GLEventListener()
            {
                public void reshape(GLAutoDrawable arg0, int arg1, int arg2, int arg3, int arg4)
                {
                }
     
                public void init(GLAutoDrawable arg0)
                {
                }
     
                public void dispose(GLAutoDrawable arg0)
                {
                }
     
                public void display(GLAutoDrawable arg0)
                {
                }
            });
            Animator animator = new Animator(canvas);
            frame.add(canvas);
            frame.setVisible(true);
        }
    }

  5. #5
    Invité
    Invité(e)
    Par défaut
    Bonsoir

    C'est en effet un bogue de JOGL 2 qui est actuellement encore en version bêta. Utilise JOGL 1.1.1a en attendant que ce soit corrigé. Je vais prévenir les développeurs qui maintiennent JOGL immédiatement.

  6. #6
    Invité
    Invité(e)
    Par défaut
    Merci bien !

    Mais comment se fait il que ce bug ne soit pas déjà réglé ?
    Il intervient très tôt dans la conception de mon programme...
    Ce n'est pas quelques chose "d'avancé" ...

    Et j'ai l'impression que de nombreuses personnes se servent très bien de JOGL 2 sans avoir ce soucis !

    Encore une chose : sur JOGL 1, il était possible de charger une texture depuis une BufferedImage.
    Sur JOGL 2, ce n'est plus possible !
    Il faut soit passer par un InputStream, ou un fichier...

Discussions similaires

  1. [EJB Timer] Unable to initialize EJB
    Par BRAUKRIS dans le forum Java EE
    Réponses: 1
    Dernier message: 26/09/2007, 19h00
  2. PHP Startup: XMLRAD: Unable to initialize module
    Par Elmer1597 dans le forum XMLRAD
    Réponses: 1
    Dernier message: 26/02/2007, 09h21

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo