0

I have created an web application that trigers some .jar applets.
I print the jars with the HTML tags through a servlet in a jsp.

Imagine two situations. A anb B.
Starting with A the jar runs.
I go to B, the 2nd jar replaces the first.
When I return to A, the 2nd jar is removed but the first jar fails to start with a Adding same VBO twice + null pointer exception.

So I believe I have to stop it after leaving situation A.
Is there a way to stop the .jar from running from inside the servlet?

Thanks in advance.

Added stacktrace:

Adding same VBO twice. Exception in thread "Animation Thread" P3D: Already called beginDraw(). javax.media.opengl.GLException: java.lang.NullPointerException at jogamp.opengl.awt.AWTThreadingPlugin.invokeOnOpenGLThread(AWTThreadingPlugin.jav‌​a:98) at jogamp.opengl.ThreadingImpl.invokeOnOpenGLThread(ThreadingImpl.java:196) at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:164) at javax.media.opengl.awt.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:83‌​1)

lemanou
  • 141
  • 1
  • 2
  • 8
  • Post the stack trace of the exception, and the code causing this exception to be thrown. Trying random things is not the best way to sove a problem. The best way is to analyze the cause of the problem. – JB Nizet Mar 02 '13 at 12:10
  • The exception I get when I return from B to A is: **Adding same VBO twice Exception in thread "Animation Thread" P3D: Already called beginDraw(). javax.media.opengl.GLException: java.lang.NullPointerException at jogamp.opengl.awt.AWTThreadingPlugin.invokeOnOpenGLThread(AWTThreadingPlugin.java:98) at jogamp.opengl.ThreadingImpl.invokeOnOpenGLThread(ThreadingImpl.java:196) at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:164) at javax.media.opengl.awt.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:831)...** and goes on with much more. – lemanou Mar 02 '13 at 12:51
  • This does not seem to have anything to do with the "Processing" programming language... wrong tag? – Mike 'Pomax' Kamermans Mar 03 '13 at 20:24
  • Yes it does, since the .jar files are processing sketches. – lemanou Mar 04 '13 at 07:56
  • from the stack trace, it looks like the opengl context is already in use. Are both sketches trying to claim the opengl pipeline? – Mike 'Pomax' Kamermans Mar 04 '13 at 19:41
  • Yes, they are two different sketches trying to claim the same opengl lib. – lemanou Mar 05 '13 at 11:44
  • It's a good bet that the "and B replaces A" does not actually unload the sketch. Does A at any point when it's being swapped out call exit(), to release all the locks and resource pointers? – Mike 'Pomax' Kamermans Mar 06 '13 at 01:42
  • Yes that is what I believe also. However I don't know how to close the applet from the jsp or the servlet since it was called with a js – lemanou Mar 06 '13 at 07:53

0 Answers0