poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrea Lanza" <andrea.la...@gas.it>
Subject R: strange problem with columns autosize
Date Thu, 30 May 2013 14:51:53 GMT
I tried to add the option, 

-Djava.awt.headless="true" 

to the startup script, but it did not solve the problem
I printed the stacktrace, if it could be of interest in debugging:

WITH  -Djava.awt.headless="true"
java.lang.NullPointerException
        at
sun.awt.X11FontManager.getDefaultPlatformFont(X11FontManager.java:779)
        at sun.font.SunFontManager$2.run(SunFontManager.java:432)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.font.SunFontManager.<init>(SunFontManager.java:375)
        at sun.awt.X11FontManager.<init>(X11FontManager.java:32)
        at sun.reflect.GeneratedConstructorAccessor9.newInstance(Unknown
Source)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
torAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
        at java.lang.Class.newInstance0(Class.java:374)
        at java.lang.Class.newInstance(Class.java:327)
        at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83)
        at java.security.AccessController.doPrivileged(Native Method)
        at
sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
        at java.awt.Font.getFont2D(Font.java:490)
        at java.awt.Font.canDisplayUpTo(Font.java:2027)
        at java.awt.font.TextLayout.singleFont(TextLayout.java:469)
        at java.awt.font.TextLayout.<init>(TextLayout.java:527)
        at
org.apache.poi.ss.util.SheetUtil.getColumnWidth(SheetUtil.java:208)
        at
org.apache.poi.hssf.usermodel.HSSFSheet.autoSizeColumn(HSSFSheet.java:1949)
        at
org.apache.poi.hssf.usermodel.HSSFSheet.autoSizeColumn(HSSFSheet.java:1932)
        at gasit.DoReportEco.ridimensionaColonne(DoReportEco.java:389)
        at gasit.DoReportEco.reportMateriale(DoReportEco.java:137)
        at gasit.DoReportEco.execute(DoReportEco.java:48)
        at gasit.ReportEco.doTutto(ReportEco.java:20)
        at gasit.Prototype.doJob(Prototype.java:139)
        at gasit.Prototype.doPost(Prototype.java:92)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:305)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:210)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:225)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:169)
        at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
.java:472)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168
)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
        at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:118)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
        at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Proce
ssor.java:999)
        at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(Abstrac
tProtocol.java:565)
        at
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:
1812)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:11
45)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6
15)
        at java.lang.Thread.run(Thread.java:722)

WITHOUT  -Djava.awt.headless="true"
java.lang.NullPointerException
        at
sun.awt.X11FontManager.getDefaultPlatformFont(X11FontManager.java:779)
        at sun.font.SunFontManager$2.run(SunFontManager.java:432)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.font.SunFontManager.<init>(SunFontManager.java:375)
        at sun.awt.X11FontManager.<init>(X11FontManager.java:32)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
sorImpl.java:57)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
torAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
        at java.lang.Class.newInstance0(Class.java:374)
        at java.lang.Class.newInstance(Class.java:327)
        at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83)
        at java.security.AccessController.doPrivileged(Native Method)
        at
sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
        at java.awt.Font.getFont2D(Font.java:490)
        at java.awt.Font.canDisplayUpTo(Font.java:2027)
        at java.awt.font.TextLayout.singleFont(TextLayout.java:469)
        at java.awt.font.TextLayout.<init>(TextLayout.java:527)
        at
org.apache.poi.ss.util.SheetUtil.getColumnWidth(SheetUtil.java:208)
        at
org.apache.poi.hssf.usermodel.HSSFSheet.autoSizeColumn(HSSFSheet.java:1949)
        at
org.apache.poi.hssf.usermodel.HSSFSheet.autoSizeColumn(HSSFSheet.java:1932)
        at gasit.DoReportEco.ridimensionaColonne(DoReportEco.java:389)
        at gasit.DoReportEco.reportMateriale(DoReportEco.java:137)
        at gasit.DoReportEco.execute(DoReportEco.java:48)
        at gasit.ReportEco.doTutto(ReportEco.java:20)
        at gasit.Prototype.doJob(Prototype.java:139)
        at gasit.Prototype.doPost(Prototype.java:92)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:305)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:210)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:225)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:169)
        at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
.java:472)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168
)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
        at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:118)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
        at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Proce
ssor.java:999)
        at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(Abstrac
tProtocol.java:565)
        at
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:
1812)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:11
45)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6
15)
        at java.lang.Thread.run(Thread.java:722)

WITH or WITHOUT that option, seems exactly the same:

Should I specify anything while COMPILING the classes ?
I.e. any compile options in order to exclude the graph, or should it be
sufficient the -Djava.awt.headless="true" at tomcat-level ?

Or maybe I am not setting the option properly !
this is the command line I modified 
(later I could put it into /etc/tomcat/tomcat.conf, but now I hardcoded it
into /usr/sbin/dtomcat)

.....
if [ "$1" = "start" ]; then
  ${JAVACMD} $JAVA_OPTS $CATALINA_OPTS \
    -classpath "$CLASSPATH" \
    -Dcatalina.base="$CATALINA_BASE" \
    -Dcatalina.home="$CATALINA_HOME" \
    -Djava.awt.headless="true" \
    -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
    -Djava.io.tmpdir="$CATALINA_TMPDIR" \
 
-Djava.util.logging.config.file="${CATALINA_BASE}/conf/logging.properties" \
    -Djava.util.logging.manager="org.apache.juli.ClassLoaderLogManager" \
    org.apache.catalina.startup.Bootstrap start \
    >> ${CATALINA_BASE}/logs/catalina.out 2>&1 &
    if [ ! -z "$CATALINA_PID" ]; then
      echo $! > $CATALINA_PID
    fi
elif [ "$1" = "start-security" ]; then
.....

Andrea


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


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


Mime
View raw message