Free Support Forum -

Using Groupdocs Annoatation and the Watermark jar for java in the same project gives me Illegal Access Exception


Hello ,
I am using groupdocs-Annotation 18.8.jar and groupdocs-watermark 18.8.jar in the same project .
While adding the watermark in the file below line throws exception.

PdfDocument doc = Document.load(PdfDocument.class, inputFilePath);

Please find the exception log below :

java.lang.IllegalAccessError: tried to access class from class com.groupdocs.watermark.bc

Caused by: java.lang.IllegalAccessError: tried to access class
as from class com.groupdocs.watermark.bc
at com.groupdocs.watermark.bc.wC(Unknown Source)
at Source)
at Source)
at com.groupdocs.watermark.DocumentFactory.a(Unknown Source)
at com.groupdocs.watermark.DocumentFactory.load(Unknown Source)
at com.groupdocs.watermark.DocumentFactory.load(Unknown Source)
at com.groupdocs.watermark.Document.load(Unknown Source)
at org.infotech.jdol.client.utility.groupdocs.WatermarkUtility.addWaterm

Please guid me for the same.




Thank you for your inquiry.

We are unable to reproduce this issue at our end. Can you please share a simple application along-with problematic file? We’ll then further investigate the issue.

We integrated GroupDocs.Annotaiton for Java 18.10 and GroupDocs.Watermark for Java 18.8 in a single project.



Have you tried with web application or Standalone java application?
I am using it in web application and deployed it on wildfly server.



We investigated this issue using a standalone Java application.

However, for further investigation, can you please share a simple web application (without any dependencies) using that we can reproduce the issue.
Secondly, you can also try to reproduce this exception in a standalone application and then share that with us.



I have already tried using standalone application, there its working fine . Only problem when I deployed it as web app .

I will try with simple web app and will tell you know.



Thanks and we’d recommend you to share a simplified (to the point) web application along-with steps to run/compile it.


OK ,Sure




You are welcome.


Hi @atirtahir3,

I have solved that issue .I Just changed the sequence of jar files. Loaded the groupdocs-watermark jar at the first place before the annotation and signature jar. You can see the screen-shot attached.

But started giving new exception while loading the license for annotation jar. I think is creating this ambiguity.Because same path is present in the all three jar file.

Please find the error log below :

Exception in thread “main” java.lang.NoSuchMethodError:;
at$e.(Unknown Source)
at$e.(Unknown Source)
at$c.(Unknown Source)
at$h.(Unknown Source)
at$h.(Unknown Source)
at Source)
at Source)
at$a.(Unknown Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at com.groupdocs.annotation.internal.c.g.f.l.aspose.a.fH(Unknown Source)
at com.groupdocs.annotation.internal.c.g.f.l.aspose.a.r(Unknown Source)
at com.groupdocs.annotation.internal.c.g.f.l.b.jTb(Unknown Source)
at com.groupdocs.annotation.internal.c.g.f.l.b.b(Unknown Source)
at com.groupdocs.annotation.internal.c.g.f.handler.a.a(Unknown Source)
at com.groupdocs.annotation.internal.c.g.f.handler.a.a(Unknown Source)
at com.groupdocs.annotation.common.license.License.setLicense(Unknown Source)
at MainClass.loadLicense(
at MainClass.main(

jarlistSequence.png (182.9 KB)



Good to know that this issue is resolved.

We need sample project in order to investigate this scenario. Are you able to reproduce this (license loading) issue in standalone application?


Yes.In Standalone application also
com.groupdocs.annotation.common.license.License l = new com.groupdocs.annotation.common.license.License();

on this line its throwing exception for me.

If you want to get the same behavior at your end then add the jars in the following sequence
as shown in the attached file jarlistSequence.png (182.9 KB)



This issue is reproduced at our end as well.
Hence, it has been logged in our internal issue tracking system with ID : ANNOTATIONJAVA-1130. We’re now investigating it. As we have any further updates, we’ll notify you.


@atirtahir3 Ok ,

Thank you .



You are welcome.