Uploaded image for project: 'JBoss A-MQ'
  1. JBoss A-MQ
  2. ENTMQ-2187

[AMQ 6.3, logging exceptions] non karaf version; not logging nested exceptions.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • JBoss A-MQ 6.3.x
    • JBoss A-MQ 6.3
    • broker
    • None
    • Hide

      I think omitting the log4j config should resolve the issue:

      ~~~
      log4j.throwableRenderer=org.apache.log4j.EnhancedThrowableRenderer
      ~~~

      Show
      I think omitting the log4j config should resolve the issue: ~~~ log4j.throwableRenderer=org.apache.log4j.EnhancedThrowableRenderer ~~~

    Description

      For the non karaf version (in extras) does not seem to log the nested exception ("caused by" section). When I omit the log4j configuration (included by default by AMQ), I can see the
      nested exception logged as expected.
      ~~
      log4j.throwableRenderer=org.apache.log4j.EnhancedThrowableRenderer
      ~~

      To illustrate the issue, I get the following exception from a broker misconfiguration with "EnhancedThrowableRenderer" configured.

      2018-03-12 13:13:15,965 | ERROR | Failed to load: class path resource [activemq.xml], reason: Line 54 in XML document from class path resource [activemq.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 54; columnNumber: 50; cvc-complex-type.2.4.a: Invalid content was found starting with element 'pendingMessageLimitStrategydd'. One of '{"http://activemq.apache.org/schema/core":deadLetterStrategy, "http://activemq.apache.org/schema/core":destination, "http://activemq.apache.org/schema/core":dispatchPolicy, "http://activemq.apache.org/schema/core":messageEvictionStrategy, "http://activemq.apache.org/schema/core":messageGroupMapFactory, "http://activemq.apache.org/schema/core":networkBridgeFilterFactory, "http://activemq.apache.org/schema/core":pendingDurableSubscriberPolicy, "http://activemq.apache.org/schema/core":pendingMessageLimitStrategy, "http://activemq.apache.org/schema/core":pendingQueuePolicy, "http://activemq.apache.org/schema/core":pendingSubscriberPolicy, "http://activemq.apache.org/schema/core":slowConsumerStrategy, "http://activemq.apache.org/schema/core":subscriptionRecoveryPolicy, WC[##other:"http://activemq.apache.org/schema/core"]}' is expected. | org.apache.activemq.xbean.XBeanBrokerFactory | main
      org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 54 in XML document from class path resource [activemq.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 54; columnNumber: 50; cvc-complex-type.2.4.a: Invalid content was found starting with element 'pendingMessageLimitStrategydd'. One of '{"http://activemq.apache.org/schema/core":deadLetterStrategy, "http://activemq.apache.org/schema/core":destination, "http://activemq.apache.org/schema/core":dispatchPolicy, "http://activemq.apache.org/schema/core":messageEvictionStrategy, "http://activemq.apache.org/schema/core":messageGroupMapFactory, "http://activemq.apache.org/schema/core":networkBridgeFilterFactory, "http://activemq.apache.org/schema/core":pendingDurableSubscriberPolicy, "http://activemq.apache.org/schema/core":pendingMessageLimitStrategy, "http://activemq.apache.org/schema/core":pendingQueuePolicy, "http://activemq.apache.org/schema/core":pendingSubscriberPolicy, "http://activemq.apache.org/schema/core":slowConsumerStrategy, "http://activemq.apache.org/schema/core":subscriptionRecoveryPolicy, WC[##other:"http://activemq.apache.org/schema/core"]}' is expected.
      	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:397)[spring-beans-3.2.18.RELEASE.jar:3.2.18.RELEASE]
      	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:335)[spring-beans-3.2.18.RELEASE.jar:3.2.18.RELEASE]
      	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)[spring-beans-3.2.18.RELEASE.jar:3.2.18.RELEASE]
      	at org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions(ResourceXmlApplicationContext.java:111)[xbean-spring-3.18.jar:3.18]
      	at org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions(ResourceXmlApplicationContext.java:104)[xbean-spring-3.18.jar:3.18]
      	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)[spring-context-3.2.18.RELEASE.jar:3.2.18.RELEASE]
      	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:545)[spring-context-3.2.18.RELEASE.jar:3.2.18.RELEASE]
      	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:454)[spring-context-3.2.18.RELEASE.jar:3.2.18.RELEASE]
      	at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)[xbean-spring-3.18.jar:3.18]
      	at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)[xbean-spring-3.18.jar:3.18]
      	at org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:104)[activemq-spring-5.11.0.redhat-630329.jar:5.11.0.redhat-630329]
      	at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)[activemq-spring-5.11.0.redhat-630329.jar:5.11.0.redhat-630329]
      	at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)[activemq-spring-5.11.0.redhat-630329.jar:5.11.0.redhat-630329]
      	at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)[activemq-broker-5.11.0.redhat-630329.jar:5.11.0.redhat-630329]
      	at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)[activemq-broker-5.11.0.redhat-630329.jar:5.11.0.redhat-630329]
      	at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87)[activemq-console-5.11.0.redhat-630329.jar:5.11.0.redhat-630329]
      	at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:62)[activemq-console-5.11.0.redhat-630329.jar:5.11.0.redhat-630329]
      	at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:154)[activemq-console-5.11.0.redhat-630329.jar:5.11.0.redhat-630329]
      	at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:62)[activemq-console-5.11.0.redhat-630329.jar:5.11.0.redhat-630329]
      	at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)[activemq-console-5.11.0.redhat-630329.jar:5.11.0.redhat-630329]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_75]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_75]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_75]
      	at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_75]
      	at org.apache.activemq.console.Main.runTaskClass(Main.java:262)[activemq.jar:5.11.0.redhat-630329]
      	at org.apache.activemq.console.Main.main(Main.java:115)[activemq.jar:5.11.0.redhat-630329]
      

      With the "EnhancedThrowableRenderer" omitted from the config, I get the following exception logged for the same issue (note "caused by" logged)

      2018-03-12 13:19:30,608 | ERROR | Failed to load: class path resource [activemq.xml], reason: Line 54 in XML document from class path resource [activemq.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 54; columnNumber: 50; cvc-complex-type.2.4.a: Invalid content was found starting with element 'pendingMessageLimitStrategydd'. One of '{"http://activemq.apache.org/schema/core":deadLetterStrategy, "http://activemq.apache.org/schema/core":destination, "http://activemq.apache.org/schema/core":dispatchPolicy, "http://activemq.apache.org/schema/core":messageEvictionStrategy, "http://activemq.apache.org/schema/core":messageGroupMapFactory, "http://activemq.apache.org/schema/core":networkBridgeFilterFactory, "http://activemq.apache.org/schema/core":pendingDurableSubscriberPolicy, "http://activemq.apache.org/schema/core":pendingMessageLimitStrategy, "http://activemq.apache.org/schema/core":pendingQueuePolicy, "http://activemq.apache.org/schema/core":pendingSubscriberPolicy, "http://activemq.apache.org/schema/core":slowConsumerStrategy, "http://activemq.apache.org/schema/core":subscriptionRecoveryPolicy, WC[##other:"http://activemq.apache.org/schema/core"]}' is expected. | org.apache.activemq.xbean.XBeanBrokerFactory | main
      org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 54 in XML document from class path resource [activemq.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 54; columnNumber: 50; cvc-complex-type.2.4.a: Invalid content was found starting with element 'pendingMessageLimitStrategydd'. One of '{"http://activemq.apache.org/schema/core":deadLetterStrategy, "http://activemq.apache.org/schema/core":destination, "http://activemq.apache.org/schema/core":dispatchPolicy, "http://activemq.apache.org/schema/core":messageEvictionStrategy, "http://activemq.apache.org/schema/core":messageGroupMapFactory, "http://activemq.apache.org/schema/core":networkBridgeFilterFactory, "http://activemq.apache.org/schema/core":pendingDurableSubscriberPolicy, "http://activemq.apache.org/schema/core":pendingMessageLimitStrategy, "http://activemq.apache.org/schema/core":pendingQueuePolicy, "http://activemq.apache.org/schema/core":pendingSubscriberPolicy, "http://activemq.apache.org/schema/core":slowConsumerStrategy, "http://activemq.apache.org/schema/core":subscriptionRecoveryPolicy, WC[##other:"http://activemq.apache.org/schema/core"]}' is expected.
      	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:397)
      	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:335)
      	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
      	at org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions(ResourceXmlApplicationContext.java:111)
      	at org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions(ResourceXmlApplicationContext.java:104)
      	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
      	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:545)
      	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:454)
      	at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)
      	at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)
      	at org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:104)
      	at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)
      	at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)
      	at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)
      	at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
      	at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87)
      	at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:62)
      	at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:154)
      	at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:62)
      	at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.apache.activemq.console.Main.runTaskClass(Main.java:262)
      	at org.apache.activemq.console.Main.main(Main.java:115)
      Caused by: org.xml.sax.SAXParseException; lineNumber: 54; columnNumber: 50; cvc-complex-type.2.4.a: Invalid content was found starting with element 'pendingMessageLimitStrategydd'. One of '{"http://activemq.apache.org/schema/core":deadLetterStrategy, "http://activemq.apache.org/schema/core":destination, "http://activemq.apache.org/schema/core":dispatchPolicy, "http://activemq.apache.org/schema/core":messageEvictionStrategy, "http://activemq.apache.org/schema/core":messageGroupMapFactory, "http://activemq.apache.org/schema/core":networkBridgeFilterFactory, "http://activemq.apache.org/schema/core":pendingDurableSubscriberPolicy, "http://activemq.apache.org/schema/core":pendingMessageLimitStrategy, "http://activemq.apache.org/schema/core":pendingQueuePolicy, "http://activemq.apache.org/schema/core":pendingSubscriberPolicy, "http://activemq.apache.org/schema/core":slowConsumerStrategy, "http://activemq.apache.org/schema/core":subscriptionRecoveryPolicy, WC[##other:"http://activemq.apache.org/schema/core"]}' is expected.
      	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
      	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
      	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:437)
      	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
      	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:325)
      	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:458)
      	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3237)
      	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1796)
      	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:746)
      	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:379)
      	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2786)
      	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
      	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117)
      	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
      	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
      	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
      	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
      	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
      	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:347)
      	at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
      	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:389)
      

      Attachments

        Activity

          People

            gtully@redhat.com Gary Tully
            rhn-support-pfox Patrick Fox (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: