java.awt.HeadlessException - Aspose.Words.jdk14 and jdk15

Hi ,
We are getting java.awt.HeadlessException in unix environment for Aspose.Words.

We have set -Djava.awt.headless=true

Are we missing anything?

It is running on weblogic10 .3


Thanks for your inquiry. Could you please provide me details of the exception? Please attach stack trace of the exception.
How can I reproduce the problem on my side?
Best regards,

Here the code.
The input the rtf document as byte[].

public static byte[] rtfToPdfConverter(byte[] input) throws Exception
    byte[] inputData = null;
    InputStream ins = null;
    ByteArrayOutputStream out = null;
    Document doc = null;
    String osName = null;
    License license = null;
    inputData = input;
    osName = System.getProperty("");
    if (!osName.equalsIgnoreCase("Windows XP"))
        FontSettings.setFontsFolder("/bnz/oracle/fonts", true);
        license = new License();
    ins = new ByteArrayInputStream(inputData);
    doc = new Document(ins);
    out = new ByteArrayOutputStream();, SaveFormat.PDF);
    inputData = out.toByteArray();
    return inputData;

Thank you for additional information. But could you please also attach your input document here for testing? We will check the issue and provide you more information.
Best regards,

Here is the main class: (input as argument)
java classname .rtf .pdf
Attachement has the sample rtf.

public static void main(String args[])
    // String myDir="F:/Project_Info/CreditDecisioning/BI_Publisher/testrtf/Test/";
        File file = new File(args[0] + args[1]);
        InputStream is = new FileInputStream(file);
        long length = file.length();
        if (length> Integer.MAX_VALUE)
            System.*out * .println("File is too large");
        byte[] bytes = new byte[(int) length];
        // Read in the bytes
        int offset = 0;
        int numRead = 0;
        while (offset <bytes.length &&
            (numRead =, offset, bytes.length - offset))>= 0)
            offset += numRead;
        // Ensure all the bytes have been read in
        if (offset <bytes.length)
            throw new IOException("Could not completely read file " + file.getName());
        // Close the input stream and return bytes
        // bytes
        InputStream ins = new ByteArrayInputStream(bytes);
        // String input = new String(bytes, "UTF8");
        Document doc = new Document(ins);
        ByteArrayOutputStream out = new ByteArrayOutputStream();, SaveFormat.PDF);
        byte data[] = out.toByteArray();
        File f = new File(args[0] + args[2]);
        FileOutputStream fop = new FileOutputStream(f);
    catch (Exception e)
        // TODO Auto-generated catch block

Thank you for additional information. But I cannot reproduce the problem on my side. I used the latest version of Aspose.Words for testing. You can download the latest version from here:
I checked your code on in Windows7 and Ubuntu 11.10 environments.
Best regards,