Free Support Forum - aspose.com

Issue opening a document using com.aspose.words.Document


#1

Hi guys,

We use aspose as a part of a internal library to open/modify word documents.

We have a customer that is using our product with Windows 10 and basically we use:

input = new FileInputStream(file);
com.aspose.words.Document doc = new com.aspose.words.Document(
input);
input.close();

And we get the following error stacktrace:

com.aspose.words.FileCorruptedException: The document appears to be corrupted and cannot be loaded.
at com.aspose.words.FileFormatUtil.zzZ(Unknown Source)
at com.aspose.words.Document.zzY(Unknown Source)
at com.aspose.words.Document.zzZ(Unknown Source)
at com.aspose.words.Document.(Unknown Source)
at com.aspose.words.Document.(Unknown Source)
at com.aspose.words.Document.(Unknown Source)
at com.ibm.rdm.fronting.server.rrs.publish.internal.LegacyPublishService.customizeStylesheet(LegacyPublishService.java:3236)
at com.ibm.rdm.fronting.server.rrs.publish.internal.LegacyPublishService.initPublishing(LegacyPublishService.java:3179)
at com.ibm.rdm.fronting.server.rrs.publish.internal.LegacyPublishService.doInitialize(LegacyPublishService.java:2972)
at com.ibm.rdm.fronting.server.rrs.publish.internal.LegacyPublishService.doGet(LegacyPublishService.java:609)
at com.ibm.rdm.fronting.server.rrs.publish.internal.PublishServiceInternal.doGetInternal(PublishServiceInternal.java:87)
at com.ibm.rdm.fronting.server.core.internal.RRSRestServiceBase.runInternalMethod(RRSRestServiceBase.java:698)
at com.ibm.rdm.fronting.server.core.internal.RRSRestServiceBase.handleMethod(RRSRestServiceBase.java:587)
at com.ibm.rdm.fronting.server.core.internal.RRSRestServiceBase.doGet(RRSRestServiceBase.java:130)
at com.ibm.rdm.fronting.server.core.internal.RRSRestServiceBase.performService(RRSRestServiceBase.java:360)
at com.ibm.rdm.fronting.server.rrs.publish.PublishService.performService(PublishService.java:100)
at com.ibm.rdm.fronting.server.core.internal.RRSRestServiceBase.service(RRSRestServiceBase.java:208)
at com.ibm.team.jfs.app.servlet.AppContainerServlet.dispatchRequest(AppContainerServlet.java:155)
at com.ibm.team.jfs.app.servlet.AppContainerServlet.service(AppContainerServlet.java:282)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.team.repository.servlet.AbstractTeamServerServlet.handleAppSdkRestServiceRequest2(AbstractTeamServerServlet.java:2110)
at com.ibm.team.repository.servlet.AbstractTeamServerServlet.access$2(AbstractTeamServerServlet.java:2055)
at com.ibm.team.repository.servlet.AbstractTeamServerServlet$2.service(AbstractTeamServerServlet.java:271)
at com.ibm.team.repository.service.internal.oauth.OAuthServiceProvider$2.run(OAuthServiceProvider.java:327)
at com.ibm.team.repository.servlet.AbstractTeamServerServlet.handleAuthentication(AbstractTeamServerServlet.java:2166)
at com.ibm.team.repository.servlet.AbstractTeamServerServlet.handleAppSdkRestServiceRequest(AbstractTeamServerServlet.java:2031)
at com.ibm.team.repository.servlet.AbstractTeamServerServlet.service(AbstractTeamServerServlet.java:1768)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180)
at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:76)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at org.eclipse.equinox.servletbridge.BridgeServlet.service(BridgeServlet.java:152)
at com.ibm.team.repository.server.servletbridge.JazzServlet.service(JazzServlet.java:74)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1255)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:743)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:440)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:147)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)
at com.ibm.team.repository.server.servletbridge.BridgeFilter.processDelegate(BridgeFilter.java:165)
at com.ibm.team.repository.server.servletbridge.BridgeFilter.doFilter(BridgeFilter.java:198)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:201)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:86)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:995)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1124)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4962)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.handleRequest(DynamicVirtualHost.java:314)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:995)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:279)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:1009)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.wrapHandlerAndExecute(HttpDispatcherLink.java:412)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:371)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:530)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:464)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:329)
at com.ibm.ws.http.channel.internal.inbound.HttpICLReadCallback.complete(HttpICLReadCallback.java:70)
at com.ibm.ws.channel.ssl.internal.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1803)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:501)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:571)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:926)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:1015)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1160)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.lang.Thread.run(Thread.java:811)
Caused by: java.lang.NullPointerException
at com.aspose.words.zzZ00.zzZmS(Unknown Source)
at com.aspose.words.zzZ00.zzZmU(Unknown Source)
at com.aspose.words.zzZ00.zzz4(Unknown Source)
at com.aspose.words.zz5.zzTX(Unknown Source)
at com.aspose.words.zz5.zzTY(Unknown Source)
at com.aspose.words.zzZ00.zzZmY(Unknown Source)
at com.aspose.words.zzZ00.zzZ(Unknown Source)
at com.aspose.words.zz99.visitSectionStart(Unknown Source)
at com.aspose.words.Section.zzZ(Unknown Source)
at com.aspose.words.CompositeNode.acceptCore(Unknown Source)
at com.aspose.words.Section.accept(Unknown Source)
at com.aspose.words.CompositeNode.acceptChildren(Unknown Source)
at com.aspose.words.CompositeNode.acceptCore(Unknown Source)
at com.aspose.words.Document.accept(Unknown Source)
at com.aspose.words.zz99.zzZ(Unknown Source)
at com.aspose.words.Document.zzY(Unknown Source)
… 64 more

