You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to implement a JMS client using Weblogic implementation, but its not working correctly.
The inicial context factory class of Weblogic JMS implementation is weblogic.jndi.WLInitialContextFactory.
I was looking at the code and I found the reason it was not working. The class mentioned above is found by JCL, but for some reason, JCL is creating the instance in a different way of the class loader used by JMS, the context class loader.
// JMS is instantiating the initial context factory this way:
loadClass(className, getContextClassLoader())
// The code above call...
Class.forName(className, true, classLoader)
// Getting class loader:
ClassLoader getContextClassLoader() {
return AccessController.doPrivileged(
new PrivilegedAction<ClassLoader>() {
public ClassLoader run() {
ClassLoader loader = Thread.currentThread().getContextClassLoader();
if (loader == null) {
// Don't use bootstrap class loader directly!
loader = ClassLoader.getSystemClassLoader();
}
return loader;
}
}
);
}
Loading the initial context factory class using Thread.currentThread().getContextClassLoader() works fine. Using JCL class loader, the class is instantiated, but for some reason I could not connect to JMS server.
The text was updated successfully, but these errors were encountered:
I'm trying to implement a JMS client using Weblogic implementation, but its not working correctly.
The inicial context factory class of Weblogic JMS implementation is
weblogic.jndi.WLInitialContextFactory
.I was looking at the code and I found the reason it was not working. The class mentioned above is found by JCL, but for some reason, JCL is creating the instance in a different way of the class loader used by JMS, the context class loader.
Loading the initial context factory class using
Thread.currentThread().getContextClassLoader()
works fine. Using JCL class loader, the class is instantiated, but for some reason I could not connect to JMS server.The text was updated successfully, but these errors were encountered: