Simple Way To Find SAP PI/PO Java Class JAR files location
In SAP PI typical development projects, sometimes finding a SAP PI/PO java class jar file is a tedious job due to various reasons e.g., the jar file name might be changed in new PI version, jar file location change in pi server etc.. There are couple of good blogs on this topic on SCN (check references)
Well, this blog is just an extension to the wonderful blog concept: Finding com.sap.guid.IGUID (or any other class) on the PI Server by Markus Windhager
All that you have to do is, use below UDF code in a draft mapping program and then execute from test tab with required package class name as input. With this UDF procedure we can find any PI jar file location without much effort 😉
FindJarFileUDF code
** add import statement: java.net.URL
String str = "";
try
{
//Class c = Class.forName("com.sap.guid.IGUID");
Class c = Class.forName(var1);
URL loc = c.getProtectionDomain().getCodeSource().getLocation();
str = loc.toString();
//audit.addAuditLogEntry(key, AuditLogStatus.SUCCESS, c + " found at " + loc);
}catch (Exception e){
str = e.toString();
}
return str;
Check results yourself and input your feedback 🙂
References
Finding com.sap.guid.IGUID (or any other class) on the PI Server by Markus Windhager
How to Find Java Library During PI Development by William Li
How to Find Java Library Resource File Possessing Information for Class Name by Vadim Klimov
Works fine on 7.5, many thanks!