HI,
Thank you for your response.
I have checked dependecies from libraries, ( I have all listed libraries in my application )
I have just installed new version 7.0.2 ( previously I used 7.0.1.5 ),
but I experienced same error.
As I understood class belong to library: woodstox-core-asl-4.1.1 ?? yes?
So I need to focus on this library?
Could be the reason of problem If I also have another libraries in my classpath,
and they may confilct?
I have copied these libraries into JBoss folder: jboss-5.0.1.GA\server\application\lib
bcprov-jdk16-146.jar
stax2-api-3.0.2.jar
woodstox-core-asl-4.1.1.jar
dom4j-1.6.1.jar
but I have not isntalled
jsr173_1.0_api.jar ( I'm using JDK 1.6, and it is written in Readme that I don't need to use it )
Exception is still thrown here:
workbook.save( out, new OoxmlSaveOptions( SaveFormat.XLSX ) );
Here is full code: (and realy seems like it works If I will run it without apllication server via main class )
Workbook workbook = createWorkbook( report.getPageCount() );
private Workbook createWorkbook( int pageCount )
{
Workbook workbook = new Workbook();
WorksheetCollection worksheets = workbook.getWorksheets();
int worksheetsCount = worksheets.getCount();
if( worksheetsCount < pageCount )
{
for( int i = worksheetsCount; i < pageCount; i++ )
{
worksheets.add ();
}
}
else if( worksheetsCount > pageCount )
{
while( worksheetsCount != pageCount )
{
worksheets.removeAt( worksheetsCount - 1 );
worksheetsCount = worksheets.getCount();
}
}
// Contains data for charts
worksheets.add ();
return workbook;
}
protected byte[] getBytes()
{
ByteArrayOutputStream out = new ByteArrayOutputStream();
try
{
workbook.save( out, new OoxmlSaveOptions( SaveFormat.XLSX ) );
}
catch( Exception exception )
{
}
return out.toByteArray();
}