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

Free Support Forum - aspose.com

Aspose word document

hi ,


ClassLoader cl = this.getClass().getClassLoader();

InputStream in = cl.getResourceAsStream("/templates/export/SG-EU-TEMPLATE.docx");

Document doc = new Document(in);


It gives a null pointer exception ,


]] Root cause of ServletException.

java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NullPointerException

at eu.europa.ec.sg.nif2.nif2.eupilot.export.AsposeWordDocument$1$beaVersion0_170.write(AsposeWordDocument.java:82)

at eu.europa.ec.sg.nif2.nif2.eupilot.export.AsposeWordDocument$1.write(AsposeWordDocument.java)

at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:71)

at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:57)

at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:306)

Truncated. see log file for complete stacktrace

Caused By: java.lang.RuntimeException: java.lang.NullPointerException

at asposewobfuscated.zzAK.zzY(Unknown Source)

at com.aspose.words.Document.(Unknown Source)

at eu.europa.ec.sg.nif2.nif2.eupilot.export.UpdateHeaderFooter$beaVersion0_176.updateHeader(UpdateHeaderFooter.java:23)

at eu.europa.ec.sg.nif2.nif2.eupilot.export.UpdateHeaderFooter.updateHeader(UpdateHeaderFooter.java)

at eu.europa.ec.sg.nif2.nif2.eupilot.export.AsposeWordDocument$beaVersion0_49.createDocument(AsposeWordDocument.java:506)

Truncated. see log file for complete stacktrace

Caused By: java.lang.NullPointerException

at asposewobfuscated.zzW.zzZ(Unknown Source)

at asposewobfuscated.zzW.zzZ(Unknown Source)

at asposewobfuscated.zzAK.zzY(Unknown Source)

at com.aspose.words.Document.(Unknown Source)

at eu.europa.ec.sg.nif2.nif2.eupilot.export.UpdateHeaderFooter$beaVersion0_176.updateHeader(UpdateHeaderFooter.java:23)

Truncated. see log file for complete stacktrace

>

Hi Shilpa,


Have you tried Aspose.Words for Java 16.11.0?
http://www.aspose.com/downloads/words/java

In case the problem still remains, please attach your input Word document you’re getting this problem with here for testing. We will investigate the issue on our end and provide you more information.

Best regards,
I am using the following dependency :


com.aspose
aspose-words
16.7.0
jdk16


Shall i use :

16.11.0 instead 16.7.0 ?


Can u please help me ASAP ?

Hi Shilpa,


Yes, please use the following dependency.

<pre style=“font-family: “Courier New”; font-size: 9pt;”><dependencies>
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-words</artifactId>
<version>16.11.0</version>
<classifier>jdk16</classifier>
</dependency>
</dependencies>

Best regards,