Hi all,
I am developing a web application, using netbeans 7.1 on a windows 7
workstation
I am using the boundled  tomcat 7 to test the application
then I put the application war in test and production environment, both on
opensuse 12.2, jdk 7 and tomcat 7 too.

My app produce an excel workbook from a servlet. The workbook is created as
new, and using poi 3.9.
Everithing works fine, apart from  autoSizeColumn.

In my code autoSizeColumn is invoked only once for each column AFTER adding
all the cells to the sheet.

In netbeans it works like a charm.

In production and test it raises a  java.lang.NullPointerException for each
column it works on !

I also tried to just set the column width to a given value, and it works in
both environments (meaning, according to me, that sheet-columns are OK)

This is the code I am using (please note the two lines for columns-sizing ,
first one always working, second one working only on windows)
.....
        for (int k = 0; k < result.getMetaData().getColumnCount(); k++) {
                MyCaller.myDebugInfo.addLine("Ridimensiono la colonna " + k,
MyCaller.LEVELDEBUG, MyCaller.mysession);
                try {
                    //in windows autoSizeColumn(k); funziona; in linux spara
una eccezione
                    mysheet.setColumnWidth(k, 256 * 30); //30 caratteri
                    mysheet.autoSizeColumn(k);
                } catch (Exception e) {
                    MyCaller.myDebugInfo.addLine("Exception in " +
MyCaller.getClass().getSimpleName() + ".ridimensionaColonne INTERNA: " +
e.toString(), MyCaller.LEVELERROR, MyCaller.mysession);
                    Errore = Errore + "<BR>Exception in " +
MyCaller.getClass().getSimpleName() + ".ridimensionaColonne() INTERNA : " +
e.getMessage();
                }
            } // fine for

I cannot understand where the problem could be. The poi libs are the same on
the tomcat server on my workstation and on the linux boxes (these libs are
all in the lib dir of the tomcat server)
Of course other libs could be different (catalina.jar, tomcat.jar...) 

Any help will be gratly appreciated.

Thanks in advance,

Andrea







-- 
Il messaggio e' stato analizzato alla ricerca di virus o
contenuti pericolosi da MailScanner, ed e'
risultato non infetto.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to