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

java.lang.NullPointerException: Cannot invoke "String.length()" because "replacement" is null

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.17.3
    • 5.18.0, 5.17.4
    • None
    • None

    Description

      After upgrading a test broker to 5.17.3, ActiveMQ reports a NPE during startup.

      Here is the full trace:

      2022-12-05T07:06:21.255+0100 [WrapperSimpleAppMain] WARN WebAppContext - Failed startup of context o.e.j.w.WebAppContext@4cd59611{Apache ActiveMQ REST API,/api,file:///usr/share/activemq-5.17.3/webapps/api/,UNAVAILABLE}
      javax.servlet.ServletException: jolokia-agent==org.jolokia.http.AgentServlet@c61e72f3{jsp=null,order=1,inst=true,async=false,src=DESCRIPTOR:file:///usr/share/activemq-5.17.3/webapps/api/WEB-INF/web.xml,STARTED}
      	at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:650) ~[jetty-servlet-9.4.49.v20220914.jar:9.4.49.v20220914]
      	at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:415) ~[jetty-servlet-9.4.49.v20220914.jar:9.4.49.v20220914]
      	at org.eclipse.jetty.servlet.ServletHandler.lambda$initialize$0(ServletHandler.java:750) ~[jetty-servlet-9.4.49.v20220914.jar:9.4.49.v20220914]
      	at java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357) ~[?:?]
      	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:510) ~[?:?]
      	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
      	at java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:310) ~[?:?]
      	at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:735) ~[?:?]
      	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762) ~[?:?]
      	at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:774) ~[jetty-servlet-9.4.49.v20220914.jar:9.4.49.v20220914]
      	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:379) ~[jetty-servlet-9.4.49.v20220914.jar:9.4.49.v20220914]
      	at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1449) ~[jetty-webapp-9.4.49.v20220914.jar:9.4.49.v20220914]
      	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1414) ~[jetty-webapp-9.4.49.v20220914.jar:9.4.49.v20220914]
      	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:916) ~[jetty-server-9.4.49.v20220914.jar:9.4.49.v20220914]
      	at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:288) ~[jetty-servlet-9.4.49.v20220914.jar:9.4.49.v20220914]
      	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:524) ~[jetty-webapp-9.4.49.v20220914.jar:9.4.49.v20220914]
      	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73) ~[jetty-util-9.4.49.v20220914.jar:9.4.49.v20220914]
      	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169) ~[jetty-util-9.4.49.v20220914.jar:9.4.49.v20220914]
      	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117) ~[jetty-util-9.4.49.v20220914.jar:9.4.49.v20220914]
      	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97) ~[jetty-server-9.4.49.v20220914.jar:9.4.49.v20220914]
      	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73) ~[jetty-util-9.4.49.v20220914.jar:9.4.49.v20220914]
      	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169) ~[jetty-util-9.4.49.v20220914.jar:9.4.49.v20220914]
      	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117) ~[jetty-util-9.4.49.v20220914.jar:9.4.49.v20220914]
      	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97) ~[jetty-server-9.4.49.v20220914.jar:9.4.49.v20220914]
      	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73) ~[jetty-util-9.4.49.v20220914.jar:9.4.49.v20220914]
      	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169) ~[jetty-util-9.4.49.v20220914.jar:9.4.49.v20220914]
      	at org.eclipse.jetty.server.Server.start(Server.java:423) ~[jetty-server-9.4.49.v20220914.jar:9.4.49.v20220914]
      	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110) ~[jetty-util-9.4.49.v20220914.jar:9.4.49.v20220914]
      	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97) ~[jetty-server-9.4.49.v20220914.jar:9.4.49.v20220914]
      	at org.eclipse.jetty.server.Server.doStart(Server.java:387) ~[jetty-server-9.4.49.v20220914.jar:9.4.49.v20220914]
      	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73) ~[jetty-util-9.4.49.v20220914.jar:9.4.49.v20220914]
      	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
      	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
      	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
      	at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
      	at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:283) ~[spring-core-5.3.23.jar:5.3.23]
      	at org.springframework.beans.factory.config.MethodInvokingBean.invokeWithTargetException(MethodInvokingBean.java:123) ~[spring-beans-5.3.23.jar:5.3.23]
      	at org.springframework.beans.factory.config.MethodInvokingFactoryBean.afterPropertiesSet(MethodInvokingFactoryBean.java:108) ~[spring-beans-5.3.23.jar:5.3.23]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.23.jar:5.3.23]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.23.jar:5.3.23]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.23.jar:5.3.23]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.23.jar:5.3.23]
      	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.23.jar:5.3.23]
      	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.23.jar:5.3.23]
      	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.23.jar:5.3.23]
      	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.23.jar:5.3.23]
      	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:936) ~[spring-beans-5.3.23.jar:5.3.23]
      	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.23.jar:5.3.23]
      	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.23.jar:5.3.23]
      	at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64) ~[xbean-spring-4.22.jar:4.22]
      	at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52) ~[xbean-spring-4.22.jar:4.22]
      	at org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:104) ~[activemq-spring-5.17.3.jar:5.17.3]
      	at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104) ~[activemq-spring-5.17.3.jar:5.17.3]
      	at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67) ~[activemq-spring-5.17.3.jar:5.17.3]
      	at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71) ~[activemq-broker-5.17.3.jar:5.17.3]
      	at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54) ~[activemq-broker-5.17.3.jar:5.17.3]
      	at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87) ~[activemq-console-5.17.3.jar:5.17.3]
      	at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63) ~[activemq-console-5.17.3.jar:5.17.3]
      	at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:154) ~[activemq-console-5.17.3.jar:5.17.3]
      	at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63) ~[activemq-console-5.17.3.jar:5.17.3]
      	at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104) ~[activemq-console-5.17.3.jar:5.17.3]
      	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
      	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
      	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
      	at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
      	at org.apache.activemq.console.Main.runTaskClass(Main.java:262) ~[activemq.jar:5.17.3]
      	at org.apache.activemq.console.Main.main(Main.java:115) ~[activemq.jar:5.17.3]
      	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
      	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
      	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
      	at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
      	at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:349) ~[wrapper.jar:3.5.51]
      	at java.lang.Thread.run(Thread.java:833) ~[?:?]
      Caused by: java.lang.NullPointerException: Cannot invoke "String.length()" because "replacement" is null
      	at java.util.regex.Matcher.appendExpandedReplacement(Matcher.java:1014) ~[?:?]
      	at java.util.regex.Matcher.appendReplacement(Matcher.java:907) ~[?:?]
      	at org.jolokia.util.NetworkUtil.replaceExpression(NetworkUtil.java:366) ~[jolokia-core-1.7.1.jar:?]
      	at org.jolokia.restrictor.RestrictorFactory.createRestrictor(RestrictorFactory.java:48) ~[jolokia-core-1.7.1.jar:?]
      	at org.jolokia.http.AgentServlet.createRestrictor(AgentServlet.java:195) ~[jolokia-core-1.7.1.jar:?]
      	at org.jolokia.http.AgentServlet.init(AgentServlet.java:135) ~[jolokia-core-1.7.1.jar:?]
      	at org.eclipse.jetty.servlet.ServletHolder$Wrapper.init(ServletHolder.java:1345) ~[jetty-servlet-9.4.49.v20220914.jar:9.4.49.v20220914]
      	at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:632) ~[jetty-servlet-9.4.49.v20220914.jar:9.4.49.v20220914]
      	... 72 more
      

      Attachments

        Activity

          People

            jbonofre Jean-Baptiste Onofré
            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 - 10m
                10m