mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-3747 - Syntax errors are not showing up in the log when the broker is started in the background. fix by logging a fatalbeanexception on context creation before rethrow
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1295138 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0d8ce9f87c
commit
503e1dc15e
|
@ -32,6 +32,7 @@ import org.slf4j.LoggerFactory;
|
|||
import org.apache.xbean.spring.context.ResourceXmlApplicationContext;
|
||||
import org.apache.xbean.spring.context.impl.URIEditor;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.FatalBeanException;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
|
@ -103,11 +104,16 @@ public class XBeanBrokerFactory implements BrokerFactoryHandler {
|
|||
protected ApplicationContext createApplicationContext(String uri) throws MalformedURLException {
|
||||
Resource resource = Utils.resourceFromString(uri);
|
||||
LOG.debug("Using " + resource + " from " + uri);
|
||||
return new ResourceXmlApplicationContext(resource) {
|
||||
@Override
|
||||
protected void initBeanDefinitionReader(XmlBeanDefinitionReader reader) {
|
||||
reader.setValidating(isValidate());
|
||||
}
|
||||
};
|
||||
try {
|
||||
return new ResourceXmlApplicationContext(resource) {
|
||||
@Override
|
||||
protected void initBeanDefinitionReader(XmlBeanDefinitionReader reader) {
|
||||
reader.setValidating(isValidate());
|
||||
}
|
||||
};
|
||||
} catch (FatalBeanException errorToLog) {
|
||||
LOG.error("Failed to load: " + resource + ", reason: " + errorToLog.getLocalizedMessage(), errorToLog);
|
||||
throw errorToLog;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue