We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose Words with Tomcat

Hi All,

I’m trying to replace the information in my Word ( test.docx) file by taking input from Tomcat server. But when my application tries to initialize new Aspose Document, it throws the error. Can you kindly let me know how can i resolve this? I copy/pasted the code for a console application and it worked fine there.

Method lines which are throwing error:
Document doc;
doc = new Document(“E:\tes.docx”);

Error Trace:
Jan 08, 2019 3:00:23 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [Test01] in context with path [/ServletExample] threw exception [Servlet execution threw an exception] with root cause
java.lang.ClassNotFoundException: com.aspose.words.Document
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1328)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1157)
at org.ServletExample.com.DocumentManipulation.addToDocumnet(DocumentManipulation.java:23)
at org.ServletExample.com.ServletTest.doGet(ServletTest.java:40)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:791)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1417)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)

@asifsultan

Thanks for your inquiry. In your case, the web application is unable to access Aspose.Words’ Jar file. Please make sure that you have deployed the Aspose.Words’ Jar file with your application at web server or your application has access to it.

If you still face problem, please share the steps that you are using to reproduce this issue at our end. If you are facing this issue with specific document, please attach it here for testing. Thanks for your cooperation.

Thank you. I’ll try to deploy aspose jar file at web server and will let you know if it works.

@asifsultan

Thanks for your feedback. Please let us know if you face any issue while using Aspose.Words.