Jzy3d embedded in Eclipse RCP / SWT App'

349 views
Skip to first unread message

Mathieu P

unread,
Feb 8, 2011, 10:22:35 AM2/8/11
to Jzy3d
Hi,

I'm trying to use Jzy3D in a Rcp application to display a 3D bar
histogram.

I can launch the application without error, but when i open my editor
and i clic in the editor area, i get an error :

java.lang.NoClassDefFoundError: Could not initialize class
com.sun.opengl.impl.windows.WindowsGLDrawableFactory
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at
javax.media.opengl.GLDrawableFactory.getFactory(GLDrawableFactory.java:
106)
at
javax.media.opengl.GLCanvas.chooseGraphicsConfiguration(GLCanvas.java:
520)
at javax.media.opengl.GLCanvas.<init>(GLCanvas.java:131)
at javax.media.opengl.GLCanvas.<init>(GLCanvas.java:90)
at org.jzy3d.plot3d.rendering.canvas.CanvasAWT.<init>(CanvasAWT.java:
45)
at org.jzy3d.plot3d.rendering.canvas.CanvasAWT.<init>(CanvasAWT.java:
40)
at org.jzy3d.chart.Chart.initializeCanvas(Chart.java:65)
at org.jzy3d.chart.Chart.<init>(Chart.java:56)
at org.jzy3d.chart.Chart.<init>(Chart.java:39)
at fr.mydomain.myapp.components.ComponentsManager
$1.<init>(ComponentsManager.java:105)
...
...

at line 105 i have :

// Create a chart for this scene
Chart chart = new Chart() {
public HistogramScene initializeScene() {
return histogramScene;
}
};


How my system can find the WindowsGLDrawableFactory class ? It's in
the jogl jar ?

Thanks a lot,

Mathieu.

Martin Pernollet

unread,
Feb 8, 2011, 3:57:03 PM2/8/11
to jz...@googlegroups.com
Hi,
Which version of Jzy3d are you using? Did you download the appropriate jogl dependencies? Are you using the distributed lib, or built the API from source?
Regards,
Martin

2011/2/8 Mathieu P <mtp...@gmail.com>

Mathieu P

unread,
Feb 9, 2011, 5:08:54 AM2/9/11
to Jzy3d
Hi,

I am using jyz3D 0.8.2 binaries, under windows XP.

I have tried to use it with the dependencies package found on jzy3D ,
jogl 1.1.1 32 bits, and jogl 2.xxx 32 bits.
I have followed up this post :
http://groups.google.com/group/jzy3d/browse_thread/thread/f24eb119438f6f38/2290d9e44bcd2c1f?hl=en&lnk=gst&q=WindowsGLDrawableFactory#2290d9e44bcd2c1f

Still not working.



On Feb 8, 9:57 pm, Martin Pernollet <martin.pernol...@gmail.com>
wrote:
> Hi,
> Which version of Jzy3d are you using? Did you download the appropriate jogl
> dependencies? Are you using the distributed lib, or built the API from
> source?
> Regards,
> Martin
>
> 2011/2/8 Mathieu P <mtp....@gmail.com>

Mathieu P

unread,
Feb 9, 2011, 6:06:22 AM2/9/11
to Jzy3d
Actually it seems that i have passed this error, but my eclipse rcp
plugin doesnt find the attached native dll of jogl Oo :

Caused by: java.lang.UnsatisfiedLinkError: no jogl in
java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at
com.sun.opengl.impl.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:
189)
at com.sun.opengl.impl.NativeLibLoader.access
$000(NativeLibLoader.java:49)
at com.sun.opengl.impl.NativeLibLoader
$DefaultAction.loadLibrary(NativeLibLoader.java:80)
at
com.sun.opengl.impl.NativeLibLoader.loadLibrary(NativeLibLoader.java:
103)
at com.sun.opengl.impl.NativeLibLoader.access
$200(NativeLibLoader.java:49)
at com.sun.opengl.impl.NativeLibLoader$1.run(NativeLibLoader.java:
111)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.opengl.impl.NativeLibLoader.loadCore(NativeLibLoader.java:
109)
at
com.sun.opengl.impl.windows.WindowsGLDrawableFactory.<clinit>(WindowsGLDrawableFactory.java:
60)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at
javax.media.opengl.GLDrawableFactory.getFactory(GLDrawableFactory.java:
106)
at
fr.mydomain.myapp.components.ComponentsManager.d_generateDatas(ComponentsManager.java:
114)
...
...

Very strange because the library is here and linked in eclipse rcp
plugin.

On Feb 9, 11:08 am, Mathieu P <mtp....@gmail.com> wrote:
> Hi,
>
> I am using jyz3D 0.8.2 binaries, under windows XP.
>
> I have tried to use it with the dependencies package found on jzy3D ,
> jogl 1.1.1 32 bits, and jogl 2.xxx 32 bits.
> I have followed up this post :http://groups.google.com/group/jzy3d/browse_thread/thread/f24eb119438...

Martin Pernollet

