Setting temporary license failing in metadata SDK

While trying out metadata SDK setting my temporary license is failing. I am unable to continue to verify its all features because of this.

System requirements:
Groupdocs.Metadata : 23.10
Java : 17
OS : Windows 11

Test code

    @Test
    void metadata() throws IOException {
        com.groupdocs.metadata.licensing.License l = new com.groupdocs.metadata.licensing.License();
        try (InputStream sl = getClass().getResourceAsStream("/GroupDocs.TotalforJava.lic")) {
            l.setLicense(sl);
        }
        try (Metadata metadata = new Metadata(getClass().getResourceAsStream("/Test Document.docx"))) {
            if (metadata.getFileFormat() != FileFormat.Unknown && !metadata.getDocumentInfo().isEncrypted()) {
                System.out.println();

                int affected = metadata.addProperties(new ContainsTagSpecification(Tags.getContent().getComment()),
                    new PropertyValue("Ramaya Rama Bhadhraya."));

                System.out.println(String.format("Affected properties: %s", affected));

                metadata.save("Test Document metadata.docx");
            }
        }
    }

Error

java.lang.NoSuchMethodError: 'java.security.PublicKey com.aspose.a.a.a.x(java.lang.String, java.lang.String)'
	at com.groupdocs.metadata.internal.c.a.e.fb.a(Unknown Source)

@shiva.k

Could you please share the license file in a private message and also specify if you are using any other Aspose or GroupDocs API with the Metadata API?

This issue is not coming in Java 8. Its only coming in higher version of Java that is 17
GroupDocs.TotalforJava.pdf.
Please change extension from pdf to lic.

1 Like

@shiva.k

Thanks for the clarification. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): METADATAJAVA-526

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@shiva.k

We successfully reproduced this issue on Java JDK versions 17.0.9 and 17.0.8. But after testing the license installation code for the Java JDK version 18.0.2.1, there was no such error. Could you please also check it with Java version 18?

I am still facing the issue in Java 18. This is my Java installation details.

openjdk version "18.0.2.1" 2022-08-18
OpenJDK Runtime Environment Temurin-18.0.2.1+1 (build 18.0.2.1+1)
OpenJDK 64-Bit Server VM Temurin-18.0.2.1+1 (build 18.0.2.1+1, mixed mode, sharing)

I have tried in Java 20 as well but getting same error.

java.lang.NoSuchMethodError: 'java.security.PublicKey com.aspose.a.a.a.x(java.lang.String, java.lang.String)'
	at com.groupdocs.metadata.internal.c.a.e.fb.a(Unknown Source)
1 Like

@shiva.k

Please spare us some time to further investigate this scenario. You’ll be notified in case of any update.

@shiva.k

Unfortunately we are still unable to reproduce this issue. We tried to double-check this on our GitHub samples and everything works fine with Java 18, you can also try this GitHub project.
If issue persists please share following details with us:

  • Share license file in a private message
  • Sample project
  • A screencast explaining steps to reproduce the issue
  • Console log
  • Problematic file