JME 3.0-RC2 + Tomcat 7.0.27: Offscreen surfaces are not supported

Hello,

We are using JME 3.0-RC2 to generate previews in our web application running in Tomcat 7.0.27 on Windows 7.

When tomcat is started manually using bin/startup.bat everything works file and JME works perfectly.
But when the same tomcat is started as a windows service preview generation thread fails with:

12.12.2012 3:06:17 com.jme3.system.JmeDesktopSystem initialize INFO: Running on jMonkeyEngine 3.0.0 Beta 12.12.2012 3:06:17 com.jme3.system.Natives extractNativeLibs INFO: Extraction Directory: D:\Soft\Apache Software Foundation\Apache Tomcat 7.0.27\bin 12.12.2012 3:06:17 com.jme3.system.lwjgl.LwjglOffscreenBuffer run INFO: Using LWJGL 2.8.4 12.12.2012 3:06:17 com.jme3.system.lwjgl.LwjglOffscreenBuffer initInThread SEVERE: Offscreen surfaces are not supported. Exception in thread "LWJGL Renderer Thread" java.lang.IllegalStateException at com.jme3.system.lwjgl.LwjglOffscreenBuffer.runLoop(LwjglOffscreenBuffer.java:108) at com.jme3.system.lwjgl.LwjglOffscreenBuffer.run(LwjglOffscreenBuffer.java:146) at java.lang.Thread.run(Thread.java:662)

I saw some posts containing this error and advices to update drivers but looks like this is a different problem.
Does anybody have an idea what can cause such a problem?

Maybe offscreen surfaces are really not supported on the GPU in that computer?

Thx for reply

For starting the application as a service and as a standalone application (bin/startup.bat) the same machine is used.
Moreover, it the same installation.
In the first case (service) JME does not work but in the second (standalone) it does.
So, due to the fact it works in the second case I think there are no problem of not supporting off-screen buffers by graphic cart I have. The same behavior also can be reproduced on customer’s server running on Windows server OS.

I suppose the problem can be caused with native code execution somehow. Maybe API used in native libraries requires something what is not available for services.

Yeah, idk. Maybe windows steals the advanced GPU functions from services as it suspects they don’t do UI stuff?

Ok.

I’ve found the following article: http://stackoverflow.com/questions/513650/offscreen-rendering-to-a-texture-in-a-win32-service

Looks like JME3 is not suitable for rendering in my case.

Have you looked in to running the server on a non-windows platform?

@sbook
Speaking frankly not.
ATM Windows OS usage is a requirement because of other 3d party tools used.
But if there will be no choice then we’ll try.

I performed some experiments with Mesa 3D but without any success (with versions 6 and 7, I’m not an expert in C++ so didn’t try to build the latest version) .

Can you run it in the background without starting it as a service?

You could always have a watchdog service that starts/restarts etc the server on demand.

Probably. Thx for the hint.