Problem using jogl(+WebStart) on Linux

Hi folks,

I am currently developing a physics simulation using Java/jogl/OpenGL. Development takes place on a MacOS X box, but the finished program is intended for use on Linux computers.

I have packaged everything into one signed .jar file, including my own code + jogl.jar + native libraries for OS X and Linux. All jogl stuff is located in the “lib/” subdirectory inside the .jar. When testing this using WebStart, everything runs fine at home, but when I open a remote X11 session on a Linux computer and do a “javaws -offline file:///home/alex/kreisel/kreisel.jnlp”, I get the error mesage “no jogl in java.library.path”.

In addition, when trying to start the program directly using “java -jar -Djava.library.path=lib Kreisel.jar” from the command line, it throws an exception:

net.java.games.jogl.GLException: Error making context current
at net.java.games.jogl.impl.x11.X11GLContext.makeCurrent(X11GLContext.java:153)
at net.java.games.jogl.impl.x11.X11OnscreenGLContext.makeCurrent(X11OnscreenGLContext.java:111)
at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:203)
at net.java.games.jogl.GLCanvas.reshape(GLCanvas.java:105)
at java.awt.Component.setBounds(Component.java:1664)
at java.awt.BorderLayout.layoutContainer(BorderLayout.java:691)
at java.awt.Container.layout(Container.java:1020)
at java.awt.Container.doLayout(Container.java:1010)
at java.awt.Container.validateTree(Container.java:1092)
at java.awt.Container.validateTree(Container.java:1099)
at java.awt.Container.validateTree(Container.java:1099)
at java.awt.Container.validateTree(Container.java:1099)
at java.awt.Container.validate(Container.java:1067)
at java.awt.Window.dispatchEventImpl(Window.java:1604)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

I cannot figure out what is going wrong here. Has anyone of you encountered this before? Any help at all would be much appreciated, since this is part of a thesis for my engineering degree…

In the hope that one of you will take a look I have posted the complete jar + jnlp on my website:
http://www.lewins-welt.de/kreisel/Kreisel.jar
http://www.lewins-welt.de/kreisel/kreisel.jnlp

Thanks in advance for your help, and greetings from Germany,

Alexander

From what I have read you missed some of the concepts of webstart (i prefer to say JNLP because its the specification that webstart implements … ): :smiley:

  • all files have to be seperate jar files
  • native libraries have to be packaged in the top folder inside a jar
  • you may seperate code from resource-only jars too
  • the folders you specify in the JNLP are relative to ${codebase} on your server

That brings me to the following error list:

  • do not put everything in a single jar (the concept is to have several smaller files to have shorter download times if the files change)
  • codebase has to be corrected to the real base URL of you application
  • change -like entries to if you put them in ${codebase}. keep “lib/” only if you use subdirectories on the server.

Btw: be careful with the current JOGL builds! Some time ago the jogl.jar which was distributed in jogl-1.x.0-bxy-dist.zip contained the classes for all platforms (OSes). this has changed with the recent 1.1 version. the jogl.jar inside jogl-1.1.0-b04-dist.zip contains only the classes for Windows. You have the option to do the following:

  • copy the specific implementations for Mac (jogl.impl.macosx) and X11 (Linux/Solaris - jogl.impl.x11) into the jogl.jar which only contains the Win32 classes

  • provide jogl.jars which are specific to each platform. eg: jogl-win32.jar/jogl-x11.jar/jogl-macosx.jar.

If anything is unclear just post here.

Thanks a lot for your input! The program now loads just fine using WebStart (meaning it finds all the native libraries and stuff), but then throws the following exception:

net.java.games.jogl.GLException: Error making context current
at net.java.games.jogl.impl.x11.X11GLContrext.makeCurrent(X11GLContext.java:153)
at net.java.games.jogl.impl.x11.X11OnscreenGLcontext.makecurrent(X11OnscreenGLcontext.java:111)
at net.java.games.jogl.impl.GLcontext.invokeGL(GLcontext.java:203)
at net.java.games.jogl.GLCanvas.displayImpl(GLCanvas.java:194)
at net.java.games.jogl.GLCanvas.display(GLCanvas.java:82)
at de.tubs.ilr.fachlabor.kreisel.FPSAnimator$RenderRunnable.run(FPSAnimator.java:200)
at java.lang.Thread.run(Thread.java:534)

Again, I have no idea how to fix this… Some earlier posts quoting the same message seem to suggest problems with the graphics card driver or with the jogl X11 interfaces.

Would updating to the jogl 1.1 release help here, as I seem to recall that there were X11 related fixes?

Oh, and current files are on http://www.lewins-welt.de/kreisel/kreisel.jnlp

Thanks in advance,
Alexander

interesting!
the application works for me but jogl 1.0 apps always run fine.

you may try upgrading to jogl 1.1 but this brought me more problems. if you are experiencing trouble with 1.1 too just post here http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=jogl;action=display;num=1083407289

hopefully this gets fixed soon.