Skip to main content
February 15, 2012
Question

Unable to create spreadsheet, Java error

  • February 15, 2012
  • 1 reply
  • 730 views

I'm trying to create a spreadsheet for the first time in CF 9. It doesn't look like the spreadsheet is getting generated at all. I get no errors or output of any sort, but in the ColdFusion Monitor, it logs an error "java.lang.Error : Could not find class: com.gp.java2d.ExHeadlessGraphicsEnvironment". This is my very stripped down test case:

<cfscript>
    oSheet = SpreadsheetNew( "mysheet", true );
    SpreadsheetSetCellValue( oSheet, "foo", 1, 1);
    SpreadsheetAddRow( oSheet, "a,b,c", 2, 1 );    
</cfscript>

<cfdump var="#oSheet#">

I do get output from the cfdump on my local machine using the CF Developer edition, but not on my Linux webserver.

This topic has been closed for replies.

1 reply

Community Expert
February 16, 2012

Many things in CF require graphics libraries be installed or enabled. It sounds like your Linux webserver doesn't have these installed. You might be able to work around this by setting a variable in jvm.config:

-Djava.awt.headless=true

You might also find these links useful:

http://java.sun.com/developer/technicalArticles/J2SE/Desktop/headless/

http://www.opensourcecf.com/forums/messages.cfm?threadid=2BFCD8F7-00D9-9286-9CC679B1D9DACAD4

Dave Watts, CTO, Fig Leaf Software

Dave Watts, Eidolon LLC