protected final BaseWrapperManagedConnectionFactory createManagedConnectionFactory(final String jndiName,
final Driver driver) throws ResourceException, StartException {
final XAManagedConnectionFactory xaManagedConnectionFactory = new XAManagedConnectionFactory();
try {
xaManagedConnectionFactory.setClassLoaderPlugin(new ClassLoaderPlugin() {
@Override
public ClassLoader getClassLoader() {
return driver.getClass().getClassLoader();
}