unread,
Feb 9, 2011, 9:27:15 AM2/9/11
to jz...@googlegroups.com
http://code.google.com/p/jzy3d/wiki/FAQ
That should help!
Martin

2011/2/9 Mathieu P <mtp...@gmail.com>

Mathieu P

unread,
Feb 17, 2011, 1:04:14 PM2/17/11
to Jzy3d
Well it's working now.

I have embedded the jzy3d in a RCP / swt editor.
I'm using the trunk version of jzy3D and jogl2.

Main demos are working.

The problem appear when i close and reopen my editor.

I got an error :

Exception in thread "main-AWTAnimator-2"
javax.media.opengl.GLException: java.lang.NullPointerException
at
com.jogamp.opengl.impl.awt.AWTThreadingPlugin.invokeOnOpenGLThread(AWTThreadingPlugin.java:
98)
at
com.jogamp.opengl.impl.ThreadingImpl.invokeOnOpenGLThread(ThreadingImpl.java:
197)
at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:
164)
at
javax.media.opengl.awt.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:
747)
at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:384)
at
com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:
74)
at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:140)
at com.jogamp.opengl.util.Animator$MainLoop.run(Animator.java:177)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at org.jzy3d.plot3d.rendering.view.Camera.doShoot(Camera.java:397)
at org.jzy3d.plot3d.rendering.view.Camera.shoot(Camera.java:372)
at org.jzy3d.plot3d.rendering.view.Camera.shoot(Camera.java:363)
at org.jzy3d.plot3d.rendering.view.View.renderScene(View.java:638)
at org.jzy3d.chart.ChartView.render(ChartView.java:87)
at org.jzy3d.plot3d.rendering.view.Renderer3d.reshape(Renderer3d.java:
96)
at
com.jogamp.opengl.impl.GLDrawableHelper.reshape(GLDrawableHelper.java:
202)
at
com.jogamp.opengl.impl.GLDrawableHelper.reshape(GLDrawableHelper.java:
209)
at javax.media.opengl.awt.GLCanvas$DisplayAction.run(GLCanvas.java:
849)
at
com.jogamp.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:
362)
at javax.media.opengl.awt.GLCanvas
$DisplayOnEventDispatchThreadAction.run(GLCanvas.java:870)
at java.awt.event.InvocationEvent.dispatch(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)

Just like if all the awt canvas are not closed properly...
Do you know where the error come from ?

Thanks,

On Feb 9, 3:27 pm, Martin Pernollet <martin.pernol...@gmail.com>
wrote:
> http://code.google.com/p/jzy3d/wiki/FAQ
> <http://code.google.com/p/jzy3d/wiki/FAQ>That should help!
> Martin
>
> 2011/2/9 Mathieu P <mtp....@gmail.com>

Martin Pernollet

unread,
Feb 18, 2011, 5:03:26 AM2/18/11
to jzy3d, Mathieu P
Hello,
Your application should be using CanvasAWT. I had to add an animator to the canvas, and there might be something wrong when disposing it.
You can first try to call CanvasAWT.dispose() before closing your canvas. It does that:

public void dispose(){
new Thread(new Runnable() {
            public void run() {
             //System.err.println("stopping canvas animator");
                animator.stop();
renderer = null;
view = null;
            }
          }).start();
}

If it does not work, then maybe add a method that call animator.stop() outside of a thread, or edit the dispose method so that animator.stop is called in the current thread.

Can you tell us which of these methods work?

Thanks,
Martin



2011/2/17 Mathieu P <mtp...@gmail.com>

Mathieu P

unread,
Feb 18, 2011, 9:24:16 AM2/18/11
to Jzy3d
I have found the problem :

In Renderer3D, glu object is static.

When i close the editor, it call the dispose function of Renderer3d
wich set the glu object at null.
When i reopen the editor, a new Renderer3D is created, but glu, as a
static is always at null.

If i remove the static attribute of the glu object, and if i create a
new one in the Renderer3D constructor, it's work.

Solution OK, or that will create others problems ?

Tell me,


On Feb 18, 11:03 am, Martin Pernollet <martin.pernol...@gmail.com>
wrote:
> Hello,
> Your application should be using CanvasAWT. I had to add an animator to the
> canvas, and there might be something wrong when disposing it.
> You can first try to call CanvasAWT.dispose() before closing your canvas. It
> does that:
>
> public void dispose(){
> new Thread(new Runnable() {
>             public void run() {
>              //System.err.println("stopping canvas animator");
>                 animator.stop();
> renderer = null;
> view = null;
>             }
>           }).start();
>
> }
>
> If it does not work, then maybe add a method that call animator.stop()
> outside of a thread, or edit the dispose method so that animator.stop is
> called in the current thread.
>
> Can you tell us which of these methods work?
>
> Thanks,
> Martin
>
> 2011/2/17 Mathieu P <mtp....@gmail.com>

Martin Pernollet

unread,
Feb 18, 2011, 9:33:03 AM2/18/11
to jzy3d, Mathieu P
Thanks,
Yes, solution should be OK.

2011/2/18 Mathieu P <mtp...@gmail.com>
Reply all
Reply to author
Forward
0 new messages