I am converting files from docx to pdf. I have done it both via files and streams, but I find I cannot access the file after conversion until I close the application.
Rather like in this other post, it seems that the conversion process doesn’t release the file handle.
That post says it is fixed in 19.11 but 19.11 doesn’t seem to be available, at least on my trial licence, for Java.
We’re sorry for the inconvenience. But this issue is still under investigation. You’ll be notified about the outcomes soon. Your patience will be appreciated in this regard.
After changing nearly every import line I get this:
2020-03-10 13:55:38,360 ERROR conversion.ConversionServiceImpl - Exception: Absolute URI is too short
class com.groupdocs.conversion.internal.c.a.ms.System.UriFormatException: Absolute URI is too short
com.groupdocs.conversion.internal.c.a.ms.System.Uri.parse(Unknown Source)
com.groupdocs.conversion.internal.c.a.ms.System.Uri.parseUri(Unknown Source)
com.groupdocs.conversion.internal.c.a.ms.System.Uri.<init>(Unknown Source)
com.groupdocs.conversion.internal.c.a.ms.System.Uri.<init>(Unknown Source)
com.groupdocs.conversion.licensing.License.b(Unknown Source)
com.groupdocs.conversion.licensing.License.a(Unknown Source)
com.groupdocs.conversion.licensing.License.setLicense(Unknown Source)
GroupDocs.Conversion for Java 20.2 is more simple yet easy to implement. We have moved most of the old classes/methods to the legacy namespace. You can get a clear picture of the public API changes in 20.2 release notes.
Why to migrate to 20.2?
Please have a look at these migration notes.
I’m afraid to report that that doesn’t work for me. Please see stacktrace below:
2020-03-16 09:07:06,281 ERROR conversion.ConversionServiceImpl - Exception: Absolute URI is too short
class com.groupdocs.conversion.internal.c.a.ms.System.UriFormatException: Absolute URI is too short
com.groupdocs.conversion.internal.c.a.ms.System.Uri.parse(Unknown Source)
com.groupdocs.conversion.internal.c.a.ms.System.Uri.parseUri(Unknown Source)
com.groupdocs.conversion.internal.c.a.ms.System.Uri.<init>(Unknown Source)
com.groupdocs.conversion.internal.c.a.ms.System.Uri.<init>(Unknown Source)
com.groupdocs.conversion.licensing.License.b(Unknown Source)
com.groupdocs.conversion.licensing.License.a(Unknown Source)
com.groupdocs.conversion.licensing.License.setLicense(Unknown Source)
Please share a simple console application using that we can reproduce this issue at our end (exclude license file from the application, you already shared license).
import com.groupdocs.conversion.licensing.License;
public class Main {
public static final String licencePath = "./GroupDocs.Conversion.lic";
public static void main(String[] args) {
System.out.println("Hello, world\n");
applyLicenceFromFile();
}
public static void applyLicenceFromFile() {
//ExStart:applyLicenseFromFile
try {
System.out.println("licencePath is " + licencePath);
// Setup license
License lic = new License();
lic.setLicense(licencePath);
} catch (Exception e) {
System.out.println("Exception: " + e.getMessage());
e.printStackTrace();
}
//ExEnd:applyLicenseFromFile
}
}
execution:
$ javac -cp groupdocs-conversion-20.2.jar Main.java
$ java -cp 'groupdocs-conversion-20.2.jar;.' Main
Hello, world
licencePath is ./GroupDocs.Conversion.lic
Exception: Absolute URI is too short
class com.groupdocs.conversion.internal.c.a.ms.System.UriFormatException: Absolute URI is too short
com.groupdocs.conversion.internal.c.a.ms.System.Uri.parse(Unknown Source)
com.groupdocs.conversion.internal.c.a.ms.System.Uri.parseUri(Unknown Source)
com.groupdocs.conversion.internal.c.a.ms.System.Uri.<init>(Unknown Source)
com.groupdocs.conversion.internal.c.a.ms.System.Uri.<init>(Unknown Source)
com.groupdocs.conversion.licensing.License.b(Unknown Source)
com.groupdocs.conversion.licensing.License.a(Unknown Source)
com.groupdocs.conversion.licensing.License.setLicense(Unknown Source)
Main.applyLicenceFromFile(Main.java:21)
Main.main(Main.java:9)
at com.groupdocs.conversion.internal.c.a.ms.System.Uri.parse(Unknown Source)
at com.groupdocs.conversion.internal.c.a.ms.System.Uri.parseUri(Unknown Source)
at com.groupdocs.conversion.internal.c.a.ms.System.Uri.<init>(Unknown Source)
at com.groupdocs.conversion.internal.c.a.ms.System.Uri.<init>(Unknown Source)
at com.groupdocs.conversion.licensing.License.b(Unknown Source)
at com.groupdocs.conversion.licensing.License.a(Unknown Source)
at com.groupdocs.conversion.licensing.License.setLicense(Unknown Source)
at Main.applyLicenceFromFile(Main.java:21)
at Main.main(Main.java:9)
Thanks for the details.
This issue is reproduced at our end. Hence, we’ve logged it in our internal issue tracking system with ID CONVERSIONJAVA-933. As there’s any further update, you’ll be notified. Meanwhile, you can pass license file as an absolute path.
The issues you have found earlier (filed as CONVERSIONJAVA-933) have been fixed in this update. This message was posted using Bugs notification tool by atirtahir3