cancel
Showing results for 
Search instead for 
Did you mean: 

Web Dynpro LinkageError when calling connection.retrieveNative()

Former Member
0 Kudos

Hi,

This problem is confusing me. I have a Web Dynpro for Java project that is making a connection to MDM. The code is very simple but I cannot get round this exception

LinkageError: Class com/sapportals/connector/connection/IConnection violates loader constraints

Which is occuring when the connection.retrieveNative() method is being called.

If anyone has any idea what this could be, please let me know. I will be very grateful. The code I am using is below.

IConnectorGatewayService cgService = (IConnectorGatewayService)WDPortalUtils.getServiceReference(IConnectorGatewayService.KEY);

IUser user = UMFactory.getUserFactory().getUserByLogonID(loginId);

ConnectionProperties prop = new ConnectionProperties(user.getLocale(), user);

connection = cgService.getConnection(alias, prop);

INative nativeInterface = connection.retrieveNative();

Many Thanks

Gary

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Gary,

Seems that you have problem with class loaders. The class mentioned in error message is already loaded by one class loader, and you try to load it second time. As far as class reuires native code, it loads DLL every time it is loaded. However, it's only possible to load DLL into same process (JVM in this case) only once.

You have to re-visit references you have and make related library to be loaded only once.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks. I played around with the references and now it works ok. points rewarded.

Former Member
0 Kudos

Hi, Gary!

I've got the same problem with LinkageError. Could you describe your solution?