Uploaded image for project: 'ActiveMQ'
  1. ActiveMQ
  2. AMQ-7347

Unnecessary stack trace in case of invalid selector

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.16.0, 5.15.12
    • Component/s: STOMP
    • Labels:
      None

      Description

      When using an invalid selector in STOMP, ActiveMQ logs a full stack trace:

      2019-11-20 09:23:57,842 [ActiveMQ NIO Worker 26] ERROR TopicRegion - Failed to create TopicSubscription 
      javax.jms.InvalidSelectorException: foo.bar = 'good'
      	at org.apache.activemq.selector.SelectorParser.parse(SelectorParser.java:88)
      	at org.apache.activemq.selector.SelectorParser.parse(SelectorParser.java:58)
      	at org.apache.activemq.broker.region.AbstractSubscription.parseSelector(AbstractSubscription.java:75)
      	at org.apache.activemq.broker.region.AbstractSubscription.<init>(AbstractSubscription.java:68)
      	at org.apache.activemq.broker.region.TopicSubscription.<init>(TopicSubscription.java:73)
      	at org.apache.activemq.broker.region.TopicRegion.createSubscription(TopicRegion.java:361)
      	at org.apache.activemq.broker.jmx.ManagedTopicRegion.createSubscription(ManagedTopicRegion.java:44)
      	at org.apache.activemq.broker.region.AbstractRegion.addConsumer(AbstractRegion.java:379)
      	at org.apache.activemq.broker.region.TopicRegion.addConsumer(TopicRegion.java:188)
      	at org.apache.activemq.broker.region.RegionBroker.addConsumer(RegionBroker.java:418)
      	at org.apache.activemq.broker.jmx.ManagedRegionBroker.addConsumer(ManagedRegionBroker.java:240)
      	at org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:104)
      	at org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:104)
      	at org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:104)
      	at org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:104)
      	at org.apache.activemq.security.AuthorizationBroker.addConsumer(AuthorizationBroker.java:183)
      	at org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:104)
      	at org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:104)
      	at org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:104)
      	at org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:104)
      	at org.apache.activemq.broker.TransportConnection.processAddConsumer(TransportConnection.java:703)
      	at org.apache.activemq.command.ConsumerInfo.visit(ConsumerInfo.java:352)
      	at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:336)
      	at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:200)
      	at org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:45)
      	at org.apache.activemq.transport.AbstractInactivityMonitor.onCommand(AbstractInactivityMonitor.java:301)
      	at org.apache.activemq.transport.stomp.StompTransportFilter.sendToActiveMQ(StompTransportFilter.java:97)
      	at org.apache.activemq.transport.stomp.ProtocolConverter.sendToActiveMQ(ProtocolConverter.java:177)
      	at org.apache.activemq.transport.stomp.ProtocolConverter.onStompSubscribe(ProtocolConverter.java:646)
      	at org.apache.activemq.transport.stomp.ProtocolConverter.onStompCommand(ProtocolConverter.java:235)
      	at org.apache.activemq.transport.stomp.StompTransportFilter.onCommand(StompTransportFilter.java:85)
      	at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)
      	at org.apache.activemq.transport.stomp.StompCodec.processCommand(StompCodec.java:133)
      	at org.apache.activemq.transport.stomp.StompCodec.parse(StompCodec.java:100)
      	at org.apache.activemq.transport.stomp.StompNIOTransport.processBuffer(StompNIOTransport.java:136)
      	at org.apache.activemq.transport.stomp.StompNIOTransport.serviceRead(StompNIOTransport.java:121)
      	at org.apache.activemq.transport.stomp.StompNIOTransport.access$000(StompNIOTransport.java:44)
      	at org.apache.activemq.transport.stomp.StompNIOTransport$1.onSelect(StompNIOTransport.java:73)
      	at org.apache.activemq.transport.nio.SelectorSelection.onSelect(SelectorSelection.java:98)
      	at org.apache.activemq.transport.nio.SelectorWorker$1.run(SelectorWorker.java:123)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: org.apache.activemq.selector.TokenMgrError: Lexical error at line 1, column 5.  Encountered: "b" (98), after : "."
      	at org.apache.activemq.selector.SelectorParserTokenManager.getNextToken(SelectorParserTokenManager.java:1053)
      	at org.apache.activemq.selector.SelectorParser.jj_scan_token(SelectorParser.java:1271)
      	at org.apache.activemq.selector.SelectorParser.jj_3_7(SelectorParser.java:946)
      	at org.apache.activemq.selector.SelectorParser.jj_2_7(SelectorParser.java:658)
      	at org.apache.activemq.selector.SelectorParser.unaryExpr(SelectorParser.java:458)
      	at org.apache.activemq.selector.SelectorParser.multExpr(SelectorParser.java:392)
      	at org.apache.activemq.selector.SelectorParser.addExpression(SelectorParser.java:361)
      	at org.apache.activemq.selector.SelectorParser.comparisonExpression(SelectorParser.java:213)
      	at org.apache.activemq.selector.SelectorParser.equalityExpression(SelectorParser.java:158)
      	at org.apache.activemq.selector.SelectorParser.andExpression(SelectorParser.java:137)
      	at org.apache.activemq.selector.SelectorParser.orExpression(SelectorParser.java:116)
      	at org.apache.activemq.selector.SelectorParser.JmsSelector(SelectorParser.java:107)
      	at org.apache.activemq.selector.SelectorParser.parse(SelectorParser.java:85)
      	... 42 more
      

      First of all, a single line containing the error message (javax.jms.InvalidSelectorException: foo.bar = 'good') is enough. The stack trace is not needed.

      Then, connection information (e.g. IP address) would be very useful to track down the culprit.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jbonofre Jean-Baptiste Onofré
                Reporter:
                lionel.cons Lionel Cons
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m