How to read an Excel file inside jar/war file

Y

Yunbo

I am working with Weblogic 10 server.

My requirement is to fill a template file (.xls) with some data. That
means I need read this .xls file and then write into it.

I put this .xls file inside the war (webapp/template/test.xls) and I
use Apache POI as a library for treating MS documents.

The problem is when I try to get the inputStream of this file I got an
exception thrown by Weblogic.

The interesting thing is that when I put this .xls file somewhere else
on the server and pass an absolute Path (ex: /var/tmp/test.xls), it
worked perfectly.

I think this should be an issue of interaction between Weblogic and
POI library, but with some Google search, I can't find any solution
not event an explanation about this.

Any help would be appreciated. And thank you in advance.
 
A

Arne Vajhøj

I am working with Weblogic 10 server.

My requirement is to fill a template file (.xls) with some data. That
means I need read this .xls file and then write into it.

I put this .xls file inside the war (webapp/template/test.xls) and I
use Apache POI as a library for treating MS documents.

The problem is when I try to get the inputStream of this file I got an
exception thrown by Weblogic.

How do you get that InputStream in your code?

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top