ObjectName objectName = new ObjectName(objectNameS);
// Parse main server.xml
// FIXME: this could be done somewhere else
SchemaBinding schema = JBossXBBuilder.build(ServerMetaData.class);
Unmarshaller u = UnmarshallerFactory.newInstance().newUnmarshaller();
u.setSchemaValidation(false);
u.setValidation(false);
u.setEntityResolver(new JBossEntityResolver());
InputStream is = null;
ServerMetaData serverMetaData = null;
try {
File configFile = new File(tomcatDeployer.getConfigFile());
if (configFile.exists())
{
is = new FileInputStream(configFile);
}
else
{
is = getClass().getClassLoader().getResourceAsStream(tomcatDeployer.getConfigFile());
}
if (is == null) {
log.error("Could not read configured server.xml (will try default): " + tomcatDeployer.getConfigFile());
is = getClass().getClassLoader().getResourceAsStream("server.xml");
}
serverMetaData = ServerMetaData.class.cast(u.unmarshal(is, schema));
} finally {
if (is != null) {
try {
is.close();
} catch (IOException e) {