We can produce the same exception on Alpine docker with openjdk17 installed:
# Start with the bare Alpine base image
FROM alpine:latest
# Set environment variables for Java
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk \
PATH=$JAVA_HOME/bin:$PATH
# Install only the minimal OpenJDK 17 package
RUN apk add --no-cache openjdk17-jdk \
&& java -version
We tried to handle some exceptions, but it breaks lots of places which are related to Font while rendering text.
After installing packages fontconfig and ttf-dejavu, it works OK. We tried some solutions, but only this one works.
You are welcome. Please do what is necessary as suggested, and it will resolve your issue. Feel free to write back if you have any further queries or comments.
hi @amjad.sahi
am getting additional errors like below when trying to zip files with names like DE language characters like
“Berichtsübersicht”
com.aspose.cells.CellsException: Error for ZipFile
at com.aspose.cells.zbcu.a(Unknown Source)
at com.aspose.cells.a.f.zj.(Unknown Source)
at com.aspose.cells.a.f.zj.a(Unknown Source)
at com.aspose.cells.FileFormatUtil.a(Unknown Source)
at com.aspose.cells.FileFormatUtil.a(Unknown Source)
at com.aspose.cells.FileFormatUtil.detectFileFormat(Unknown Source)
at com.aspose.cells.CellsHelper.mergeFiles(Unknown Source)
at
Caused by: java.io.IOException: java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: /tmp/report/11EF-CD8B-9EF52A11-BD83-96E44B451C3C-1736318540/Berichtsübersicht-B63F5E9C-0FD9-42DA-91FF-3933813CDA02.xlsx
at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1397)
at java.base/java.util.zip.ZipFile$CleanableResource.(ZipFile.java:716)
at java.base/java.util.zip.ZipFile.(ZipFile.java:250)
at java.base/java.util.zip.ZipFile.(ZipFile.java:179)
at java.base/java.util.zip.ZipFile.(ZipFile.java:150)
at com.aspose.cells.a.f.zf.(Unknown Source)
at com.aspose.cells.a.f.ze.a(Unknown Source)
… 21 more
Caused by: java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: /tmp/report/11EF-CD8B-9EF52A11-BD83-96E44B451C3C-1736318540/Berichtsübersicht-B63F5E9C-0FD9-42DA-91FF-3933813CDA02.xlsx
at java.base/sun.nio.fs.UnixPath.encode(UnixPath.java:121)
at java.base/sun.nio.fs.UnixPath.(UnixPath.java:68)
at java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:279)
at java.base/java.io.File.toPath(File.java:2387)
at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1394)
… 27 more
am not sure which package is required for the above. I tried few packages like language-pack-de, locales but still same errror.
hi @John.He Ours is proprietary code cannot be shared. you can try to generate file with any german characters like “Berichtsübersicht” as filename and then zipping. this will fail with java17
Would you please try it at your end? Maybe you have other operations which may cause the mergeFiles() fail. If so, we are afraid we need your runnable code to reproduce the issue so we can figure the issue out.
We apologize, but we do not evaluate issues with older versions of the APIs, nor can we resolve any issues in those versions. The fixes are based on latest APIs set only. As suggested earlier, please upgrade to our latest version, Aspose.Cells for Java v24.12, as it functions properly on our side we tested.
HI @amjad.sahi we need to upgrade our license to incorporate new versions which is currently not planned by our organization. so we will have to use existing version only.
We are sorry, but as we told you, it is difficult for us to evaluate issues in older versions and to fix them (if it is a bug or other limitations in the older versions).
This was an internal issue but for other scenario (the case is not same with yours) reported by another developer working on other Aspose modules.
The exception (“com.aspose.cells.CellsException: Error for ZipFile”) was encountered but using the code segment:
We also tested 20.9.8 you attached and cannot find the exception. It can work fine and give the combined result. So we think the issue may be caused by some special settings of your environment. If so, it will be very difficult for us to trace such kind of issue.
Maybe at first you may test at your end whether your template file can be loaded correctly by Java’s Zip apis(without reference to our component). We think it is possible that your template file cannot be processed successfully with Java’s zip apis.
And anyways, you also can test our latest version in evaluation mode to check whether your issue can be solved.
Thanks for checking the issue. we also have one more person reported same issue when normal file load as well.
But what am looking for support from this forum is which package installation is required to avoid this issue in java17 environment. Tried few suggestions given in google but none is working. Please note we are manually installing fontconfig package so could it be related to some missing fonts.
@rselvarajan
We run the following code to test it on JDK1.8 and get"UTF-8" result. Perhaps you can consider upgrading the JDK version to solve the issue.
String encoding = System.getProperty("native.encoding"); // Populated on Java 18 and later
java.nio.charset.Charset cs = (encoding != null) ? java.nio.charset.Charset.forName(encoding) : java.nio.charset.Charset.defaultCharset();
System.out.println(cs.displayName());
Our organization currently uses only jdk 17 and we cannot have our own version of jdk. Can you please change your charset to US-ASCII and try if you could reproduce the issue.
Also we are getting error during mergeFiles as given below. but how does changing to “new java.util.zip.ZipFile(String name)” can help?
CellsHelper.mergeFiles(files.stream().map(f → f.getAbsolutePath()).toArray(String[]::new),
“cache”, reportDestination);
also which version of jdk you are currently using?
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.