Found the fix.

Noticed that we have already opened bug tickets in ActiveMQ concerning this.

*ISSUE:*

It's not directly related to ActiveMQ, it's due to an upgrade of Jetty
which has some fixes that restrict the symbolic reference usage. (
/opt/app-1 -> /opt/app)

*FIX:*

Referring to actual reference (/opt/app-1) instead of symbolic reference
(/opt/app) will also fix the issue. Instead, there is a way to fix this
issue in jetty.xml

...<bean class="org.eclipse.jetty.webapp.WebAppContext">
 <property name="contextPath" value="/admin" />
 <property name="resourceBase" value="${activemq.home}/webapps/admin" />
 <property name="logUrlOnStart" value="true" />
<!-- add here. start -->
 <property name="aliasChecks">
   <list>
    <bean 
class="org.eclipse.jetty.server.handler.ContextHandler$ApproveAliases"/>
   </list>
  </property><!-- end --></bean>

Reference: https://issues.apache.org/jira/browse/AMQ-7341


Regards,

Ragul R

On Tue, Apr 30, 2024 at 2:45 PM ragul rangarajan <ragulrangara...@gmail.com>
wrote:

> Hi Team,
>
> I have noticed an issue in the recent upgrade of ActiveMQ from 5.16.1 to
> 5.16.7 where the ActiveMQ web console fails to start with the below
> exception. Other functionality is working fine but can't launch the web
> console. No configuration changes were made in this upgrade from my end.
>
> HTTP ERROR 503 Service Unavailable
>> URI: /***/web-console/
>> STATUS: 503
>> MESSAGE: Service Unavailable
>> SERVLET: -
>
>
> According to the exception below, I checked the file path and conf where
> the context pointed to the respective path and the file is available.
>
> *Jetty.xml*
>
>> <bean id="secHandlerCollection"
>> class="org.eclipse.jetty.server.handler.HandlerCollection">
>>         <property name="handlers">
>>             <list>
>>                 <bean class="org.eclipse.jetty.webapp.WebAppContext">
>>                     <property name="contextPath"
>> value="**/messagebus/web-console  "/>
>>                     <property name="resourceBase"
>> value="${activemq.home}/webapps/admin"/>
>>                     <property name="logUrlOnStart" value="true"/>
>>                 </bean>
>>             </list>
>>         </property>
>>     </bean>
>
>
> *Files*
>
>> ***/activemq/webapps/admin/WEB-INF/webconsole-default.xml
>> ***/activemq/webapps/admin/WEB-INF/webconsole-embedded.xml
>
>
> *Exception at start*
>
> 2024-04-24 15:41:17,563 | WARN  | Failed startup of context
>> o.e.j.w.WebAppContext@319c3a25{ActiveMQ
>> Console,/server/web-console,file:///path/activemq/webapps/admin/,UNAVAILABLE}
>> | org.eclipse.jetty.webapp.WebAppContext | main
>> org.springframework.beans.factory.BeanDefinitionStoreException:
>> IOException parsing XML document from ServletContext resource
>> [/WEB-INF/webconsole-embedded.xml]; nested exception is
>> java.io.FileNotFoundException: Could not open ServletContext resource
>> [/WEB-INF/webconsole-embedded.xml]
>> at
>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
>> at
>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
>> at
>> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:196)
>> at
>> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:232)
>> at
>> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:203)
>> at
>> org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
>> at
>> org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
>> at
>> org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
>> at
>> org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:679)
>> at
>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:562)
>> at
>> org.apache.activemq.web.WebConsoleStarter.createWebapplicationContext(WebConsoleStarter.java:71)
>> at
>> org.apache.activemq.web.WebConsoleStarter.contextInitialized(WebConsoleStarter.java:44)
>> at
>> org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:1073)
>> at
>> org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:572)
>> at
>> org.eclipse.jetty.server.handler.ContextHandler.contextInitialized(ContextHandler.java:1002)
>> at
>> org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:765)
>> at
>> org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:379)
>> at
>> org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1449)
>> at
>> org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1414)
>> at
>> org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:916)
>> at
>> org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:288)
>> at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:524)
>> at
>> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
>> at
>> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
>> at
>> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117)
>> at
>> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
>> at
>> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
>> at
>> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
>> at
>> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
>> at
>> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
>> at
>> org.eclipse.jetty.security.SecurityHandler.doStart(SecurityHandler.java:411)
>> at
>> org.eclipse.jetty.security.ConstraintSecurityHandler.doStart(ConstraintSecurityHandler.java:417)
>> at
>> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
>> at
>> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
>> at
>> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117)
>> at
>> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
>> at
>> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
>> at
>> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
>> at org.eclipse.jetty.server.Server.start(Server.java:423)
>> at
>> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
>> at
>> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
>> at org.eclipse.jetty.server.Server.doStart(Server.java:387)
>> at
>> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
>> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
>> Method)
>> at
>> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
>> at
>> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> at java.base/java.lang.reflect.Method.invoke(Method.java:568)
>> at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:285)
>> at
>> org.springframework.beans.factory.config.MethodInvokingBean.invokeWithTargetException(MethodInvokingBean.java:123)
>> at
>> org.springframework.beans.factory.config.MethodInvokingFactoryBean.afterPropertiesSet(MethodInvokingFactoryBean.java:108)
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863)
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800)
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
>> at
>> org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:336)
>> at
>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
>> at
>> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)
>> at
>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:209)
>> at
>> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:936)
>> at
>> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
>> at
>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:591)
>> 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:63)
>> at
>> org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:154)
>> at
>> org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)
>> at
>> org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)
>> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
>> Method)
>> at
>> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
>> at
>> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> at java.base/java.lang.reflect.Method.invoke(Method.java:568)
>> at org.apache.activemq.console.Main.runTaskClass(Main.java:262)
>> at org.apache.activemq.console.Main.main(Main.java:115)
>> Caused by: java.io.FileNotFoundException: Could not open ServletContext
>> resource [/WEB-INF/webconsole-embedded.xml]
>> at
>> org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:141)
>> at
>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:333)
>> ... 78 more
>>
>
>
> Do we need to add any configuration changes to launch the web console?
>
> Regards,
> Ragul
>

Reply via email to