} else {
dataSourceAppName = dataSourceAppName.trim();
}
String kernelName = (String) options.get(JaasLoginModuleUse.KERNEL_NAME_LM_OPTION);
Kernel kernel = KernelRegistry.getKernel(kernelName);
Set set = kernel.listGBeans(new AbstractNameQuery(JCAManagedConnectionFactory.class.getName()));
JCAManagedConnectionFactory factory;
for (Iterator it = set.iterator(); it.hasNext();) {
AbstractName name = (AbstractName) it.next();
if(name.getName().get(NameFactory.J2EE_APPLICATION).equals(dataSourceAppName) &&
name.getName().get(NameFactory.J2EE_NAME).equals(dataSourceName)) {