We are currently using Google Cloud, but we have the following problems:
First problem:
The Aspose-PDF-Java library was added to a GAE Standard (F4), however this type of GAE Standard machines only accept files smaller than 32MB and its solution is very heavy, so we wanted to see if there is another solution that fragments the jar library of aspose.pdf.
Second problem:
See moved the solution to GAE Flex, which allows larger files, however the license validation time is very long.
Actions done:
- Migrated from a GAE Standard to a GAE Flex
- The license load was placed in a ServletContextListener
- An SSCCE project was created to isolate the problem
Main problems detected:
- GAE Standard: does not accept the jar library, since it is very heavy above 32MB
- GAE Flex: the verification of the license is very slow, which prevents testing when the Docker is automatically 20 Pots.
Results:
Local machine:
0 mins, 0 secs.
License set successfully!
GAE Flex (Google cloud):
41 mins, 26 secs.
License set successfully!
Configuration:
Versión Aspose: 19.7
app.yaml
runtime: java
env: flex
service:
licence-aspose-testtime
handlers:
- url: /.*
script: this field is required, but ignored
Code using:
public void loadApose() {
log.info(“Loading license…”);
try {
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy/MM/dd HH:mm:ss:SSS");
String dateStart = "";
String dateStop = "";
java.util.Date d1 = null;
java.util.Date d2 = null;
dateStart = sdf.format(new java.util.Date());
URL urlPdf = getClass().getClassLoader().getResource("Aspose.Pdf.lic");
com.aspose.pdf.License licensePdf = new com.aspose.pdf.License();
licensePdf.setLicense(urlPdf.getFile());
dateStop = sdf.format(new java.util.Date());
d1 = sdf.parse(dateStart);
d2 = sdf.parse(dateStop);
long diff = d2.getTime() - d1.getTime();
long diffSeconds = diff / 1000 % 60;
long diffMinutes = diff / (60 * 1000) % 60;
System.out.println(diffMinutes + " mins, "+ diffSeconds + " secs.");
if (com.aspose.pdf.Document.isLicensed())
{
System.out.println("License set successfully!");
}
} catch (Exception e) {
log.error("Don´t exist license to Pdf.lic {}", e.getMessage());
}
log.info("Finish loading license...");
}
Is there any way to solve this problem?