Solved

Getting error when attempting to create a workbook using Java POI API

Posted on 2014-07-30
5
146 Views
Last Modified: 2014-08-29
I am getting an error when trying to create a workbook. I have attached the error stack from the debug screen. This is the first time I have run into this issue and I think it may have something to do with the recent upgrade to Microsoft Office 2010 and I'm now trying to read .xlsx files where before I was reading .xls files. As such, it might mean I need some different jars. If so, how do I go about adding them to the application. As always, any help is greatly appreciated.
error-stack.txt
0
Comment
Question by:awking00
  • 3
  • 2
5 Comments
 
LVL 2

Expert Comment

by:Jack Frost
ID: 40230653
I've not used POI and someone who has may be able to give more specific help.  Also you didn't really describe your environment very much.  Windows/Mac/Linux.   How the app is launched,  cmdline/script/somethingElse.  Sorry if this is all obvious to someone who knows POI.

I think you looking for the POI-HSSF and or POI-XSSF related jar files.  You may need to verify that they are somewhere in your system.  

Once you have loaded/located the jar files there are generally two ways to specify where to find the .JAR files to the JVM.

The CLASSPATH environment variable.
The -cp/-classpath command line parameter of the java jvm.   Try java -h for parameters.

To make adjustments you may need to track down a launch script.  Or the parameters of a desktop launch widget.  The CLASSPATH could also be set by login scripts.

This article talks a bit about the CLASSPATH environment variable: http://docs.oracle.com/javase/tutorial/essential/environment/paths.html
0
 
LVL 31

Author Comment

by:awking00
ID: 40231492
Added information - The environment is Windows and the application is being launched via Eclipse.
0
 
LVL 2

Accepted Solution

by:
Jack Frost earned 500 total points
ID: 40231991
So your using run/debug?  I've only used Eclipse as a development environment. Usually Eclipse is pretty good about including Jars that are part of a project.   You can check the settings under:

Run -> Run Configurations.  Choose the application in the list then click the Classpath tab.

Pretty much the same for debug configurations.

If your jars are not in the list you can add them manually in the User Entries.  But you may also want to check your project dependencies if you think the jars are in location that is known to the project.
0
 
LVL 31

Author Comment

by:awking00
ID: 40261369
Please bear with me as I am awaiting the installation of a new version of Java that I belileve contains the jar file(s) that I need. I work in a place that makes one go through hoops to install any new software. I will close the question when I find that the upgrade solves my problem.
0
 
LVL 31

Author Closing Comment

by:awking00
ID: 40292850
The jar files I needed were just recently made available and adding them to my class path took care of the issue.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now