Jogl 2 stops working on Mac after Java7 update 55

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Jogl 2 stops working on Mac after Java7 update 55

abhiit61@gmail.com
We have used jogl2 api in our project. After Java7u55 we are facing following exception on Mac.

RunnableTask.run(): A catched exception occured on thread AWT-AppKit: RunnableTask[executed true, tTotal 5 ms, tExec 4 ms, tQueue 1 ms, attachment null, throwable java.lang.NullPointerException]
java.lang.NullPointerException
        at sun.awt.SunToolkit.getSystemEventQueueImplPP(SunToolkit.java:1012)
        at sun.awt.SunToolkit.getSystemEventQueueImplPP(SunToolkit.java:1008)
        at sun.awt.SunToolkit.getSystemEventQueueImpl(SunToolkit.java:1003)
        at java.awt.Toolkit.getEventQueue(Toolkit.java:1730)
        at java.awt.Component.repaint(Component.java:3386)
        at java.awt.Component.repaint(Component.java:3286)
        at com.jogamp.nativewindow.awt.JAWTWindow.attachSurfaceLayer(JAWTWindow.java:235)
        at jogamp.opengl.macosx.cgl.MacOSXCGLContext$NSOpenGLImpl$
AttachNSOpenGLLayer.run(MacOSXCGLContext.java:666)
        at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:95)

Can any one please help me to figure out this issue?

Thanks,
Abhishek
Reply | Threaded
Open this post in threaded view
|

Re: Jogl 2 stops working on Mac after Java7 update 55

gouessej
Administrator
Hi

Please be more precise, use the very latest version (JOGL 2.1.5-01) and try to reproduce this bug with a very simple example (you can use the one I posted on the official JOGL Wikipedia page).

Moreover, your stack trace reminds a bug of AWT, you can use this workaround:
http://stackoverflow.com/questions/17275259/nullpointerexception-in-invokelater-while-running-through-java-webstart/20102779#20102779

If you use Java3D, update it now, it's fixed in the Java3D 1.6.0-pre10 as I indicated in my tutorial.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Jogl 2 stops working on Mac after Java7 update 55

abhiit61@gmail.com
Thanks for the reply.

Actually I can't use the new version of jogl as there are many dependency with the other api in the project. It will require large number of changes. We are using JOGL 2.0 in out project.

We have not used java3d in our project. We are rendering the 3D objects using jmonkey project in a Canvas. But before the canvas attached to the frame, it throws exception.
Reply | Threaded
Open this post in threaded view
|

Re: Jogl 2 stops working on Mac after Java7 update 55

gouessej
Administrator
At first, the workaround I suggested should be enough even with JOGL 2.0. I'm really sorry but we don't backport bug fixes, only the very latest version (2.1.5-01) is supported. The JOGL renderer for JMonkeyEngine 3 that I ported to JOGL 2 works flawlessly with the latest version, I remember I tested it with JOGL 2.1.3 several months ago. The very latest source code of JMonkeyEngine 3 available on Github uses at least JOGL 2.1.4 (this is indicated in the Gradle script).

You can't complain about bugs and go on using obsolete pieces of softwares. I don't think switching from JOGL 2.0 to JOGL 2.1.5-01 would require lots of changes. Please let me know which API(s) require(s) such changes.

Your stack trace is the result of a bug within AWT in Oracle or Apple Java. The JogAmp community isn't responsible for the maintenance of this toolkit which is part of Java SE. Someone else included the same workaround in Java3D, I shouldn't call that a bug fix.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Jogl 2 stops working on Mac after Java7 update 55

Sven Gothel
Administrator
In reply to this post by gouessej
On 05/06/2014 01:27 PM, gouessej [via jogamp] wrote:

> Hi
>
> Please be more precise, use the very latest version (JOGL 2.1.5-01) and try to
> reproduce this bug with a very simple example (you can use the one I posted on
> the official JOGL Wikipedia page).
>
> Moreover, your stack trace reminds a bug of AWT, you can use this workaround:
> http://stackoverflow.com/questions/17275259/nullpointerexception-in-invokelater-while-running-through-java-webstart/20102779#20102779
>
> If you use Java3D, update it now, it's fixed in the Java3D 1.6.0-pre10 as I
> indicated in my tutorial.
This seems to be reported here as well (JOGL)
  <https://jogamp.org/bugzilla/show_bug.cgi?id=1004>

Maybe we can copy the _workaround_ applied to Java3D to JOGL's JAWTWindow ?
  <https://jogamp.org/bugzilla/show_bug.cgi?id=983#c9>

Summarized and working from here:
  <https://jogamp.org/bugzilla/show_bug.cgi?id=1004#c1>

~Sven



signature.asc (894 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Jogl 2 stops working on Mac after Java7 update 55

gouessej
Administrator
In my humble opinion, we'll need another minor version with some bug fixes before switching to JOGL 2.2. What about JOGL 2.1.6?

Edit.: Another aggregated build with this fix would be enough, wouldn't it?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Jogl 2 stops working on Mac after Java7 update 55

Abhi
Hello,

I tried the following workaround inside JOGL code. The JOGL now works properly in our project.
http://stackoverflow.com/questions/17275259/nullpointerexception-in-invokelater-while-running-through-java-webstart/20102779#20102779

Thanks a lot guys :).
Reply | Threaded
Open this post in threaded view
|

