Hello,
I use Aspose.Words v2.4.2 for Java (JDK JSE 1.5.0_06) and in the context of a multi-threaded application (one thread by generated document) with relative high speed processing (document generated in 2 seconds), i encounter sometime this exception :
com.aspose.words.FileCorruptedException: The document appears to be corrupted and cannot be loaded.
If i retry the processing that has failed, the error doesn’t occurs…i precize that each thread work on a document and a document is not shared between different thread.
Full stack trace:
eu.curia.pwe.error.PWEException: com.aspose.words.FileCorruptedException: The document appears to be corrupted and cannot be loaded.
at eu.curia.pwe.service.impl.DocumentProcessorWordImpl.generateLabel(DocumentProcessorWordImpl.java:2901)
at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy19.generateLabel(Unknown Source)
at eu.curia.pwe.service.BusinessRequestProcessorThread.run(BusinessRequestProcessorThread.java:246)
at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy24.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.aspose.words.FileCorruptedException: The document appears to be corrupted and cannot be loaded.
at com.aspose.words.Document.a(Unknown Source)
at com.aspose.words.Document.a(Unknown Source)
at com.aspose.words.Document.(Unknown Source)
at com.aspose.words.Document.(Unknown Source)
at eu.curia.pwe.service.impl.DocumentProcessorWordImpl.generateLabel(DocumentProcessorWordImpl.java:2581)
… 26 more
Caused by: java.lang.IllegalStateException: Current state = RESET, new state = FLUSHED
at java.nio.charset.CharsetDecoder.throwIllegalStateException(CharsetDecoder.java:951)
at java.nio.charset.CharsetDecoder.flush(CharsetDecoder.java:640)
at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:769)
at asposewobfuscated.bv.e(Unknown Source)
at com.aspose.words.iv.a(Unknown Source)
at com.aspose.words.ae.a(Unknown Source)
at com.aspose.words.bn.read(Unknown Source)
… 31 more
Thanks in advance.
Best regards,
Dominique