Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) java.awt.HeadlessException (Read 11098 times)
tmtton
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 39
Joined: May 9th, 2008
java.awt.HeadlessException
Aug 6th, 2008 at 7:39pm
Print Post  
We try to run a simple program remotely on a new system that doesn't have a monitor attached to the cpu unit (i.e. application deployed on that remote server, application display directed to a local screen via microsoft windows remote desktop connection). The following exception occurs. On line 95 of the loadDiagram function, it is simply Diagram diagram = new Diagram();


java.awt.HeadlessException
at sun.awt.HeadlessToolkit.getScreenResolution(HeadlessToolkit.java:203)
at com.mindfusion.diagramming.Diagram.setImageDpiX(Unknown Source)
at com.mindfusion.diagramming.Diagram.<init>(Unknown Source)
at com.xxx.yyy.zzzDiagram.loadDiagram(zzzDiagram.java:95)
  
Back to top
 
IP Logged
 
tmtton
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 39
Joined: May 9th, 2008
Re: java.awt.HeadlessException
Reply #1 - Aug 7th, 2008 at 2:04am
Print Post  
Is there a workaround for this problem? For this particular program, I just want to create a Diagram instance, have it load a XML document, and do additional processing based on the document content. This system needs to stay headless.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3378
Joined: Oct 19th, 2005
Re: java.awt.HeadlessException
Reply #2 - Aug 7th, 2008 at 7:47am
Print Post  
We'll have to find all places in the JDiagram code where that could happen and add GraphicsEnvironment.isHeadless() checks to avoid the exception. I will send you a new version of the JAR file when thats ready.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3378
Joined: Oct 19th, 2005
Re: java.awt.HeadlessException
Reply #3 - Aug 8th, 2008 at 4:31pm
Print Post  
I've emailed you the updated JAR file.
  
Back to top
 
IP Logged
 
tmtton
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 39
Joined: May 9th, 2008
Re: java.awt.HeadlessException
Reply #4 - Aug 11th, 2008 at 7:53pm
Print Post  
It works great. We appreciate your tremendous support.
  
Back to top
 
IP Logged
 
raymondpon
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 1
Joined: Sep 26th, 2008
Re: java.awt.HeadlessException
Reply #5 - Sep 26th, 2008 at 5:42pm
Print Post  
Could you also email me the updated JAR file? I am in the same situation and am running into the same problem as well.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: java.awt.HeadlessException
Reply #6 - Sep 27th, 2008 at 10:19am
Print Post  
Here is a trial version:
https://mindfusion.eu/_temp/headless.zip

If you are our licensed customer, please email us your order number or some registrations details you provided with the purchase.

Stoyan
  
Back to top
 
IP Logged
 
cpmjones
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 23
Joined: Aug 4th, 2008
Re: java.awt.HeadlessException
Reply #7 - Nov 8th, 2012 at 5:46pm
Print Post  
Is this still handled?

We have seen the following exception running on a Linux environment:

SEVERE: null
java.awt.HeadlessException
        at sun.awt.HeadlessToolkit.createCustomCursor(Unknown Source)
        at com.mindfusion.diagramming.DiagramView.a(Unknown Source)
        at com.mindfusion.diagramming.DiagramView.<init>(Unknown Source)

Thanks,

Chris

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: java.awt.HeadlessException
Reply #8 - Nov 9th, 2012 at 8:09am
Print Post  
We haven't removed any checks for headless environment, so perhaps that createCustomCursor method started throwing HeadlessException exception in more recent versions of Java. Our developer will check that for next release.

I'm not sure if that will help you though. It seems even if you create DiagramView, you can't add it to a root window since the JFrame constructor throws a HeadlessException too.

Stoyan
  
Back to top
 
IP Logged
 
cpmjones
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 23
Joined: Aug 4th, 2008
Re: java.awt.HeadlessException
Reply #9 - Nov 12th, 2012 at 10:02am
Print Post  
What we have is a servlet running in Tomcat generating a PNG file for the http response so no need for any JFrame.

Thanks

Chris
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: java.awt.HeadlessException
Reply #10 - Nov 12th, 2012 at 10:21am
Print Post  
Then you shouldn't need a DiagramView either. You can create an image using solely the Diagram class.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
cpmjones
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 23
Joined: Aug 4th, 2008
Re: java.awt.HeadlessException
Reply #11 - Nov 12th, 2012 at 4:58pm
Print Post  
We took out the DiagramView and its working now.

Thanks yet again for your response  Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint