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
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.
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
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.
have anyone successfully make setDisplayGridlines() works?
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.
Thats what i was trying to say ;-) Guess i could have worded it a bit better. Jason
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
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.
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
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