poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yegor Kozlov <yegor.koz...@dinom.ru>
Subject Re: poi and fonts on debian with openJDK driving me crazy!
Date Wed, 07 Dec 2011 08:25:04 GMT
Let me clarify: you are generating files on Debian and they appear
blank when you open them on a OSX machine, right ? That seems strange.
POI is supposed to run nicely in a headless environment.

Firstly, make sure that you are running in the headless mode and set
the following JVM property:

-Djava.awt.headless=true

Although I'm not sure if it is supported by OpenJDK.

> I'm running a webapp with smartgwt on Tomcat6 running on openJDK, Debian
> Squeeze.
>
> I have a webpage with exports its data through a server call, which uses
> POI to export into an Excel file that the user then can save locally.
>
> All this works fine on my OSX machine, but i have problems deploying on my
> debian server.
>
> The first thing that happened was that i got an exception in the tomcat log
> when the servlet was called:
>
> :java.lang.Error: Probable fatal error:No fonts found.
>        at sun.font.FontManager.getDefaultPhysicalFont(FontManager.java:1088)
>
>

Can you post the full stack trace ? I would like to see the place in
POI where the exception is thrown.

Also, can you tell us what POI components and features are you using ?
HSSF or XSSF ? Can you post sample code ?

> I looked around, saw that there was some issue with fonts removed from
> openJDK. So, i copied the fonts from the Sun-JDK fonts lib (/jre/lib/fonts)
> to the same catalogue in my openSDK dist.
>
>

you can print available fonts as follows:
for(Font f : GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts()){

}

Are the copied fonts there ?

> This resulted in that the error stopped and i got a file to save in the
> browser.
>
> However, when i open the saved file up in excel, it appears blank! The data
> is there though, because if i "save as" csv and open it up in a texteditor
> all rows are there... Also, a friend opened it up on his mobile phone and
> he could see the data. Very strange.
>



>
> Ive tried loads of font-related stuff such as copying lots of my local
> truetype fonts into /usr/share/fonts/truetype, i installed the
> "ttf-mscorefonts-installer" package via apt-get.
>
> All to no avail.
>

by default, OpenJDK refers to DejaVu-Fonts. Try this:

sudo apt-get install ttf-dejavu

Also, There should be fontconfig.properties in the OpenJDK
installation directory. You may need to edit it.

Yegor

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Mime
View raw message