Community
Participate
Working Groups
In the case where the current thread is non-wls managed the ExecuteThread is null. Since our code only uses the ApplicationResolver when ExecuteThread doesn't return the app name, we never use the resolver if the ExecuteThread is null. We need to use the ApplicationResolver if ExecuteThread is null, or the returned application name is null.
The code that looks up the WLS application name should be changed as follows: // Helper contexts in WebLogic server will be keyed on application // name if available if (classLoaderName.contains(WLS_CLASSLOADER_NAME)) { Object appName = null; Object executeThread = getExecuteThread(); if (executeThread != null) { try { Method getMethod = PrivilegedAccessHelper.getPublicMethod(executeThread.getClass(), WLS_APPLICATION_NAME_GET_METHOD_NAME, WLS_PARAMETER_TYPES, false); appName = PrivilegedAccessHelper.invokeMethod(getMethod, executeThread); } catch (Exception e) { throw SDOException.errorInvokingWLSMethodReflectively( WLS_APPLICATION_NAME_GET_METHOD_NAME, WLS_EXECUTE_THREAD, e); } } // if ExecuteThread is null or doesn't return the app name, attempt // to use the user-set ApplicationResolver (if set) if (appName == null && appResolver != null) { appName = appResolver.getApplicationName(); } // use the application name if set, otherwise key on the class loader if (appName != null) { return new MapKeyLookupResult(appName.toString(), classLoader); } // couldn't get the application name, so default to the context loader return new MapKeyLookupResult(classLoader); }
Created attachment 182049 [details] Proposed code changes for the 2.1.2 stream
Created attachment 182050 [details] Proposed code changes for the 2.2 stream
Reviewed by: blaise.doughan@oracle.com; matt.macivor@oracle.com Tests: all unit tests pass as expected 2.1.2 rev 8448 2.2 rev 8449
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink