Hi,
after more than a week of experimenting, I am still unable to solve a major problem: my code will run flawlessly on my MacOS X comp at home, but not on a Linux computer (where it will eventually be used).
I have made the .jar available via WebStart (includes source):
http://www.lewins-welt.de/kreisel/kreisel.jnlp
Thanks to TheBohemian I’ve managed starting the app using WebStart, but while this works just fine at home, trying it remotely on a Linux box yields the following results (copied from the WebStart console):
Java 2 Runtime Environment: Version 1.4.2_03 von Sun Microsystems Inc.
Protokolldatei: kreisel.log
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)
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.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:198)
at java.lang.Thread.run(Thread.java:534)
The GLCanvas never gets drawn, and from reading other posts I got the idea that maybe the GLContext is not yet initialized properly when the FPSAnimator starts. Here’s an excerpt from my code:
public JFrame frame;
private GLCanvas glCanvas;
InterfacePanel UIPanel = new InterfacePanel();
public static GLDisplay createGLDisplay(String title) {
return new GLDisplay(title, DEFAULT_WIDTH, DEFAULT_HEIGHT);
}
private GLDisplay(String title, int width, int height) {
this.glCanvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());
this.glCanvas.setSize(width, height);
this.glCanvas.setIgnoreRepaint(true);
this.frame = new JFrame(title);
this.frame.getContentPane().setLayout(new BorderLayout());
this.frame.getContentPane().add(this.glCanvas, BorderLayout.CENTER);
this.frame.getContentPane().add(this.UIPanel, BorderLayout.EAST);
addKeyListener(this.UIPanel.gyro);
}
public void start() {
try {
this.frame.setUndecorated(false);
this.frame.pack();
this.frame.setLocation(50, 50);
//gznote: workaround needed for Mac OS X JDK <= 1.4.1
// Frame.pack() doesn't always take into account the last added component
{
this.frame.setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
}
final FPSAnimator animator = new FPSAnimator(this.glCanvas, DEFAULT_FPS);
this.frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
animator.stop();
stop();
}
});
this.frame.setVisible(true);
animator.start();
} catch (Exception e) {
ExceptionHandler.handleException(e);
stop();
}
}
The start() method gets called from within the app’s main() method shortly after the GLDisplay is created.
BTW, I can run the Gears WebStart demo just fine remotely on the same Linux box, so I must assume that the issue is indeed hidden somewhere within my code.
What am I doing wrong here? My deadline is now less than a month away, so any help will be greatly appreciated…!
Alexander