Bug 23878

Summary: setDisplayGridlines() still not working! (The Error)
Product: POI Reporter: junzone
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED INVALID    
Severity: normal    
Priority: P3    
Version: 2.0-pre3   
Target Milestone: ---   
Hardware: PC   
OS: other   

Description junzone 2003-10-17 01:11:16 UTC
Hi,
     I have installed the latest version of POI 2.0-Pre3 on my computer and i 
tried to run my codes with setDisplayGridlines(false) but it is not working(the 
errors msgs are below). Has any one successfully tried running 
setDisplayGridlines() with this version of POI or are there still bugs with POI 
2.0-Pre3?


if anyone is interested with my codes, here they are:

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
import java.text.*;
import java.util.*;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.hssf.util.*;
import javax.servlet.ServletException;

.
.
.
HSSFSheet[] workSheets = new HSSFSheet[1];
HSSFSheet oneSheet = null;
.
.
.
.
oneSheet.setGridsPrinted(false);
oneSheet.setPrintGridlines(false);
oneSheet.setDisplayGridlines(false);


And here are part of the errors...

type Exception report

message 

description The server encountered an internal error() that prevented it from 
fulfilling this request.

exception 

javax.servlet.ServletException: Servlet execution threw an exception at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:269)at 
org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:193)at
filters.ExampleFilter.doFilter(ExampleFilter.java:149)at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:213)at
org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:193)at
org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:260)

root cause 
java.lang.NoSuchMethodError at
ByProduct_RegionCompany.set_sheet_layout(ByProduct_RegionCompany.java:802)
at ByProduct_RegionCompany.generateSDExcelReport
(ByProduct_RegionCompany.java:86 at Excel.processExecute(Excel.java:70)
at Excel.doGet(Excel.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:247) at
org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:193)
	



Anyone has any successful experiences with  setDisplayGridlines() ?
Thanks
billy
Comment 1 Jason Height 2003-10-17 06:28:11 UTC
OK I am sorry but this information is not sufficient for this bug to be
accepted. And here is why:

1) You supply a code segment that is clearly not compilable.
2) The error in the exception provided is a NoSuchMethodError which probably
means that you are compiling against 2.0-pre3 but running against an older
version. Plus this is not the complete exception that would have been displayed
at the server as I cannot see any HSSF code in the stack trace.

Feel free to reopen this bug with a compilable *SMALL* segment of code that
shows the error, then someone may have a look at it. 

Comment 2 junzone 2003-10-17 08:43:30 UTC
HTTP Status 500 - 

--------------------------------------------------------------------------------

type Exception report

message 

description The server encountered an internal error () that prevented it from 
fulfilling this request.

exception 

javax.servlet.ServletException: Servlet execution threw an exception
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:269)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:193)
	at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:213)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:260)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:191)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke
(AuthenticatorBase.java:471)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641)
	at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.catalina.core.StandardContext.invoke
(StandardContext.java:2396)
	at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:180)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke
(ErrorDispatcherValve.java:170)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641)
	at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:172)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641)
	at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:174)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.coyote.tomcat4.CoyoteAdapter.service
(CoyoteAdapter.java:223)
	at org.apache.coyote.http11.Http11Processor.process
(Http11Processor.java:405)
	at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnectio
n(Http11Protocol.java:380)
	at org.apache.tomcat.util.net.TcpWorkerThread.runIt
(PoolTcpEndpoint.java:508)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
(ThreadPool.java:533)
	at java.lang.Thread.run(Thread.java:479)


root cause 

java.lang.NoSuchMethodError
	at ByProduct_RegionCountry.set_sheet_layout
(ByProduct_RegionCountry.java:662)
	at ByProduct_RegionCountry.generateSDExcelReport
(ByProduct_RegionCountry.java:87)
	at Excel.processExecute(Excel.java:72)
	at Excel.doGet(Excel.java:119)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:247)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:193)
	at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:213)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:260)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:191)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke
(AuthenticatorBase.java:471)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641)
	at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.catalina.core.StandardContext.invoke
