Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Mon Apr 22, 2024 11:47 am

Hello,

when I load attached signed docx, I got jdk error

Code: Select all
java.lang.NoSuchMethodError: 'void com.sun.org.apache.xml.internal.security.c14n.implementations.Canonicalizer20010315OmitComments.setWriter(java.io.OutputStream)'


I am loading it using Spire.doc latest (spire.doc-12.4.6). I tried multiple methods for loading, everything works the same.

I am using this jdk version, but the error is the same on almost all of the corretto 11 versions. Looks like xmlsec in jdk does not have a method on Canonicalizer class.

Code: Select all
openjdk 11.0.22 2024-01-16 LTS
OpenJDK Runtime Environment Corretto-11.0.22.7.1 (build 11.0.22+7-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.22.7.1 (build 11.0.22+7-LTS, mixed mode)


Is there a reccomended jdk version for running spire.doc?

Thanks.

Jan

jan.zanda
 
Posts: 14
Joined: Wed Mar 06, 2024 11:30 am

Tue Apr 23, 2024 2:48 am

Hi,

Thanks for your inquiry.
According to the message you mentioned. The Jdk you used is produced by AWS, so are you using Spire.Doc in AWS project?
Our Spire.Doc can run in open jdk8 and above. But for the jdk version of corretto 11, I am not very sure.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 994
Joined: Tue Mar 08, 2022 2:02 am

Tue Apr 23, 2024 7:21 am

Hi,

no, I am using it standalone, corretto 11 is version of openjdk supported by amazon.

https://docs.aws.amazon.com/corretto/la ... -list.html

I verified it on openjdk11 and I have the same result. Can you please verify it on your side?

Code: Select all
openjdk 11.0.23 2024-04-16
OpenJDK Runtime Environment Homebrew (build 11.0.23+0)
OpenJDK 64-Bit Server VM Homebrew (build 11.0.23+0, mixed mode)

java.lang.NoSuchMethodError: 'void com.sun.org.apache.xml.internal.security.c14n.implementations.Canonicalizer20010315OmitComments.setWriter(java.io.OutputStream)'


Thanks.

jan.zanda
 
Posts: 14
Joined: Wed Mar 06, 2024 11:30 am

Tue Apr 23, 2024 8:46 am

Hi,

Thanks for your feedback.
According to the exception message, it seems that the exception have nothing to do with Spire.Doc, if you don’t use spire.doc, is this exception thrown?
In addition, I don’t find the download link of the jdk you used, could you share the download link. And please offer your system environment, such as Win10 or MacOs. Thanks in advance.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 994
Joined: Tue Mar 08, 2022 2:02 am

Tue Apr 23, 2024 9:29 am

Here is full spire exception stack:

Code: Select all
java.lang.NoSuchMethodError: 'void com.sun.org.apache.xml.internal.security.c14n.implementations.Canonicalizer20010315OmitComments.setWriter(java.io.OutputStream)'

   at com.spire.doc.packages.sprwdt.spr▊⅙(Unknown Source)
   at com.spire.doc.packages.sprekt.spr├‱(Unknown Source)
   at com.spire.doc.packages.sprekt.spr╆⅙(Unknown Source)
   at com.spire.doc.packages.sprekt.spr┯⅙(Unknown Source)
   at com.spire.doc.packages.sprekt.spr┚⅙(Unknown Source)
   at com.spire.doc.packages.sprekt.spr│⅙(Unknown Source)
   at com.spire.doc.packages.sprwrv.spr※∬—(Unknown Source)
   at com.spire.doc.packages.sprwrv.spr〧∬—(Unknown Source)
   at com.spire.doc.Document.spr‘┑—(Unknown Source)
   at com.spire.doc.Document.spr⑄┍—(Unknown Source)
   at com.spire.doc.Document.spr※┑—(Unknown Source)
   at com.spire.doc.Document.spr⅘┍—(Unknown Source)
   at com.spire.doc.Document.loadFromStream(Unknown Source)



Environment is macOS, windows 11, windows server, linux (everywhere the same exception, no matter if correto or openjdk is used).

OpenJDK I used is for macOS, installed by brew

jan.zanda
 
Posts: 14
Joined: Wed Mar 06, 2024 11:30 am

Tue Apr 23, 2024 9:51 am

Hi,

Thanks for your feedback.
Please offer the following information to help us do further investigation.
1) The code that can reproduce your issue.
2) The input word file, you can attach here or send it via email(support@e-iceblue.com).

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 994
Joined: Tue Mar 08, 2022 2:02 am

Tue Apr 23, 2024 10:00 am

1)
(useNewEngine is true, but false works the same)
Code: Select all
 //Create Document object
        Document doc = new Document(useNewEngine);
        //Load the file IS
        doc.loadFromStream(file, FileFormat.Auto);


2) Is attached to first post.

Thanks, Jan

jan.zanda
 
Posts: 14
Joined: Wed Mar 06, 2024 11:30 am

Wed Apr 24, 2024 3:05 am

Hi,

Thanks for your feedback.
I tested your scenario with the code and word file you provided, and I reproduced your issue, I have logged it into our bug track system with the ticket number SPIREDOC-10476. Our Dev team will investigate and fix it. Once it is resolved, I’ll inform you in time.
In addition, I tested your scenario with Jdk8、jdk12 and jdk13, no exception is thrown, you can have a try.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 994
Joined: Tue Mar 08, 2022 2:02 am

Return to Spire.Doc