Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Jogl and Eclipse RCP
Jogl and Eclipse RCP [message #436431] Thu, 08 September 2005 10:14 Go to next message
Eclipse UserFriend
Originally posted by: sebastien.dilogos.com

Hi everybody,

here is my problem :
I try to use some Jogl code in an Eclipse RCP project (Eclipse 3.1), but I
have the following error message :

Unhandled event loop exception
Reason:
net/java/games/jogl/GLEventListener

I have installed the OpenGL plugin and (I think) everything needed to
work, but it doesn't work !!!
What have I missed ?

Thanks a lot

Seb
Re: Jogl and Eclipse RCP [message #436444 is a reply to message #436431] Thu, 08 September 2005 14:45 Go to previous messageGo to next message
Geoff Draper is currently offline Geoff DraperFriend
Messages: 34
Registered: July 2009
Member
When you say that you've installed the OpenGL plugin, do you mean that =

you've created a new plugin that wraps the jogl.jar file? If so, did yo=
u =

also include the platform-specific library (*.dll for Windows, *.so for =
=

Unix) inside your plugin?

Incidentally, since JOGL uses AWT, are you using the SWT_AWT bridge to =

make it work with RCP? Or through some other mechanism?

On Thu, 08 Sep 2005 04:14:20 -0600, Seb Vandamme <sebastien@dilogos.com>=
=

wrote:

> Hi everybody,
>
> here is my problem :
> I try to use some Jogl code in an Eclipse RCP project (Eclipse 3.1), b=
ut =

> I have the following error message :
>
> Unhandled event loop exception
> Reason:
> net/java/games/jogl/GLEventListener
>
> I have installed the OpenGL plugin and (I think) everything needed to =
=

> work, but it doesn't work !!!
> What have I missed ?
>
> Thanks a lot
>
> Seb
>
Re: Jogl and Eclipse RCP [message #436481 is a reply to message #436444] Fri, 09 September 2005 10:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sebastien.dilogos.com

I have installed this plugin :
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/plat form-swt-home/opengl/opengl.html
and I use the gl-win32.dll for Windows XP.

My code look like that :

public void createPartControl(Composite parent) {
Vertical3DView v = new Vertical3DView();
ButtonPanel bp = new ButtonPanel(v);

Canvas canvas = new Canvas(parent, SWT.EMBEDDED);
Frame f = SWT_AWT.new_Frame(canvas);
f.setLayout(new BorderLayout()); f.add(v, BorderLayout.WEST);
f.add(bp, BorderLayout.EAST);
}

where Vertical3DView and ButtonPanel are two Jogl classes.

In a singl SWT application, this code work fine ! Then, what's the problem
with RCP, that's my question... :-)

thanks a lot,

Seb


Geoff Draper wrote:

> When you say that you've installed the OpenGL plugin, do you mean that
> you've created a new plugin that wraps the jogl.jar file? If so, did you
> also include the platform-specific library (*.dll for Windows, *.so for
> Unix) inside your plugin?

> Incidentally, since JOGL uses AWT, are you using the SWT_AWT bridge to
> make it work with RCP? Or through some other mechanism?

> On Thu, 08 Sep 2005 04:14:20 -0600, Seb Vandamme <sebastien@dilogos.com>
> wrote:

>> Hi everybody,
>>
>> here is my problem :
>> I try to use some Jogl code in an Eclipse RCP project (Eclipse 3.1), but
>> I have the following error message :
>>
>> Unhandled event loop exception
>> Reason:
>> net/java/games/jogl/GLEventListener
>>
>> I have installed the OpenGL plugin and (I think) everything needed to
>> work, but it doesn't work !!!
>> What have I missed ?
>>
>> Thanks a lot
>>
>> Seb
>>
Re: Jogl and Eclipse RCP [message #436482 is a reply to message #436431] Fri, 09 September 2005 10:35 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
This error message is indicative of a ClassNotFound exception, where the full exception is 'ClassNotFoundException: net/java/games/jogl/GLEventListener' but the error message being printed is (somewhat unhelpfully) 'net/java/games/jogl/GLEventListener'.

The three most likely causes are:

1) It's not in your Manifest.MF, so that it builds (it's in the .classpath) but not visible at run-time

2) The class is visible, but it has a static initialiser that references another class (e.g. static Log = LogFactory.getLog("x")) that isn't visible.

3) The class is visible, but it has a static initialiser that attempts to load a native library (e.g. System.loadLibrary("graphics") that fails, and this is translated into a ClassNotFoundException.

I'd suggest the way to debug it is in your plugin initialiser, do a System.print(Class.forName("net.java.games.jogl.GLEventListener ")) which will go through the routine of loading the class and finding any errors that are necessary. You may even be able to stick a breakpoint on this line and go through a debugger to find out whether it's the native library or some other class that it can't find, but the debugger will use the same classpath as the project builder will.
Re: Jogl and Eclipse RCP [message #436484 is a reply to message #436482] Fri, 09 September 2005 12:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sebastien.dilogos.com

Thanks for your answer.

I have no static initializer in my jogl classes.
What must I put in my Manifest.MF ? the opengl-swt plugin ? Or the
jogl.jar ?

I put a System.print(Class.forName("net.java.games.jogl.GLEventListener "))
in my plugin initializer, and the message is the following :

java.lang.ClassNotFoundException: net.java.games.jogl.GLEventListener
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:403)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:350)
at
org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader. loadClass(AbstractClassLoader.java:78)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at scenery.rcp.Perspective.createInitialLayout(Perspective.java :13)
at
org.eclipse.ui.internal.Perspective.loadPredefinedPersp(Pers pective.java:696)
at
org.eclipse.ui.internal.Perspective.createPresentation(Persp ective.java:230)
at org.eclipse.ui.internal.Perspective.<init>(Perspective.java:127)
at
org.eclipse.ui.internal.WorkbenchPage.createPerspective(Work benchPage.java:1375)
at
org.eclipse.ui.internal.WorkbenchPage.busySetPerspective(Wor kbenchPage.java:896)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:887)
at org.eclipse.ui.internal.WorkbenchPage$12.run(WorkbenchPage.j ava:3051)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:69)
at
org.eclipse.ui.internal.WorkbenchPage.setPerspective(Workben chPage.java:3049)
at
org.eclipse.ui.internal.ChangeToPerspectiveMenu.run(ChangeTo PerspectiveMenu.java:91)
at org.eclipse.ui.actions.PerspectiveMenu.run(PerspectiveMenu.j ava:331)
at
org.eclipse.ui.actions.PerspectiveMenu.runOther(PerspectiveM enu.java:346)
at
org.eclipse.ui.actions.PerspectiveMenu$3.runWithEvent(Perspe ctiveMenu.java:108)
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:538)
at
org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:488)
at
org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:400)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3080)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2713)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
at scenery.rcp.Application.run(Application.java:18)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:226)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)
Unhandled event loop exception
Reason:
net/java/games/jogl/GLEventListener