Re: Jogl 2 stops working on Mac after Java7 update 55

gouessej
Administrator
You're welcome. Where did you put it exactly within JOGL? If you use the very latest autobuild, it should no longer be necessary.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Jogl 2 stops working on Mac after Java7 update 55

Abhi
Hi,

I used the workaround at com.jogamp.nativewindow.awt.JAWTWindow.attachSurfaceLayer(JAWTWindow.java:235). Find below the code.

----------------------------------------------------------------------------------------------------------------------
  @Override
  public final void attachSurfaceLayer(final long layerHandle) throws NativeWindowException {
      if( !isOffscreenLayerSurfaceEnabled() ) {
          throw new NativeWindowException("Not an offscreen layer surface");
      }
      if(DEBUG) {
        System.err.println("JAWTWindow.attachSurfaceHandle: "+toHexString(layerHandle) + ", bounds "+bounds);
      }
      attachSurfaceLayerImpl(layerHandle);
      offscreenSurfaceLayer = layerHandle;
     
      // workaround of Java7u55 JOGL crash issue
      if(AppContext.getAppContext() == null){
            SunToolkit.createNewAppContext();
      }

      component.repaint();
  }
------------------------------------------------------------------------------------------------------------------------

As it was throwing exception at component.repaint(), I just put that workaround before it.

I tried using the latest JOGL but it didn't work in my project. So I have to make chnages in JOGL2.0.2 that is used in our project.
Reply | Threaded
Open this post in threaded view
|

Re: Jogl 2 stops working on Mac after Java7 update 55

gouessej
Administrator
Abhi wrote
Hi,

I used the workaround at com.jogamp.nativewindow.awt.JAWTWindow.attachSurfaceLayer(JAWTWindow.java:235). Find below the code.

----------------------------------------------------------------------------------------------------------------------
  @Override
  public final void attachSurfaceLayer(final long layerHandle) throws NativeWindowException {
      if( !isOffscreenLayerSurfaceEnabled() ) {
          throw new NativeWindowException("Not an offscreen layer surface");
      }
      if(DEBUG) {
        System.err.println("JAWTWindow.attachSurfaceHandle: "+toHexString(layerHandle) + ", bounds "+bounds);
      }
      attachSurfaceLayerImpl(layerHandle);
      offscreenSurfaceLayer = layerHandle;
     
      // workaround of Java7u55 JOGL crash issue
      if(AppContext.getAppContext() == null){
            SunToolkit.createNewAppContext();
      }

      component.repaint();
  }
------------------------------------------------------------------------------------------------------------------------

As it was throwing exception at component.repaint(), I just put that workaround before it.
Thanks.

Abhi wrote
I tried using the latest JOGL but it didn't work in my project. So I have to make chnages in JOGL2.0.2 that is used in our project.
I assume you won't backport all bug fixes and workaround from JOGL 2.1.5 to JOGL 2.0. Therefore, please indicate which dependencies don't work with JOGL 2.1.5 to give me a chance to fix that as soon as possible (if they are open source). If you go on using an obsolete version, you'll be bothered by some other bugs and you'll have to switch later. The more you wait the more you increase your "technical" debt and an unmaintained version of JOGL shouldn't be used in production.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Jogl 2 stops working on Mac after Java7 update 55

Abhi
Hi,

I download the latest jogl2.2 code and build it. Then I use the generated jogl-all.jar file in our project. When the application try to create the canvas, it get crashed. I didn't log the execution so I don't have the stacktrace. I will send you logs soon.

Also I found  that the generated jogl-all.jar size is lesser than the old jar. There is also some directory structure changes in latest jogl. That might be the cause of application crash.

Thanks,
Abhi
Reply | Threaded
Open this post in threaded view
|

Re: Jogl 2 stops working on Mac after Java7 update 55

gouessej
Administrator
You have to use the correct gluegen-rt JAR that matches with JOGL and the correct native libraries to make it work. Please try this build:
http://jogamp.org/deployment/archive/master/gluegen_786-joal_532-jogl_1249-jocl_959/archive/jogamp-all-platforms.7z

If you mix JARs of JOGL 2.0 with JARs of JOGL 2.1.5, it won't work.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Jogl 2 stops working on Mac after Java7 update 55

blainebell
Hi Julien,

These jars on the link you sent are not signed, and from what I believe (and tried), I cannot resign them and use them on my website (I run into security issues).  Can you repost these with signed jars?  I would love to use this version, since all of our OSX users are dead in the water. :(

Thanks!

Blaine
Reply | Threaded
Open this post in threaded view
|

Re: Jogl 2 stops working on Mac after Java7 update 55

gouessej
Administrator
Hi Blaine

This archive should contain the signed JARs:
http://jogamp.org/deployment/archive/master/gluegen_786-joal_532-jogl_1249-jocl_959-signed/archive/jogamp-all-platforms.7z

Sorry to contradict you but you can (re)sign JogAmp JARs, it's just a bit tricky, you might have to modify a few attributes but it works. This is something that lots of developers do in order to work around the troubles with pack200 and use a single signature for all JARs to get just one scaring popup instead of 2.
Julien Gouesse | Personal blog | Website