I’m almost sure that his is not a directly issue with Aspose since we have other customers without any problem but wanted to know if you have a reference about problem with permissions folder where the documents are stored.

We are using right now: aspose-words-17.11-jdk16.jar

Do you know if there is a problematic issue with this jar using windows 10 or something related to the OS or any other suggestion?


#2

@aldog,

Please ZIP and attach your input Word document you are getting this problem with here for testing. We will then investigate the issue on our end and provide you more information.


#3

Hi Awais,

Thanks for your answer, I think the issue is not related to the document itself, it is more a permission issue since we have exactly the same environment with other customers and they are not facing the issue.

I’m attaching the word document but would like to know there is a specific configuration of permissions that resulted in the mentioned stacktrace.

Thanks for your help´!audithistory word.zip (6.1 KB)


#4

@aldog,

After an initial test with the licensed latest version of Aspose.Words for Java i.e. 19.3, we were unable to reproduce this issue on our end. We would suggest you please upgrade to the latest version of Aspose.Words for Java on your end. Hope, this helps.


#5

Awais, really appreciate your help.

We tried as well with latest version with the same document and the same issue is happening, I think this is more related to a permission issue rather than a version issue, do you have an idea of possible scenario that might trigger this ?


#6

@aldog,

Aspose.Words needs to pre-cache fonts and other resources for rendering. Please make sure that the app hosted in server has access to Fonts installation directory.

P.S. you may please also check this article (True Type Fonts).


#7

Thank you awais, this opens new theory of investigation but I think the issue is at the moment of saving the stylesheet but we will keep investigating.

If you have any other suggestion to try regarding the save option, that would be awesome!

Really appreciate your help!


#8

@aldog,

Unfortunately, your question is not clear enough therefore we request you to please elaborate your inquiry further by providing complete details of the issue you are getting with the style sheet. Please ZIP and upload your sample Word document and Aspose.Words generated output document showing the undesired behavior here for testing. This will help us to understand your scenario, and we will be in a better position to address your concerns accordingly.