Attached the recording of debug point.
@nbeck,
We are not able to reproduce the issue by any means and need further assistance. Could you please share some simplified application which can be compiled and executed here to reproduce this issue as without reproducing the issue we are not able to assist you further. We are also getting true when Workbook.isLicensed() function is called and are able to create Excel files without any warning.
We faced this issue yesterday and received below error. This error you receive when you are using temp or expired license.
com.aspose.cells.CellsException caught: com.aspose.cells.CellsException: You are using an evaluation copy and have opened files exceeding limitation.
We restarted the server and this issue is solved. We are able to open excel file. I do not understand why we have received this and how it is solved after server restart.
I need to understand the meaning of these words “have opened files exceeding limitation.”
I am using licensed copy of aspose cells and I can open as many files I can. But based on this error it is restricting my limit to open the excel
@nbeck,
I am afraid that I could not understand whether your issue is resolved or not after restarting the server as in your last sentence you have mentioned the following:
If your issue is completely resolved by restarting the server, then it seems to be related to following scenario.
License file not working anymore
Is there any way we can find that how many times I have opened the excel file? If you guys are throwing this exception that means you are calculating this open file count.
How do you we ensure that we have license file paid or evaluation copy ?
Team any update on my comment ?
@nbeck,
Any file is opened or loaded by the API with Workbook constructor.
API internally counts how many times the constructor is called. Moreover, license validation is internal complex routine which validates or invalidates a license.
It may be related to some file cache or operating system access issue, that has now resolved after a restart. Because behavior of Aspose.Cells stays constant after restart. If you face this issue next time then let us know your feedback.
@nbeck,
We have investigated a bit more. Could you please log FileInputStream.available() value in your code.For example,
License license = new License();
licenseFileStream = new FileInputStream(asposeLicenseFile);
int length = licenseFileStream.available();
//log the varible 'length' here.
license.setLicense(licenseFileStream);
Then run (Do not debug) it on your production environment, then check the log to see if the length is OK. If the logged length is not OK, try to use ‘servletContext.getResourceAsStream’ to get the stream.
See java - How to load a resource from WEB-INF directory of a web archive - Stack Overflow
Let us know your feedback.
Thanks for this. Will try and update you.
But the Logic I have sent written in 2010. After that we did not make any change just replacing the updated license file and their supported jars.
@nbeck,
Just for your reference, this is also helpful:
It suggests to use ‘servletContext.getResourceAsStream’
The process you have sent to us is all are same. There are multiple ways to read the file from the web inf folder. The recording I have sent to you is showing that we can read the license file correctly.
Is it possible for you to share a simplified application as requested earlier? Also write down separately the list of issue which are resolved after restarting the server and list of issues which are not resolved yet for our clear understanding.
@nbeck,
Also for our reference, please try the servletContext.getResourceAsStream and share the feedback. This information will help us to analyze the issue here.
Can you answer my question ?
We are using docker containerization mechanism to deploy our application. This docker container is created on Windows EC2 Physical machine. Docker is our virtual image of windows and AWS EC2 is our physical box. This license file present inside Docker virtual box because it is part of the code.
This could be the issue that your license validation is failing. ?
We faced this same issue again and we restarted our docker virtual instance.
It keeps frustrating that after purchase of valid license file we are facing this kind of issue.
If the license file is invalid and it has subscription issue than why it is not throwing any sign during server start when we are loading.
Loading any file either this way (servletContext.getResourceAsStream ) or my way both are same. At the end we are passing input stream object in set license method. It is does not matter how you load.
There should be no issue. Because you are using the API ‘License.setLicense(InputStream stream)’ to set license, if the provided stream is valid, there should be no issue.
Moreover, please read the license file into byte array, validate the bytes (important step, e.g. log the byte length, or log the bytes data), then provide ‘ByteArrayInputStream(byte buf[])’ to our API ‘License.setLicense(InputStream stream)’,
Then run (Do not debug, there may be different behavior between Run and Debug) it on your production environment. Finally, check the byte length and byte data in the log.
Let us know your feedback.
As per your suggestion I have made the changes. Code and logs snapshot are attached with this issue.
I am deploying these changes on my docker virtual box.
@nbeck,
Thank you for the feedback. We are analyzing this information and will share our feedback after analysis.
Hi All, Any update on it.?