Temporary license is not working with the 23.12 aspose-cad (java)

Library:

com.aspose
aspose-cad
23.12

license.setLicense(MainTestCad.class.getResourceAsStream(“/Aspose.CADforJava.lic”)); // file is placed in resources
cause the following exception

com.aspose.cad.cadexceptions.FrameworkException: Invalid license signature. Please make sure the license file was not modified.
com.aspose.cad.License$a.a(Unknown Source)
com.aspose.cad.License.setLicense(Unknown Source)

Additional details:
It’s MacOS (m1), Java 17.

@ourasovbigid,
Hi.
Could you please send us this license file as described here?

@oleksii.gorokhovatskyi, I sent you the license file (in a zip archive, the forum doesn’t allow sending a .lic file extension).

@ourasovbigid,
could you please double check the paths to license file and try if some other way to set up license works, e.g.:

com.aspose.cad.License license = new com.aspose.cad.License();

license.setLicense("C:\\pathToLic\\Aspose.CADforJava.lic");
license.setLicense("resources/Aspose.CADforJava.lic");
license.setLicense(MyTests.class.getResourceAsStream("/Aspose.CADforJava.lic"));

All these three ways work for me with your license file.

Yes. They are not working.

@ourasovbigid,
we have created CADJAVA-11523 to investigate this issue for macOS.

@ourasovbigid,
it could be helpful it you can provide some empty project sample, so we can test it directly.

@oleksii.gorokhovatskyi, sure. Please see the attached zip archive with the test project.
aspose trial issue.zip (11.5 KB)

@ourasovbigid,
thank you, we will check this in the scope of CADJAVA-11523 ticket.

@ourasovbigid,
could you please provide here the result of this printing out license on your side:

License license = new License();
try (InputStream inputStream = Main.class.getResourceAsStream("/Aspose.CADforJava.lic")) {
String text = new String(inputStream.readAllBytes());
System.out.println(text);
}
<?xml version="1.0"?>
<License>
 ...
</License>

BTW, here is an error if I try to load a dwg file, and the license is not provided.
Caused by: class com.aspose.cad.internal.Exceptions.ArgumentException: Culture Name: en-UA is not a supported culture

@ourasovbigid,
please share this DWG. Does it fail for all DWG without license or just some specific ones?

For all the files that I tried.
anteen.dwg.zip (2.1 MB)

@ourasovbigid,
please try whether some of these lines (or combination of them) change something:

com.aspose.cad.CurrentThreadSettings.setLocale("en-US");
com.aspose.cad.CurrentThreadSettings.setLocale(new java.util.Locale("en", "US"));
java.util.Locale.setDefault(new java.util.Locale("en", "US"));

Please, add this before license applying.

@oleksii.gorokhovatskyi, I got the next exception:
Exception in thread “main” class com.aspose.cad.cadexceptions.FrameworkException: Unsupported locale: en-US
com.aspose.cad.CurrentThreadSettings.setLocale(Unknown Source)
aspose.test.Main.main(Main.java:12)

@ourasovbigid,
what about this?

java.util.Locale.setDefault(new java.util.Locale("en", "US"));

@oleksii.gorokhovatskyi , it works! image object is created successfully. License is applied too. Thanks a lot!

1 Like

@ourasovbigid,
happy to hear that probem was resolved :slight_smile: