Stephan van Hulst wrote:Can you print out the value of the java.awt.headless system property before you show the dialog? Same with the result of the GraphicsEnvironment.isHeadless() method?
Stephan van Hulst wrote:I think that method just returns the value of the java.awt.headless system property.
Yes, I think you should be able to run the application in headful mode. I don't know why you would want to though.
Stephan van Hulst wrote:You would set it as a JVM option when you start up Tomcat. You can probably do this in the Catalina config.
I'm still confused, but I find the use case of a client triggering a dialog on the server very odd.
Stephan van Hulst wrote:Try to set the system property in a static initializer at the top of your Application class. It might be possible that simply referring to any of the Spring types from your code might trigger the toolkit to be initialized before the system property is set.
I understand that you want to select a file on the server and enter it into a database field on the server, through a client application you can't modify. What I don't understand is why you are doing it by running UI code on the server. That would only work if the client is running on the same host as the server, in the same user session.
Personally I'd route the client's request through a tiny Swing application that initializes a JFileChooser with a FileSystemView that acts as a proxy to your actual server. That way you can run your database application on any host, not just on the same host as your web server. Unless of course that never going to be a use case for you.