cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to load license from string

I'm using the 10.8 version of the Java API for FlexNet Publisher. The documentation states:

The following forms can be used to specify the license path:
- A single file ...
- port@host ...
- A redundant server configuration ...
- A license certificate in a string. Precede the license certificate string with the string
FlexlmConstants.LICENSE_STRING_PREFIX
and end it with the string
FlexlmConstants.LICENSE_STRING_SUFFIX


I've written the following Java code to do this:


protected com.macrovision.flexlm.License loadFlexlmLicenseFromString(String licenseStr) throws LicensingException {
com.macrovision.flexlm.License flexLicense = null;

try {
String licenseSource = FlexlmConstants.LICENSE_STRING_PREFIX
+ licenseStr
+ FlexlmConstants.LICENSE_STRING_SUFFIX;

log.info("loading flexlm license string");
flexLicense = new com.macrovision.flexlm.License(myFeature, licenseSource, myVendorInfo, null);

return flexLicense;
}
catch (Exception e) {
log.info("caught exception loading flexlm license: ", e);
throw new LicensingException(e);
}
}


However, this always returns the following error:
com.macrovision.flexlm.FlexlmListException: Error List Returned (-513,7) ; Error List Returned (-513,4052) ; Can't Find License File (-1,4042)


Does anyone know what is the proper way to load a license file from a String?

And no, using a newer version is not an option.
(1) Reply
(Follow-up [post=458319]here[/post].)