can not access .xlsx file in class path from jar

nkk1712
nkk1712 used Ask the Experts™
on
hi ,
the following code having some problem.

final Workbook workbook = new Workbook(ClassLoader.getSystemResourceAsStream("test.xlsx"));

how to achive this. this code working fine with my eclipse, but when packge the same i am getting the following ..

java.util.zip.ZipException: incomplete literal/length tree
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016

Commented:
Commented:
i am using maven to package.

i resloved this issue by changing in assembly.xml file as follows.

<fileSet>
      <directory>src/main/resource/</directory>
      <outputDirectory>lib</outputDirectory>
      <filtered>false</filtered>
</fileSet>

Author

Commented:
i am using maven to package.

i resloved this issue by changing in assembly.xml

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial