cancel
Showing results for 
Search instead for 
Did you mean: 

java.lang.LinkageError: loader constraints violated when linking classes

0 Kudos

Hi Experts.

I'm developing an UDF java funtion to decrypt one field in my PI mapping.

I need to use one certificate that is in Key Store of the PI machine, so, i'm using "com.sap.aii" libraries to access.

My code is:

SAPSecurityResources secRes = SAPSecurityResources.getInstance();

PermissionMode permiso = PermissionMode.SYSTEM_LEVEL;

KeyStoreManager ksMgr = secRes.getKeyStoreManager(permiso);

First and second line are working fine but the thirth one is returning an error:

RuntimeException in Message-Mapping transformation: Exception:[java.lang.LinkageError: loader constraints violated when linking com/sap/aii/security/lib/PermissionMode class] in class com.sap.xi.tf._CP_res_ method Decrypt$[, com.sap.aii.mappingtool.tf3.rt.Context@5dce1822]

I don't know what's the problem.

Can anyone help me please????

Thanks in advance

Accepted Solutions (0)

Answers (7)

Answers (7)

0 Kudos

Bad news!!!

I think that PGP cannot use certificates to decryp info, so I cannot use PGP solution either (see the next weblog if you want to know how to use PGP /people/sekhar.dachepalli/blog/2010/12/16/pgp-encryption-and-decryption-process-in-pi)

So, any ideas???

Former Member
0 Kudos

Hi,

Try to use IBMJCEProvider.jar . This might help

--Naresh

Former Member
0 Kudos

Hi, what was your final solution?

0 Kudos

Hi again,

After my troubles with PI Java libraries in order to decrypt one part of the payload in a UDF java mapping, I thought to do this in R/3 part. I worked in an ABAP class using SSF_KRN_DEVELOPE funtions to decrypt. It was a very good idea because SSF01 was working fine with the correct certificate that I need to use to decrypt that payload.

But........ the part of the payload I need to decrpyt, was ciphered with AES-128!!!!!!! Check the next link:

Summing up, SSF functions don't support AES-128 algorithms, so, I cannot use my abap class to decrypt the payload.

I'm back at the beginnin. I lost one moth and a half and I haven't the solution!!

Now, I'm reading about PGP solution, but I don't know if I could use my certificate to do that or PGP only can use the pair keys that PGP needs to generate.

Can anyone help me???

Any ideas apart of PGP solution??

Thanks in advance.

Edited by: Desarrolladores Externas on Jul 18, 2011 10:58 AM

0 Kudos

Hi again

Baskar, thanks for your reply, but i tested the hole scenario and the answer was the same in the PI monitor:

<Trace level="1" type="T">com.sap.aii.utilxi.misc.api.BaseRuntimeException: RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /ns0:Respuesta/ns0:Atributos/ns0:IdPeticion. The message is: Exception:[java.lang.LinkageError: loader constraints violated when linking com/sap/aii/security/lib/PermissionMode class]

Thanks a lot

0 Kudos

Thanks for your anwser.

In order to test the imported .jar files, I modified the code as follow:

AbstractTrace trace = container.getTrace();

try{

SAPSecurityResources secRes = SAPSecurityResources.getInstance();

PermissionMode permiso = PermissionMode.SYSTEM_LEVEL;

String traza = permiso.toString();

trace.addInfo(traza);

KeyStoreManager ksMgr = secRes.getKeyStoreManager(permiso);

}

catch (Exception e){

e.printStackTrace();

}

return a;

After the execution, "traza" contain the string "SYSTEM_LEVEL" so I think both libraries: com.sap.aii.af.service.resource.;com.sap.aii.security.lib.;

are working fine in my PI.

But the problem is still in last code line, when "service" 's library is calling "security" 's library. Is it possible? I mean, the libraries work well separately but not together?

Thanks in advance!!

agasthuri_doss
Active Contributor
0 Kudos

Hi,

>KeyStoreManager ksMgr = secRes.getKeyStoreManager(permiso);

Is the method 'permiso'. Can you check any typo error ?

Cheers

Agasthuri

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Just Few cents...

The code you can check only during runtime within PI. You cannot test it outside PI. Because you are trying to do keystore lookup in netweaver stack. PermissionMode class is not the appropriate version you are using . This class might be outdated or not matching one for the execution. Check all your import statements and see whether you have duplicate versions for that class available in the jar file. Also try to use jdk 1.4 version.

Hope that helps.

0 Kudos

Hi again,

I'm working in PI 7.0 SP24 and Java 1.6.0_13 and I obtained the libraries from SAPXIAFC24_0-10003481.SCA witch is instaled in my PI machine.

Thanks in advance.

anupam_ghosh2
Active Contributor
0 Kudos

Hi,

This error comes when java version installed in PI is not supporting the classes in your library.

I think you need to reinstall correct jdk /jre for your system. Are you able to test the code in your system before you load it into PI? I think for PI 7.0 you need java2sdkse v 1.4.2_15, java2 runtime enviornment V 1.4.2_15 .

regards

Anupam