Monday, August 8, 2011

Solving WCUserProfile Class Loader Error for WebCenter PS3/PS4 ADF Applications

While helping to migrate several WebCenter applications to WebCenter PS3/PS4, several times I saw same issue related to WebCenter User Profile - WebLogic Class Loader was failing to load WCUserProfile class. Symptoms: when opening any WebCenter task flow with embedded User Profile functionality, it throws loader constraint violation: loader (instance of weblogic/utils/classloaders/GenericClassLoader) previously initiated loading for a different type with name "oracle/webcenter/peopleconnections/ profile/WCUserProfile" error:


In both cases, when I looked through weblogic.xml configuration file available in WEB-INF folder, I found that "Prefer loading classes from WEB-INF" setting was set:


This is not default setting for WebCenter applications, developers usually are setting it themselves for class loading optimization purposes. It prefers to load local WEB-INF classes, instead of global WebLogic domain registered classes. While this setting works well with pure J2EE applications, its mixing WebCenter classes and prevents correct class loading. You should be careful, when changing weblogic.xml settings.

Make it default:


With "Prefer loading classes from WEB-INF" = false, WCUserProfile class is loaded correctly, profile information is returned successfully:


If you want to test WCUserProfile class load error with WEB-INF classes = true, download sample application - WebCenterUserProfileApp_v2.zip.

2 comments:

David PĂ©rez said...

If you still need to put load web-inf first to "true" you can add the jar "peopleconnections-profile-model.jar" to your Web projecto to be deployed under WEB-INF/lib.

Doing this, also solves the ClassLoader problem.

Regards, David
_____________________
http://http://oracle-webcenter.blogspot.com/

Andrej Baranovskij said...

I was testing this before, there was still same error reproduced.

Andrejus