Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP - Excel using POI

 
Varsha Pardeshi
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

Generated servlet error:
[javac] Compiling 1 source file

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
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Varsha Pardeshi
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Varsha Pardeshi
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic