java.lang.IllegalStateException: The license is not valid for this product. For free technical support, please post this error and the file in the Aspose.Pdf Forums Aspose.PDF Product Family - Free Support Forum - aspose.com
at com.aspose.pdf.z50.m1(Unknown Source)
at com.aspose.pdf.License.setLicense(Unknown Source)
at ConvertPDFToPDFAFormat.main(ConvertPDFToPDFAFormat.java:17)
We would like to share with you that please try to use latest available version of the API i.e. Aspose.PDF for Java 20.10. The older versions have a lot of discontinued Classes and Methods and we are not providing support against the issues in older versions if they do not exist in the latest one.
As per our suggestion and request, please try using 20.10 version of the API with a temporary license and let us know in case you still face any issues.
With JAR20.10 we are getting below error message while compiling
bad class file: /u01/oracle/devc/comn/java/com/aspose/pdf/ConvertErrorAction.cla ss
class file has wrong version 52.0, should be 50.0
Please remove or make sure it appears in the correct subdirectory of the classpa th.
import com.aspose.pdf.ConvertErrorAction;
We can’t upgrade our JAVA from 1.6 to 1.8 as we are running oracle on JAVA1.6 if we have to upgrade this affects entiry business community which we don’t want.
But your ASPOSE PDF for 12 or 10 Jar’s are compiling fine and like to test them they work in our environment.
So, pl provide license and suggest which version is best that works for JRE 1.6 with PDF to PDFA3/B conversation feature
We have responded to you similar inquiry in other thread as well.
We would like to share with you that you can use Aspose.PDF with JDK 1.6 as well. Please try to download the file aspose-pdf-20.10-jdk16.jar and include it in your project targeting JDK 1.6. Please let us know in case you still face any issue.
Exception in thread “main” java.lang.UnsupportedClassVersionError: com/aspose/pd f/internal/l29h/le : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14 1)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:304)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:218)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:211)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at com.aspose.pdf.FontRepository.lI(Unknown Source)
at com.aspose.pdf.FontRepository.lI(Unknown Source)
at com.aspose.pdf.FontRepository.getLocalFontPaths(Unknown Source)
at com.aspose.pdf.internal.l4y.l0v.l0l(Unknown Source)
at com.aspose.pdf.internal.l4y.l0v.lc(Unknown Source)
at com.aspose.pdf.internal.l4y.l0v.lv(Unknown Source)
at com.aspose.pdf.internal.l4y.l0v.lI(Unknown Source)
at com.aspose.pdf.internal.l4y.l0v$2.lI(Unknown Source)
at com.aspose.pdf.internal.l4y.l0v$2.lI(Unknown Source)
at com.aspose.pdf.internal.l13v.lI.lb(Unknown Source)
at com.aspose.pdf.internal.l4y.l0v.lj(Unknown Source)
at com.aspose.pdf.ADocument.lj(Unknown Source)
at com.aspose.pdf.ADocument.preSave(Unknown Source)
at com.aspose.pdf.ADocument.lf(Unknown Source)
at com.aspose.pdf.ADocument.saveInternal(Unknown Source)
at com.aspose.pdf.Document.saveInternal(Unknown Source)
at com.aspose.pdf.ADocument.l1u(Unknown Source)
at com.aspose.pdf.ADocument.isLicensed(Unknown Source)
at ConvertPDFToPDFAFormat.main(ConvertPDFToPDFAFormat.java:19)
Would you please share your environment details where you are trying to run the code snippet e.g. OS Name and Version. Also, please share a sample PDF document with us which is not being converted at your side. We will test the scenario in our environment and address it accordingly.
We are running on Linux with JAVA
java version “1.6.0_151”
Java™ SE Runtime Environment (build 1.6.0_151-b31)
Java HotSpot™ Client VM (build 20.151-b31, mixed mode, sharing)
Pl find attached PDF and Java program we are using…
We tested above code snippet in an Eclipse Project (JDK 1.6) and Linux (Ubuntu 15.04 x64). We did not notice any issue. For your kind reference, attached is a sample project. You can put JDK6 compatible Aspose.PDF JAR file in sample16 folder and set the path directory in code to test it. Please let us know if you still face any issue. Also, please make sure that microsoft essential fonts are installed in your system.
I don’t fine JDK1.6 jar file in sample.zip file
Could you check please
FYI,… with the java file you have given I am still having below error message
Exception in thread “main” java.lang.UnsupportedClassVersionError: com/aspose/pdf/internal/l29h/le : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:304)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:218)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:211)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at com.aspose.pdf.FontRepository.lI(Unknown Source)
at com.aspose.pdf.FontRepository.lI(Unknown Source)
at com.aspose.pdf.FontRepository.getLocalFontPaths(Unknown Source)
at com.aspose.pdf.internal.l4y.l0v.l0l(Unknown Source)
at com.aspose.pdf.internal.l4y.l0v.lc(Unknown Source)
at com.aspose.pdf.internal.l4y.l0v.lv(Unknown Source)
at com.aspose.pdf.internal.l4y.l0v.lI(Unknown Source)
at com.aspose.pdf.internal.l4y.l0v$2.lI(Unknown Source)
at com.aspose.pdf.internal.l4y.l0v$2.lI(Unknown Source)
at com.aspose.pdf.internal.l13v.lI.lb(Unknown Source)
at com.aspose.pdf.internal.l4y.l0v.lj(Unknown Source)
at com.aspose.pdf.ADocument.lj(Unknown Source)
at com.aspose.pdf.ADocument.preSave(Unknown Source)
at com.aspose.pdf.ADocument.lf(Unknown Source)
at com.aspose.pdf.ADocument.lf(Unknown Source)
at com.aspose.pdf.ADocument.save(Unknown Source)
at com.aspose.pdf.Document.save(Unknown Source)
at AsposeTest.createPDFA3AndAttachXMLFile(AsposeTest.java:36)
at AsposeTest.Run(AsposeTest.java:20)
at AsposeTest.main(AsposeTest.java:13)
You can download the JDK 1.6 compatible JAR from this link and place it in the folder as suggested in our previous response. Furthermore, the issue seems related to missing JAR file at your side. Would you please make sure to add the external JAR to Java Build Path correctly and try again. In case you still face any issue, please share the complete steps to replicate it at our side so that we can further proceed to assist you.
Now I am able to run AsposeTest and generated attached file with xml attachment.
But I have few questions …it is not converted original file completely I see blank PDF with attached xml that I can’t open. Is this because of Temporary license?? attachement.xml will be xml format of the PDF?? How can I see what is in atttachement.xml.
It is good to know that things have started working at your side.
The blank PDF output is due to the fact that an empty PDF was being generated and converted to PDF/A in sample project shared by us. You can modify the code snippet and initialize Document with any existing PDF to convert like below:
Document doc = new Document("source.pdf");
Furthermore, the attachment.xml file can be any type of file either .xml or any other file format. In generated output PDF, you can double click the attachment and it will be opened in supported program installed in your system.
Would you please share what type of error is being experienced at the moment? We will further share our feedback with you accordingly.
As soon as I gave a file name in Document doc = new Document(“source.pdf”); I am getting below error messages again…
Exception in thread “main” java.lang.UnsupportedClassVersionError: com/aspose/pdf/internal/l29h/le : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:304)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:218)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:211)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at com.aspose.pdf.FontRepository.lI(Unknown Source)
at com.aspose.pdf.FontRepository.lI(Unknown Source)
at com.aspose.pdf.FontRepository.getLocalFontPaths(Unknown Source)
at com.aspose.pdf.internal.l4y.l0v.l0l(Unknown Source)
at com.aspose.pdf.internal.l4y.l0v.lc(Unknown Source)
at com.aspose.pdf.internal.l4y.l0v.lv(Unknown Source)
at com.aspose.pdf.internal.l4y.l0v.lI(Unknown Source)
at com.aspose.pdf.internal.l4y.l0v$2.lI(Unknown Source)
at com.aspose.pdf.internal.l4y.l0v$2.lI(Unknown Source)
at com.aspose.pdf.internal.l13v.lI.lb(Unknown Source)
at com.aspose.pdf.internal.l4y.l0v.lj(Unknown Source)
at com.aspose.pdf.internal.l4y.l1h.lv(Unknown Source)
at com.aspose.pdf.internal.l4y.l1h.l2if(Unknown Source)
at com.aspose.pdf.Font.lI(Unknown Source)
at com.aspose.pdf.Font.(Unknown Source)
at com.aspose.pdf.FontCollection.ld(Unknown Source)
at com.aspose.pdf.FontCollection.lI(Unknown Source)
at com.aspose.pdf.FontCollection.(Unknown Source)
at com.aspose.pdf.Resources.getFonts(Unknown Source)
at com.aspose.pdf.internal.l8k.ly.lI(Unknown Source)
at com.aspose.pdf.internal.l8k.ly.l0n(Unknown Source)
at com.aspose.pdf.internal.l8k.ly.lf(Unknown Source)
at com.aspose.pdf.internal.l8k.l0if.l0l(Unknown Source)
at com.aspose.pdf.internal.l8k.ly.lI(Unknown Source)
at com.aspose.pdf.ADocument.lI(Unknown Source)
at com.aspose.pdf.ADocument.convert(Unknown Source)
at com.aspose.pdf.Document.convert(Unknown Source)
at com.aspose.pdf.ADocument.convert(Unknown Source)
at com.aspose.pdf.Document.convert(Unknown Source)
at AsposeTest.createPDFA3AndAttachXMLFile(AsposeTest.java:34)
at AsposeTest.Run(AsposeTest.java:20)
at AsposeTest.main(AsposeTest.java:13)
Please try to use same sample project which we have shared with you. We have again tested the scenario by using your sample file as a source and did not notice any issue. The sample code snippet was as following:
Document doc = new Document(dataDir + "35064981.pdf");
// add page to PDF file
//doc.getPages().add();
// load XML file
FileSpecification fileSpecification = new FileSpecification(dataDir + "attachment.xml", "Sample xml file");
// Add attachment to document's attachment collection
doc.getEmbeddedFiles().add(fileSpecification);
// perform PDF/A_3a conversion
doc.convert(dataDir + "log.xml", PdfFormat./*PDF_A_3A or */PDF_A_3B , ConvertErrorAction.Delete);
// save final PDF file
doc.save(dataDir + "35064981_PDFA_3A.pdf");
The issue you are facing, does not seem related to the API. It looks like related to your Java/JDK Version. Furthermore, we encourage providing support through our forums and request you post your inquiries here. We will try to assist you at our earliest with respective information.
No luck, still getting same error . I used the same sample project that you have shared. but I am using standalone Java no UI tools to create java file.
I am using aspose-pdf-20.10-jdk16. jar file.
If this is complied in JDK16 why error message is showing
Unsupported major.minor version 52.0
version 52 is not for JDK16 right why this error is coming
Exception in thread “main” java.lang.UnsupportedClassVersionError: com/aspose/pdf/internal/l29h/le : Unsupported major.minor version 52.0