Thanks for your help.

Seb




Alex Blewitt wrote:

> This error message is indicative of a ClassNotFound exception, where the
full exception is 'ClassNotFoundException:
net/java/games/jogl/GLEventListener' but the error message being printed is
(somewhat unhelpfully) 'net/java/games/jogl/GLEventListener'.

> The three most likely causes are:

> 1) It's not in your Manifest.MF, so that it builds (it's in the .classpath)
but not visible at run-time

> 2) The class is visible, but it has a static initialiser that references
another class (e.g. static Log = LogFactory.getLog("x")) that isn't visible.

> 3) The class is visible, but it has a static initialiser that attempts to
load a native library (e.g. System.loadLibrary("graphics") that fails, and
this is translated into a ClassNotFoundException.

> I'd suggest the way to debug it is in your plugin initialiser, do a
System.print(Class.forName("net.java.games.jogl.GLEventListener ")) which will
go through the routine of loading the class and finding any errors that are
necessary. You may even be able to stick a breakpoint on this line and go
through a debugger to find out whether it's the native library or some other
class that it can't find, but the debugger will use the same classpath as the
project builder will.
Re: Jogl and Eclipse RCP [message #436489 is a reply to message #436431] Fri, 09 September 2005 13:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alr.agelid.com

Hi,
Actually Jogl IS the openGL's library you use, and then you don't care
about SWT Opengl's one.
The plugin SWT OpenGL is not used there !!

What you need is just add the jogl.jar in the execution library list of
your plugin, you can do that using the plugin.xml editor in the
"execution/runtime" folder.
AND tell the plugin.xml to also export the lib, do that in the
"build.propserties" tab

Let's says your jogl.jar is in the "lib" folder of your plugin, the
build.properties may look like :

...
bin.includes = plugin.xml,\
plugin.properties,\
icons/,\
pluginXXXX.jar,\
lib/

Hope this help,
Arnauld
Re: Jogl and Eclipse RCP [message #436494 is a reply to message #436489] Fri, 09 September 2005 13:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sebastien.dilogos.com

Thank you very much for your answer, but it doesn't work... :-(


alr wrote:

> Hi,
> Actually Jogl IS the openGL's library you use, and then you don't care
> about SWT Opengl's one.
> The plugin SWT OpenGL is not used there !!

> What you need is just add the jogl.jar in the execution library list of
> your plugin, you can do that using the plugin.xml editor in the
> "execution/runtime" folder.
> AND tell the plugin.xml to also export the lib, do that in the
> "build.propserties" tab

> Let's says your jogl.jar is in the "lib" folder of your plugin, the
> build.properties may look like :

> ...
> bin.includes = plugin.xml,
> plugin.properties,
> icons/,
> pluginXXXX.jar,
> lib/

> Hope this help,
> Arnauld
Re: Jogl and Eclipse RCP [message #436497 is a reply to message #436494] Fri, 09 September 2005 14:59 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

For the general case: How do I add 3rd party jar to my common plugin,
here are some steps we figured out this morning.

# for compiling with your jars

1. create your plugin project, and possibly a folder to hold them
<project>/lib

2. import the jar from the filesystem into your <project>/lib directory

3. right click on the jar and "add to build path"

4. right click on the project and do a Build Path>Configure build path

5. export the jar from the Order and Export tab

# this is probably enough for eclipse to allow you to code
# with your jar classes

# for the plugins to work when deployed

6. edit your MANIFEST.MF file

7. On the runtime tab, add your jar to the classpath pane

8. On the runtime tab, add all of the packages you want to export.

# this gets the jars into your plugin, I'm guessing

9. you might have to make sure that the jars are included in a binary
build from the Build tab, I'm not sure.

Later,
PW


Re: Jogl and Eclipse RCP [message #436503 is a reply to message #436484] Fri, 09 September 2005 18:42 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
Re: the static initialiser; it would be in the GLEventListener that a static initialiser fails, and this is translated into a ClassNotFoundException.

Check that the JAR is on the Manifest.MF; you should have an entry like:

Bundle-ClassPath: jogl.jar

otherwise it won't see it at runtime.

You can determine if it's a failure with that class specifically or any class in the JAR by doing 'Class.forName("net.java.games.jogl.Version")', which should also be in the jogl.jar file (open it up in WinZip or similar to see other files in there). If you can find the Version file, but you're still getting a ClassNotFoundException for GLEventListener, it's possible/likely that the GLEventListener is (in)directly trying to load a DLL and failing to obtain it from the JAR.
Re: Jogl and Eclipse RCP [message #436530 is a reply to message #436497] Mon, 12 September 2005 08:58 Go to previous message
Eclipse UserFriend
Originally posted by: sebastien.dilogos.com

Yipieeee, it works !!!

Thank you all for your help,

Seb
Previous Topic:can not start RCP Applicatioon : NoClassDefFoundError
Next Topic:Re: progress view for jobs is showing in My RCP app , only when i include org.eclipse.ui.ide or org
Goto Forum:
  


Current Time: Thu Dec 26 14:05:22 GMT 2024

Powered by FUDForum. Page generated in 0.03132 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top