Skip to content

Commit

Permalink
[JBWS-4418]:Allow MapToBeanConverter to load and create instance from…
Browse files Browse the repository at this point in the history
… deployment
  • Loading branch information
jimma committed May 10, 2024
1 parent 8a76e29 commit fe36cdc
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package org.jboss.wsf.stack.cxf.client.configuration;

import java.security.PrivilegedActionException;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
Expand Down Expand Up @@ -95,7 +96,12 @@ protected Object build(String key) throws Exception {
protected Object newInstance(String className) throws Exception {
ClassLoader loader = SecurityActions.createDelegateClassLoader(ClassLoaderProvider.getDefaultProvider()
.getServerIntegrationClassLoader(), SecurityActions.getContextClassLoader());
Class<?> clazz = SecurityActions.loadClass(loader, className);
Class<?> clazz = null;
try {
clazz = SecurityActions.loadClass(loader, className);
} catch (ClassNotFoundException e) {
clazz = SecurityActions.loadClass(Thread.currentThread().getContextClassLoader(), className);
}
return clazz.newInstance();
}

Expand Down

0 comments on commit fe36cdc

Please sign in to comment.