It sounds like you’re experiencing issues with the Aspose license not being recognized in your Docker environment, even though it works fine on your local Windows machine. Here are some steps you can take to troubleshoot and resolve this issue:
Ensure License File Accessibility: Make sure that the license file is included in your Docker image and is accessible at runtime. You can verify this by checking the file path in your Docker container.
Check Licensing Code Execution: The licensing code must be executed during the application startup. If you’re using a framework like ASP.NET, ensure that the licensing code is placed in the appropriate event handlers (e.g., Application_Start or Session_Start). If these events are not triggered in your Docker environment, the license may not be applied.
Environment Differences: Sometimes, differences in the environment (like file permissions or paths) between your local machine and the Docker container can cause issues. Ensure that the Docker container has the necessary permissions to read the license file.
Debugging: Add logging to your application to confirm that the licensing code is being executed and to check the path from which the license file is being loaded. This can help identify if the file is being found correctly.
Rebuild the Docker Image: If you have made changes to the Dockerfile or the way the license file is included, make sure to rebuild the Docker image and run a fresh container.
If you continue to face issues, consider checking the Aspose documentation or forums for similar cases, as they may provide additional insights or solutions.
I tried the steps mentioned above, but to no avail.
my dockerfile is like this:
FROM docker.io/library/eclipse-temurin:17-jdk-alpine
RUN apk update
RUN apk upgrade
RUN apk add font-terminus font-inconsolata font-dejavu font-noto font-noto-cjk font-awesome font-noto-extra
RUN apk add fontconfig
RUN apk add harfbuzz
14:14:52.638 [main] INFO PdfApplication – Loading the Pdf license.
14:14:52.982 [main] INFO PdfApplication – Attempting via ClassPathRessource the base url
14:14:52.993 [main] INFO PdfApplication – Pdf license loaded successfully.
14:14:55.391 [main] INFO PdfApplication – License is accepted!
but on the docker image
14:14:55.391 [main] WARN PdfApplication – License is loaded but not accepted!
is there anything I am missing? Tried with the version 24.8 of the aspose.pdf library.
We need to investigate this issue in more details. Can you please share some more information that could help us in replicating this behavior in our environment? Have you tried with some other version of the API?
sure. I am running this on a Windows Docker v 4.34.2 version. The docker file was in my previous post. I tried with aspose 24.6 and 24.8, both showed the same behaviour.
Maybe i am missing some vital files that need to be present for aspose.pdf to work properly under linux in the alpine image?
Do you by chance have a docker image that doesn’t show that behaviour? I’d gladly try a different container.
EDIT: I tried with version 23.7 as well, same effect. Are there any restrictions to certain licenses so they can’t run inside docker?
We have logged an investigation ticket as PDFJAVA-44345 in our issue tracking system to further analyze this scenario. We will look into its details and keep you posted with the status of its correction. Please be patient and spare us some time. We are sorry for the inconvenience.
Do you by chance have any test/example project that uses aspose.pdf in a docker container? We are curious whether this is a generic issue or just something we have with our specific docker image.
We are afraid that we do not have any sample project that we can share publicly related to Aspose.PDF for Java usage inside docker. However, we will consider it and try to create some examples for you. The ticket has been updated accordingly and we will inform you once it is resolved. Please spare us some time.
Are there any news on this? If you have any hints or pointers, that’ll help as well. We can’t really analyze this due to the obfuscation of the code though.
We are afraid that the investigation has not been completed yet. However, your concerns have been recorded and we will surely inform you as soon as we make some findings in this regard. Please spare us some time.