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.

Tue Apr 06, 2021 11:30 am

Hi,

I wanted to evaluate your product for working with.docx files within Java so I downloaded your free Spire.Doc.jar file from your website.

However when I attempt to build and run the program I am getting the following error:

warning: Supported source version 'RELEASE_6' from annotation processor 'org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor' less than -source '1.8'
Note: Creating static metadata factory ...
error: com.sun.tools.javac.code.Symbol$CompletionFailure: class file for com.spire.doc.packages.spryOb$1 not found


An annotation processor threw an uncaught exception.
Consult the following stack trace for details.
java.lang.RuntimeException: com.sun.tools.javac.code.Symbol$CompletionFailure: class file for com.spire.doc.packages.spryOb$1 not found


I have added the .jar file to my class path however there appears to be a class file missing from the com.spire.packages location.

Can you please assist?

Thanks

John

johnnyhoey
 
Posts: 2
Joined: Tue Mar 30, 2021 10:47 am

Wed Apr 07, 2021 10:01 am

Hello,

Thanks for your inquiry.
I created a simple project and did an initial test with the Free Spire.Doc v3.9.0, but did not encounter the issue you mentioned. Here is my test project.
To help us investigate further, please provide your runnable project that could reproduce your issue for our reference. You could upload it to the DropBox or OneDrive and then share the download link with us.

Sincerely,
Elena
E-iceblue support team
User avatar

Elena.Zhang
 
Posts: 279
Joined: Thu Jul 23, 2020 1:18 am

Wed Apr 07, 2021 11:23 am

Hi Elena,

Thanks for your response.

I managed to get the project to build successfully within Netbeans. What I had to do was remove the following code from my class:

Code: Select all
document.getMailMerge().MergeImageField = new MergeImageFieldEventHandler()

            @Override 
            public void invoke(Object sender, MergeImageFieldEventArgs args)
            { 
                mailMerge_MergeImageField(sender, args); 
            } 
}; 

private static void mailMerge_MergeImageField(Object sender, MergeImageFieldEventArgs field)
    { 
        String filePath = field.getImageFileName(); 
        if (filePath != null && !"".equals(filePath))
        { 
            try
            { 
                field.setImage(filePath); 
            }
            catch (Exception e)
            { 
                e.printStackTrace(); 
            } 
        } 
    }


Once I did this, the code worked, compiled and built successfully. I am not sure why it didn't work with the above code included as it looks OK.

Thanks again for your help.

Regards

John

johnnyhoey
 
Posts: 2
Joined: Tue Mar 30, 2021 10:47 am

Thu Apr 08, 2021 3:04 am

johnnyhoey wrote:Hi Elena,

Thanks for your response.

I managed to get the project to build successfully within Netbeans. What I had to do was remove the following code from my class:

Code: Select all
document.getMailMerge().MergeImageField = new MergeImageFieldEventHandler()

            @Override 
            public void invoke(Object sender, MergeImageFieldEventArgs args)
            { 
                mailMerge_MergeImageField(sender, args); 
            } 
}; 

private static void mailMerge_MergeImageField(Object sender, MergeImageFieldEventArgs field)
    { 
        String filePath = field.getImageFileName(); 
        if (filePath != null && !"".equals(filePath))
        { 
            try
            { 
                field.setImage(filePath); 
            }
            catch (Exception e)
            { 
                e.printStackTrace(); 
            } 
        } 
    }


Once I did this, the code worked, compiled and built successfully. I am not sure why it didn't work with the above code included as it looks OK.

Thanks again for your help.

Regards

John

Hello John,

Glad to hear that you have found the cause of your issue.
But I tested the code snippet you provided, and still did not reproduce your issue. To help us further analyze, could you please provide your runnable project and tell us your JDK version? Thanks in advance.

Sincerely,
Andy
E-iceblue support team
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Return to Spire.Doc