(StandardContext.java:2396)
	at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:180)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke
(ErrorDispatcherValve.java:170)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641)
	at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:172)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641)
	at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:174)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.coyote.tomcat4.CoyoteAdapter.service
(CoyoteAdapter.java:223)
	at org.apache.coyote.http11.Http11Processor.process
(Http11Processor.java:405)
	at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnectio
n(Http11Protocol.java:380)
	at org.apache.tomcat.util.net.TcpWorkerThread.runIt
(PoolTcpEndpoint.java:508)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
(ThreadPool.java:533)
	at java.lang.Thread.run(Thread.java:479)



--------------------------------------------------------------------------------

Apache Tomcat/4.1.12
Comment 3 Jason Height 2003-10-17 10:11:44 UTC
Thanks for providing the extra information but it still doesnt help. Look at 
the root cause in the exception:

java.lang.NoSuchMethodError
	at ByProduct_RegionCountry.set_sheet_layout
(ByProduct_RegionCountry.java:662)
	at ByProduct_RegionCountry.generateSDExcelReport

OK from that exception i have absolutely no idea what this has to do with 
HSSF. What did you call at line 662 of ByProduct_RegionCountry.java?

Please check that you have the version of POI installed on the server that you 
expect.
Comment 4 junzone 2003-10-22 02:58:04 UTC
have anyone successfully make setDisplayGridlines() works?
Comment 5 Shawn Laubach 2003-10-22 13:32:44 UTC
Yes, I've gotten it working.

If you're getting a NoSuchMethodException then you are running against a 
different version that what you compiled against (this is because the compiler 
won't compile something unless it can find all the methods).  To correct this 
problem, find where you have POI installed under your servlet engine (Tomcat?) 
and replace it with the one you are compiling against.

BTW Jason, if the problem is with the call into HSSF, you won't see it 
mentioned in the stack trace.
Comment 6 Jason Height 2003-10-22 21:58:05 UTC
Thats what i was trying to say ;-) Guess i could have worded it a bit better.

Jason
Comment 7 junzone 2003-11-13 05:25:21 UTC
May I know beside installing the poi-2.0-pre3-20030728.jar file, what other 
files do I need to install? Cause after installing poi-2.0-pre3-20030728.jar, 
setDisplayGridlines() still cannot works. What could be the problem? The errors 
threw back are: javax.servlet.ServletException: Servlet execution threw an 
exception and java.lang.NoSuchMethodError. 



Please help
Regards
Billy

Comment 8 Shawn Laubach 2003-11-13 16:30:38 UTC
Do you remove the old POI jar file?  You need to look at the classpath and 
library paths that the servlet engine is using and remove any old version of 
POI from the path because if you installed the pre-3 in the correct place, then 
the only other thing that could be happening is that the servlet engine is 
finding a different POI version and using it first.
Comment 9 junzone 2003-11-14 01:08:12 UTC
that might be the cause of the problem .. Cause i was using poi-2.0-pre1 
earlier on. After downloading poi-2.0-pre3, what I did was deleted the old poi-
2.0-pre1 version, place the poi-2.0-pre3 jar file in the same directory and 
change the file name in the classpath from poi-2.0-pre1 to poi-2.0-pre3. So do 
I need to rebuild or recompile anything? or I still need to replace more files 
that comes together in the zip file with poi-2.0-pre3? if all the above dont 
work, how do I do a clean remove of all the poi files and reinstall the poi-2.0-
pre3 again?


Regards
Billy
Comment 10 junzone 2003-11-21 01:53:37 UTC
Hi All,
      I have debug the problem. It's actually because I still retrieved the POI 
pre1 version in that directory together with pre3 . Even though the classpath 
is set to the path pointing to the pre3 jar file, the tomcat engine will still 
accept POI pre1 cause whenever the tomcat is started, it will  goes to that  
directory and read all jar files from top to bottom and since pre1 jar file 
comes before pre3 jar file, it will accept pre1 first and ignore pre3. So 
deleting pre1 will force tomcat engine to accept pre3.


Thanks to everyone for their advises over here.


Regards
Billy