String logicalName = (String)env.get(GlassfishNamingManager.LOGICAL_NAME);
if(logicalName != null){
mgr.setLogicalName(logicalName);
}
mgr.initialize();
cf = mcf.createConnectionFactory(mgr);
if (cf == null) {
String msg = localStrings.getString("cof.no.resource.adapter");
throw new RuntimeException(new ConfigurationException(msg));