Pregunta

I have been developing a SpringSource 3.2 project on Java 1.5. The aim of this project is to take an excel file and output into another file of our own format after parsing the data in the excel.

When running on my local developer environment (an i5, Windows 7 machine) the process runs completely fine and the result is as expected. But when I try to run it on our SIT (which is an old Windows Server 2003 SP2 x64) I get the following exception:

2014-04-24 14:18:16:574 ERROR [main] - AbstractStep | Encountered an error executing the step java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlOptions at org.apache.poi.POIXMLDocumentPart.<clinit>(POIXMLDocumentPart.java:43) at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:62) at com.hsbc.gbm.dml.batch.item.file.ExcelFileItemReader.doOpen(ExcelFileItemReader.java:118) at org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader.open(AbstractItemCountingItemStreamItemReader.java:134) at org.springframework.batch.item.file.MultiResourceItemReader.read(MultiResourceItemReader.java:105) at org.springframework.batch.core.step.item.SimpleChunkProvider.doRead(SimpleChunkProvider.java:90) at org.springframework.batch.core.step.item.SimpleChunkProvider.read(SimpleChunkProvider.java:148) at org.springframework.batch.core.step.item.SimpleChunkProvider$1.doInIteration(SimpleChunkProvider.java:108) at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:367) at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:214) . . .

Does anyone have any idea on why this is happening? We use Maven & Spring to manage our dependencies btw.

¿Fue útil?

Solución

You're missing at least on of the Apache POI component dependencies. Specifically, you're missing Apache XMLBeans, though it's possible you're missing other things too

The Apache POI components page list all the POI modules, which components they contain, what their dependencies are, and what Maven artificats they can be fetched form. You're either missing one of the maven artifacts you need, or aren't correctly deploying the jars

Otros consejos

java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlOptions

clearly states that you not have some classes or maybe one of its dependencies and beans in your project CLASSPATH like: xmlbeans-x.x.x.jar. Make sure that's present and readable.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top