1.I have Download poi-src-3.0-alpha1-20050704.zip from the website. 2. Extracted it. 3. Put the file poi-2.0-final-20040126.jar into my classpath. 4. import org.apache.poi.poifs.filesystem.* for the poi-poif functionality (POIFSFileSystem etc.) 5. import org.apache.poi.hssf.usermodel.* for the hssf functionality (HSSFWorkbook etc.)
but getting fllowing error:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 2 in the jsp file: /FurnaceDev/tryExcel.jsp
C:\tomcat\work\Standalone\localhost\_\FurnaceDev\tryExcel_jsp.java:9: package org.apache.poi.hpsf does not exist import org.apache.poi.hpsf.*; ^ C:\tomcat\work\Standalone\localhost\_\FurnaceDev\tryExcel_jsp.java:10: package org.apache.poi.poifs.eventfilesystem does not exist import org.apache.poi.poifs.eventfilesystem.*; ^ C:\tomcat\work\Standalone\localhost\_\FurnaceDev\tryExcel_jsp.java:49: cannot resolve symbol symbol : class HSSFWorkbook location: class org.apache.jsp.tryExcel_jsp HSSFWorkbook wb = new HSSFWorkbook(myxls);
is it mandatory to use ANT & forrest? please help me. Thanks in advance.
Chetan Parekh
Ranch Hand
Joined: Sep 16, 2004
Posts: 3636
posted
0
First copy your poi-2.0-final-20040126.jar as poi-2.0-final-20040126.zip and extract the file. Look for folder structure org/apache/poi/hpsf and org/apache/poi/poifs/eventfilesystem. If any of the folder structure is not there. It means your jar file does not contain package that you are importing. If folder structure found, it means jar is not on classpath.
Do this and let use know the outcome.
My blood is tested +ve for Java.
Varsha Pardeshi
Ranch Hand
Joined: Feb 27, 2006
Posts: 30
posted
0
Originally posted by Chetan Parekh: First copy your poi-2.0-final-20040126.jar as poi-2.0-final-20040126.zip and extract the file. Look for folder structure org/apache/poi/hpsf and org/apache/poi/poifs/eventfilesystem. If any of the folder structure is not there. It means your jar file does not contain package that you are importing. If folder structure found, it means jar is not on classpath.
Do this and let use know the outcome.
All folder are there when I unzip the file: poi-src-3.0-alpha1-20050704.zip
I had added to classpath the path of poi-2.0-final-20040126.jar file as classpath=.;%classpath%;D:\oracle\ora92\jdbc\lib;C:\POI\src\contrib\poi-ruby\poi-2.0-final-20040126.jar;
Still getting the same error. Please help me.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35258
7
posted
0
Put the file poi-2.0-final-20040126.jar into my classpath
Where exactly is that? In a web app, the jar needs to be in the WEB-INF/lib folder. Tomcat (or whatever servlet container you use) does not use the system classpath. [ March 01, 2006: Message edited by: Ulf Dittmer ]
Where exactly is that? In a web app, the jar needs to be in the WEB-INF/lib folder. Tomcat (or whatever servlet container you use) does not use the system classpath.
[ March 01, 2006: Message edited by: Ulf Dittmer ]
Thanks a lot. I had placed the jar file in WEB-INF/lib. & my problem has solved.