Author: gtully
Date: Wed Feb 29 14:45:32 2012
New Revision: 1295138
URL: http://svn.apache.org/viewvc?rev=1295138&view=rev
Log:
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
Modified:
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerFactory.java
Modified:
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerFactory.java
URL:
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerFactory.java?rev=1295138&r1=1295137&r2=1295138&view=diff
==============================================================================
---
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerFactory.java
(original)
+++
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerFactory.java
Wed Feb 29 14:45:32 2012
@@ -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 implemen
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;
+ }
}
}