Problem with temporary license

It looks like the setLicense method is trying to parse the LicenseInstructions. When running setLicense with the temporary license getting the following error. Is there a way around this as the temporary license is not applied and the evaluation license is still being used.

Fatal Error] :19:123: The reference to entity “d” must end with the ‘;’ delimiter.

@phil.drago

Thank you for contacting support.

Would you please elaborate a little more as temporary license is also known as evaluation license. Kindly share a narrowed down sample application so that we may try to reproduce and investigate it in our environment.

Hi, I am getting this same error when i am trying to apply our purchased license for Aspose.Total

Here is the code
public class AsposeServiceImpl implements AsposeService {

@Override
public void useWordsLisence() throws Exception {
    com.aspose.words.License lic = new com.aspose.words.License();
    lic.setLicense(getAsposeLicenseStream());
}

@Override
public void useSlidesLisence() throws Exception {
    com.aspose.slides.License lic = new com.aspose.slides.License();
    lic.setLicense(getAsposeLicenseStream());
}

@Override
public void usePDFLisence() throws Exception {
    com.aspose.pdf.License lic = new com.aspose.pdf.License();
    lic.setLicense(getAsposeLicenseStream());
}

private InputStream getAsposeLicenseStream() throws Exception {
    Session config = MgnlContext.getJCRSession("config");
    Node aspose = config.getNode("/modules/teacher-toolbox-templating/config/aspose");
    String license = PropertyUtil.getString(aspose, "asposeLicense");
    return new ByteArrayInputStream(license.getBytes());
}

}

lic.setLicense throws a SaxParseException – With the above error

@jszuslik

Would you please share complete stack trace and narrowed down sample application containing SSCCE code so that we may try to reproduce and investigate it in our environment. Also share your license as a ZIP file by clicking on my username and then message button.

Before sharing requested data, please ensure using Aspose.PDF for Java 19.3 and latest available versions of other APIs.

I am getting a SaxParseException when the license is being set. It is erroring on this element in the license <LicenseInstructions>https://urldefense.proofpoint.com/v2/url?u=https-3A__purchase.aspose.com_policies_use-2Dlicense**&d=DwIGAg&c=0i6vPcfBD4A2UCOW2UOV9gFNZGFhViJzZW4aaAjp7gA**&r=-w7AyU9rQLIs1N7ZmFBv1z4R7THeGO0GGfvnqEBvyNQ&m=jsSwadr65mSB9BbQloulYtXa3sjLgz_tNB3D7VyhzkA&s=eGU_fXg8haY-npPZGyg6DrH7ddPeSlQ-iipaB_FoahM&e=</LicenseInstructions>

This is most likely due to the license containing the decoded character & instead of &amp;

@jszuslik

Please note that the license is a digitally signed file that will no more be valid if modified. You may replace below line in your license to avoid the exception:

<LicenseInstructions>https://purchase.aspose.com/policies/use-license</LicenseInstructions>

We hope this will be helpful. Please feel free to contact us if you need any further assistance.

Did this solve the issue. I’m having the same problem. you could wrap the url in CDATA

Actually, just tested this and it worked.

@tristianfernandez

Thank you for your kind feedback.

We are glad to know that your problem has been resolved. Feel free to contact us if you need any further assistance.

Hello. We have a licensed copy of asposetotal for java as well and are faced with the same issue mentioned above. We did change the tag as mentioned above and that helped. I wanted to confirm that changing this is the correct approach?

Thanks,
Shiv

@shivs1976

Modifying the contents like SubscribtionExpiryDate and other fields make the license invalid. However, if wrapping the URL does not produce any exception then it is fine as long as license is set without any problem.