Free Support Forum - aspose.com

Aspose PDF Java 18.3 on AIX error: Signature decryption error

Hello,

I try to upgrade Aspose.PDF to Java 18.3. On Windows 7 everything works fine, but on AIX we get an error while setting the license. Java 18.2 works on Windows 7 and AIX, there where no changes on our the systems.

The code is as follows:

private void initAsposeLicense() {
   try {
         String licenseName = "Aspose.Total.Java.lic";
         InputStream licenceStream = PDFAConverterBean.class.getClassLoader().getResourceAsStream(licenseName);
         com.aspose.pdf.License license = new com.aspose.pdf.License();
         license.setLicense(licenceStream);
   }
   catch (Exception e) {
         throw new RuntimeException(e);
   }

}

The error that shows up:

java.security.SignatureException: Signature decryption error: javax.crypto.BadPaddingException: Invalid padding!
at iaik.security.rsa.RSASignature.engineVerify(Unknown Source) at java.security.Signature$Delegate.engineVerify(Signature.java:1219)
at java.security.Signature.verify(Signature.java:652)
at com.aspose.pdf.I23l.lif(Unknown Source)
at com.aspose.pdf.I23l.l0l(Unknown Source)
at com.aspose.pdf.I23l.lif(Unknown Source)
at com.aspose.pdf.License.setLicense(Unknown Source)

at de.svlfg.pi.module.dav77.PDFAConverterBean.initAsposeLicense(PDFAConverterBean.java:58)
at de.svlfg.pi.module.dav77.PDFAConverterBean.process(PDFAConverterBean.java:74)
at de.svlfg.pi.module.dav77.BasicAdapterModule.process(BasicAdapterModule.java:54)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:47)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:166)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:50)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:37)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:21)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_MethodRetry.invoke(Interceptors_MethodRetry.java:46)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:191)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:23)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:25)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:17)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:138)
at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:172)
at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:99)
at com.sun.proxy.$Proxy5018.process(Unknown Source) at com.sap.aii.af.app.mp.ejb.ModuleProcessorBean.process(ModuleProcessorBean.java:271)
at sun.reflect.GeneratedMethodAccessor764.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:47)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:166)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:50)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:37)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:21)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_MethodRetry.invoke(Interceptors_MethodRetry.java:46)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:191)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:23)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:25)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:17)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:138)
at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:172)
at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:99)
at com.sun.proxy.$Proxy290.process(Unknown Source) at com.sap.aii.adapter.file.File2XI.send(File2XI.java:4819)
at com.sap.aii.adapter.file.File2XI.processFileList(File2XI.java:1725)
at com.sap.aii.adapter.file.File2XI.invoke(File2XI.java:821)
at com.sap.aii.af.lib.scheduler.JobBroker$Worker.run(JobBroker.java:529)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:185)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:302)

Do you have any suggestion to this?

@RalfZim

Thanks for contacting support.

The exception you are experiencing, does not appear to be related with Aspose.PDF for Java and it may be your environment specific. However, would you please share your complete environment details i.e. IBM Server Version, JDK Version. Please also share a sample console application with minimum code, which is able to replicate the error. We will test the scenario in our environment and address it accordingly.

Thanks for your answer.

We are running an IBM Power 770 and the OS is “AIX 7.1 technology level 03 Service pack 05”.

The application is build in Windows and deployed to the Server. The Server is using SAP JVM Version 8.1.029 as a Runtime.

All tests during local developement(WIN 7) are successful, even with the mentioned SAP JVM.

Sample console application:

package de.svlfg.pi.dav5_1.ejb;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.Map;
import java.util.Properties;

import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException;

import org.xml.sax.SAXException;

import de.lsv.pi.edi.adapters.sdk.message.MessageWrapper;
import de.lsv.pi.edi.adapters.sdk.trace.ModuleTrace;


public class Dav5_1 {
	// Initialise aspose license
	private com.aspose.pdf.License license = new com.aspose.pdf.License();
	private ModuleTrace trace;
	private Map<String, String> cfg;
	
	public Dav5_1(ModuleTrace trace, Map<String, String> cfg){
		this.trace = trace;
		this.cfg = cfg;    		
	}

	public void process(MessageWrapper msg) throws IOException, ParserConfigurationException, SAXException, TransformerException {		
		// License aspose library
		this.doLicense();    		
	}
	
	
	public void doLicense() {
		try {
			InputStream resourceAsStream = Dav5_1.class.getClassLoader().getResourceAsStream("Aspose.Total.Java.lic");
			license.setLicense(resourceAsStream);
			trace.debug("Aspose Software erfolgreich lizensiert.");
			
		} catch (FileNotFoundException e) {
			trace.status("Aspose Lizenz konnte nicht gefunden werden: " + e);			
			trace.catching("Aspose Lizenz konnte nicht gefunden werden.", e);
		} catch (Exception e) {
			trace.status("Beim lizensieren von Aspose ist ein Fehler aufgetreten: " + e);
			trace.catching("Beim lizensieren von Aspose ist ein Fehler aufgetreten.", e);
		}
	}	
}

The application stops @ license.setLicense(resourceAsStream);

@RalfZim

Thanks for sharing these details.

We have tested the scenario in our environment with Aspose.PDF for Java 18.5 and were unable to notice the issue which you have mentioned. Please note that we just have released Aspose.PDF for Java 18.5 version and we request you to please try latest version in your environment.

Please also make sure that everything is fine during deployment of the application on server. In case the issue still occurs, please share your license file with us, in private message. We will further proceed to help you out.

Thanks for your response.

We have tested the application with ASPOSE.PDF for Java 18.5, but the issue is still the same on the AIX Server.

All Versions below ASPOSE.PDF Java 18.3 are working fine in our environment. Is there a change in the setLicense() coding? If there is a change we can probably solve the problem on our server.

Beside that i wil send you the used license file in a private message.

@RalfZim

Thanks for providing us your license file.

We have tested the scenario again with your license file and were unable to notice any issue. The issue seems to be environment specific, as similar issue(s) were also reported over SAP Forums. However, we have logged an investigation ticket in our issue tracking system as PDFJAVA-37784. We will further investigate this issue and keep you informed with the status of investigation. Please be patient and spare us little time.

We are sorry for the inconvenience.

Hello support team,

it’s been a few months since I reported this problem to you. Is there any new status update for this problem? Or can I look into the issue tracking system myself somehow?

It would be great if I could use the newer versions, as there are now 8 versions between my and the latest offical version.

@RalfZim

Thanks for your inquiry.

I regretfully share that your issue is not yet resolved. Please note that the issue was logged under free support model where issues have low priority and get resolved on first come first serve basis unlike the paid support where issues are dealt with high priority. We will definitely let you know as soon as some significant progress is made towards resolution of your issue. Please spare us little time.

We are sorry for the inconvenience.