throw new NullPointerException("lookup of '" + name + "' returned null");
} else if (object instanceof DataSource) {
if (DataSourceFactory.knows(object)) {
try {
final DbcpDataSource cf = new DbcpDataSource(object);
final DataSourceMetaData dataSourceMetaData = new DataSourceMetaData(cf.getDriverClassName(), cf.getUrl(), cf.getUsername(), cf.getPassword());
res.setResponseCode(ResponseCodes.JNDI_DATA_SOURCE);
res.setResult(dataSourceMetaData);
} catch (final Exception e) {
res.setResponseCode(ResponseCodes.JNDI_ERROR);
res.setResult(new ThrowableArtifact(e));