inglor
inglor

Reputation: 337

ActiveMQ Ubuntu server admin console

I installed the activeMQ package from ubuntu repositories and it's properly set up and running on my ubuntu-server VM. The problem is that I cannot connect to the admin console. I noticed that on windows bin the jetty.xml is imported on the activemq.xml so I did also in the ubunut-server. But still nothing. Can someone point out what else has to be done ?

EDIT After suggetions I should have posted the config, so here it is.

<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
      http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>

<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.base}/data"
        destroyApplicationContextOnStop="true">

  <destinationPolicy>
    <policyMap>
      <policyEntries>
        <policyEntry topic=">" producerFlowControl="true" memoryLimit="1mb">
          <pendingSubscriberPolicy>
            <vmCursor/>
          </pendingSubscriberPolicy>
        </policyEntry>
        <policyEntry queue=">" producerFlowControl="true" memoryLimit="1mb">
        </policyEntry>
      </policyEntries>
    </policyMap>
  </destinationPolicy>

  <destinations>
    <queue physicalName="CMAgentStatus"/>
    <queue physicalName="CMUpdateRequest"/>
    <queue physicalName="CMSnapshotEvent"/>
  </destinations>

  <managementContext>
    <managementContext createConnector="true"/>
  </managementContext>

  <persistenceAdapter>
    <kahaDB directory="${activemq.base}/data/kahadb"/>
  </persistenceAdapter>

  <transportConnectors>
    <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
  </transportConnectors>

</broker>

<!--    <import resource="jetty.xml"/>  -->
</beans>

When I include the jetty.xml the activeMQ doesn't load. No messages on the activemq.log though.

The jetty.xml looks like:

<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

<bean id="securityLoginService" class="org.eclipse.jetty.security.HashLoginService">
  <property name="name" value="ActiveMQRealm"/>
  <property name="config" value="${activemq.base}/conf/jetty-realm.properties"/>
</bean>

<bean id="securityConstraint" class="org.eclipse.jetty.http.security.Constraint">
  <property name="name" value="BASIC"/>
  <property name="roles" value="admin"/>
  <property name="authenticate" value="false"/>
</bean>
<bean id="securityConstraintMapping" class="org.eclipse.jetty.security.ConstraintMapping">
  <property name="constraint" ref="securityConstraint"/>
  <property name="pathSpec" value="/*"/>
</bean>
<bean id="securityHandler" class="org.eclipse.jetty.security.ConstraintSecurityHandler">
  <property name="loginService" ref="securityLoginService"/>
  <property name="authenticator">
    <bean class="org.eclipse.jetty.security.authentication.BasicAuthenticator"/>
  </property>
  <property name="constraintMappings">
    <list>
      <ref bean="securityConstraintMapping"/>
    </list>
  </property>
  <property name="handler">
    <bean id="sec" class="org.eclipse.jetty.server.handler.HandlerCollection">
      <property name="handlers">
        <list>
          <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"/>
          </bean>
          <bean class="org.eclipse.jetty.webapp.WebAppContext">

            <property name="contextPath" value="/camel"/>
            <property name="resourceBase" value="${activemq.home}/webapps/camel"/>
            <property name="logUrlOnStart" value="true"/>
          </bean>
          <bean class="org.eclipse.jetty.webapp.WebAppContext">
            <property name="contextPath" value="/demo"/>
            <property name="resourceBase" value="${activemq.home}/webapps/demo"/>
            <property name="logUrlOnStart" value="true"/>
          </bean>
          <bean class="org.eclipse.jetty.webapp.WebAppContext">
            <property name="contextPath" value="/fileserver"/>
            <property name="resourceBase" value="${activemq.home}/webapps/fileserver"/>
            <property name="logUrlOnStart" value="true"/>
            <property name="parentLoaderPriority" value="true"/>
          </bean>
          <bean class="org.eclipse.jetty.server.handler.ResourceHandler">
            <property name="directoriesListed" value="false"/>
            <property name="welcomeFiles">
              <list>
                <value>index.html</value>
              </list>
            </property>
            <property name="resourceBase" value="${activemq.home}/webapps/"/>
          </bean>
          <bean id="defaultHandler" class="org.eclipse.jetty.server.handler.DefaultHandler">
            <property name="serveIcon" value="false"/>
          </bean>
        </list>
      </property>
    </bean>
  </property>
</bean>

<bean id="contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection">
</bean>

<bean id="Server" class="org.eclipse.jetty.server.Server" init-method="start"
      destroy-method="stop">

  <property name="connectors">
    <list>
      <bean id="Connector" class="org.eclipse.jetty.server.nio.SelectChannelConnector">
        <property name="port" value="8161"/>
      </bean>
    </list>
  </property>

  <property name="handler">
    <bean id="handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
      <property name="handlers">
        <list>
          <ref bean="contexts"/>
          <ref bean="securityHandler"/>
        </list>
      </property>
    </bean>
  </property>

</bean>

</beans>

I hope this helps.

Upvotes: 0

Views: 1904

Answers (1)

Tim Bish
Tim Bish

Reputation: 18356

You should ensure that the ports that are configured are available and allowed by whatever security policy you have in place. If Jetty can't bind to 8161 then you will have an issue.

Upvotes: 1

Related Questions