Kernel kernel = KernelRegistry.getKernel(kernelName);
Map<String, String> nameMap = new HashMap<String, String>();
nameMap.put("name", dataSourceName);
nameMap.put("J2EEApplication", dataSourceAppName);
nameMap.put("j2eeType", "JCAConnectionManager");
Set<AbstractName> set = kernel.listGBeans(new AbstractNameQuery(null, nameMap));
for (AbstractName name : set) {
try {
dataSource = (DataSource) kernel.invoke(name, "createConnectionFactory");
break;
} catch (GBeanNotFoundException e) {