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.

Thu May 04, 2023 1:41 pm

Dear support team,

since I've updated Spire.Doc for Java from 5.2.3 to 11.4.2 (latest version) I get the following exception when calling method TableRow.deepClone() within our document generation process:

Code: Select all
Caused by: com.spire.doc.packages.sprdzt: An element with the same key already exists in the dictionary.
   at com.spire.ms.System.Collections.Generic.Dictionary.addItem(Dictionary.java:414)
   at com.spire.doc.packages.sprnzz.spr‼┊—(Unknown Source)
   at com.spire.doc.collections.CommentsCollection.spr┓┼—(Unknown Source)
   at com.spire.doc.documents.CommentMark.setCommentId(Unknown Source)
   at com.spire.doc.documents.CommentMark.spr┺‼—(Unknown Source)
   at com.spire.doc.documents.CommentMark.spr※‼—(Unknown Source)
   at com.spire.doc.DocumentObject.deepClone(Unknown Source)
   at com.spire.doc.collections.ParagraphItemCollection.spr┃┻—(Unknown Source)
   at com.spire.doc.documents.Paragraph.spr≌┯—(Unknown Source)
   at com.spire.doc.documents.Paragraph.spr┺‼—(Unknown Source)
   at com.spire.doc.documents.Paragraph.spr※‼—(Unknown Source)
   at com.spire.doc.DocumentObject.deepClone(Unknown Source)
   at com.spire.doc.collections.DocumentObjectCollection.spr∭≇—(Unknown Source)
   at com.spire.doc.Body.spr┺‼—(Unknown Source)
   at com.spire.doc.TableCell.spr┺‼—(Unknown Source)
   at com.spire.doc.TableCell.spr※‼—(Unknown Source)
   at com.spire.doc.TableCell.deepClone(Unknown Source)
   at com.spire.doc.collections.DocumentObjectCollection.spr∭≇—(Unknown Source)
   at com.spire.doc.TableRow.spr┺‼—(Unknown Source)
   at com.spire.doc.TableRow.spr※‼—(Unknown Source)
   at com.spire.doc.TableRow.deepClone(Unknown Source)
   ...


I have not changed anything else!

It is quite expensive to me to provide you with a simplified code example that runs outside of our application context. Hence I hope that the stack trace and the fact that nothing else has changed except the Spire.Doc for Java version will help you to find the reason for this exception.

Kind regards,
Marcus

mgattinger
 
Posts: 65
Joined: Fri May 21, 2021 9:03 am

Fri May 05, 2023 3:04 am

Hi,

Thanks for your message.
I simulated the attached document and did an initial test with the following simple code, but I did not reproduce your problem.
Code: Select all
        Document doc = new Document();
        doc.loadFromFile("TableTemplate.docx");

        Section se = doc.getSections().get(0);

        Table original_table = se.getTables().get(0);

        TableRow tableRow1 = original_table.getRows().get(1).deepClone();

        original_table.getRows().add(tableRow1);

        doc.saveToFile("outfile1.docx", FileFormat.Docx);
       

Based on your error information, I’m afraid that it is related to your document. To help us have the further investigation, please provide us with the following information. Thank you advance.
1. Your testing code.
2. Your input file, which you can upload it here or provide to us by email. ([email protected]).

Best Regards,
Herman
E-iceblue support team
User avatar

Herman.Yan
 
Posts: 115
Joined: Wed Mar 08, 2023 2:00 am

Fri May 05, 2023 7:42 am

Please find attached the sample document and the java code to reproduce the problem.

mgattinger
 
Posts: 65
Joined: Fri May 21, 2021 9:03 am

Fri May 05, 2023 9:06 am

Hi,

Thank you for your feedback
I did reproduce your problem after testing your file. I have recorded this issue in our tracking system by using SPIREDOC-9382. Our development team will do further investigation and fix. We will keep you informed about its' updates. Sorry for any inconvenience caused.

Best Regards,
Herman
E-iceblue support team
User avatar

Herman.Yan
 
Posts: 115
Joined: Wed Mar 08, 2023 2:00 am

Fri Jun 23, 2023 12:00 pm

Any news on this topic?
Will I get informed as soon as the bug is fixed?

Kind regards,
Marcus

mgattinger
 
Posts: 65
Joined: Fri May 21, 2021 9:03 am

Sun Jun 25, 2023 5:51 am

Hello,

Thank you for following up.
I got the news from our Dev team that this issue has been resolved and it is in the testing phase, once the tests pass, we will prepare a hotfix version for you ASAP.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1534
Joined: Wed Apr 25, 2018 3:20 am

Tue Jul 11, 2023 3:39 am

Hello,

Glad to inform that we just released Spire.Doc for Java Version:11.7.0 which fixed the issue of SPIREDOC-9382, welcome to test it.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1534
Joined: Wed Apr 25, 2018 3:20 am

Tue Jul 11, 2023 10:50 am

I can confirm that the most recent version fixes the problem.
Thank you very much.

Kind regards,
Marcus

mgattinger
 
Posts: 65
Joined: Fri May 21, 2021 9:03 am

Wed Jul 12, 2023 1:22 am

Hello,

Glad to hear that, if there is anything else we can do for you in the future, just feel free to contact!
Have a nice day! :)

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1534
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.Doc