| Summary: | SDO: User-set ApplicationResolver is not being utilized if the WLS ExecuteThread is null | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | David McCann <david.mccann> | ||||||
| Component: | Eclipselink | Assignee: | Nobody - feel free to take it <nobody> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | major | ||||||||
| Priority: | P2 | ||||||||
| Version: | unspecified | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
David McCann
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 |