Unable to launch ActiveMQ v5.14.3 with Jetty

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Unable to launch ActiveMQ v5.14.3 with Jetty

xabhi
Hi,
I am trying to use new version of ActiveMQ v5.14.3 but i am not able to launch it with embedded jetty server of AJAX. The same setup is working for ActiveMQ v5.11.1 without any issues:

The jetty version in 5.11.1 is v8.1.16.v20140903.

Java command for v5.14.3:
Java Runtime: Oracle Corporation 1.8.0_60 /usr/local/java/jdk1.8.0.60-2016i/jre
  Heap sizes: current=2010112k  free=1968127k  max=7456768k
    JVM args: -Xmx8g -XX:ErrorFile=/var/tmp/hs_err_pid%p.log -Dactivemq.broker.name=mqbrokertest -Dactivemq.broker.type=primary -Dactivemq.classpath=/proj/tools/build/stable/base//java/jar/common.jar:/proj/tools/build/stable/base//java/jar/sonar.jar:/proj/tools/build/stable/base//java/jar/tools.jar -D
activemq.data.dir=/u/amqtest/test//kahadb/ -Dactivemq.jmx.port=9006 -Dactivemq.log.dir=/u/amqtest/test//logs/ -Dactivemq.webapps.dir=/u/amqtest/test//webapps/
 -Djava.library.path=/proj/tools/build/stable/base//lib/Linux.RHEL7.x86_64 -Dlog4j.configuration=
file:/proj/tools/build/stable/base//etc/config/activemq/log4j.properties -Dorg.apache.activemq.audit=true -Dorg.apache.activemq.store.kahadb.LOG_SLOW_ACCESS_T
IME=5000
Extensions classpath:
  [/proj/tools/infra/apache/activemq/apache-activemq-5.14.3/lib,/proj/tools/infra/apache/activemq/apache-activemq-5.14.3/lib/camel,/proj/tools/infra/apache/ac
tivemq/apache-activemq-5.14.3/lib/optional,/proj/tools/infra/apache/activemq/apache-activemq-5.14.3/lib/web,/proj/tools/infra/apache/activemq/apache-activemq-
5.14.3/lib/extra]
ACTIVEMQ_HOME: /proj/tools/infra/apache/activemq/apache-activemq-5.14.3
ACTIVEMQ_BASE: /proj/tools/infra/apache/activemq/apache-activemq-5.14.3
ACTIVEMQ_CONF: /proj/tools/infra/apache/activemq/apache-activemq-5.14.3/conf
ACTIVEMQ_DATA: /proj/tools/infra/apache/activemq/apache-activemq-5.14.3/data
Loading message broker from: xbean:file:/u/amqtest/config/amq_test_broker_config.xml


I get below class not found exception but i haven't changed anything except the activemq version:

ERROR: java.lang.RuntimeException: Failed to execute start task. Reason: org.springframework.beans.factory.BeanCreationException: Error creating bean with nam
e 'Server' defined in URL [file:/proj/tools/build/stable/base/etc/config/activemq/amq_jetty_config.xml]: Cannot create inner bean 'Connector' of type [org.ecl
ipse.jetty.server.nio.SelectChannelConnector] while setting bean property 'connectors' with key [0]; nested exception is org.springframework.beans.factory.Can
notLoadBeanClassException: Cannot find class [org.eclipse.jetty.server.nio.SelectChannelConnector] for bean with name 'Connector' defined in URL [file:/proj/t
ools/build/stable/base/etc/config/activemq/amq_jetty_config.xml]; nested exception is java.lang.ClassNotFoundException: org.eclipse.jetty.server.nio.SelectCha
nnelConnector
java.lang.RuntimeException: Failed to execute start task. Reason: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'Serv
er' defined in URL [file:/proj/tools/build/stable/base/etc/config/activemq/amq_jetty_config.xml]: Cannot create inner bean 'Connector' of type [org.eclipse.je
tty.server.nio.SelectChannelConnector] while setting bean property 'connectors' with key [0]; nested exception is org.springframework.beans.factory.CannotLoad
BeanClassException: Cannot find class [org.eclipse.jetty.server.nio.SelectChannelConnector] for bean with name 'Connector' defined in URL [file:/proj/tools/bu
ild/stable/base/etc/config/activemq/amq_jetty_config.xml]; nested exception is java.lang.ClassNotFoundException: org.eclipse.jetty.server.nio.SelectChannelCon
nector
        at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:91)
        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 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.apache.activemq.console.Main.runTaskClass(Main.java:262)
        at org.apache.activemq.console.Main.main(Main.java:115)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'Server' defined in URL [file:/proj/tools/build/stable/base/etc/config/activemq/amq_jetty_config.xml]: Cannot create inner bean 'Connector' of type [org.eclipse.jetty.server.nio.SelectChannelConnector] while setting bean property 'connectors' with key [0]; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.eclipse.jetty.server.nio.SelectChannelConnector] for bean with name 'Connector' defined in URL [file:/proj/tools/build/stable/base/etc/config/activemq/amq_jetty_config.xml]; nested exception is java.lang.ClassNotFoundException: org.eclipse.jetty.server.nio.SelectChannelConnector
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:313)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:122)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:382)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:157)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1475)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1220)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
Reply | Threaded
Open this post in threaded view
|

Re: Unable to launch ActiveMQ v5.14.3 with Jetty

xabhi
Below is the minimum configuration required to reproduce this problem. I am using these files will freshly extracted ActiveMQ v5.14.3 with no changes.

I am not sure what is missing as this works fine with v5.11.1 with below command:
~/apache-activemq-5.11.1/bin/activemq console xbean:/u/choudhab/activemq/activemq-test/test-broker.xml

Command used to run:
~/apache-activemq-5.14.3/bin/activemq console xbean:/u/choudhab/activemq/activemq-test/test-broker.xml


Broker config file:

<?xml version="1.0" encoding="UTF-8"?>
<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
                        classpath:org/springframework/beans/factory/xml/spring-beans-2.0.xsd
                        http://activemq.apache.org/schema/core
                        classpath:activemq.xsd">
   

    <amq:broker persistent="true" brokerName="testbroker"
        useJmx="true" offlineDurableSubscriberTimeout="172800000"
        offlineDurableSubscriberTaskSchedule="3600000" advisorySupport="false">

        <amq:managementContext>
            <amq:managementContext connectorPort="9006" jmxDomainName="org.apache.activemq"/>
        </amq:managementContext>
       
        <amq:persistenceAdapter>
            <amq:mKahaDB directory="/u/choudhab/activemq/activemq-test/kahadb" journalMaxFileLength="64mb">
                <amq:filteredPersistenceAdapters>
                       
                    <amq:filteredKahaDB>
                        <amq:persistenceAdapter>
                            <amq:kahaDB/>
                        </amq:persistenceAdapter>
                    </amq:filteredKahaDB>
                </amq:filteredPersistenceAdapters>
            </amq:mKahaDB>
        </amq:persistenceAdapter>
       
       <amq:transportConnectors>
            <amq:transportConnector name="mqbrokerNioTransport"
                                    uri="nio://0.0.0.0:61616?wireFormat.maxInactivityDuration=120000&amp;maximumConnections=1000&amp;wireFormat.maxFrameSize=157286400"
                                    maximumProducersAllowedPerConnection="50"
                                    maximumConsumersAllowedPerConnection="50" />

        </amq:transportConnectors>
       
    </amq:broker> 

   
    <import resource="file:/u/choudhab/activemq/activemq-test/test-jetty.xml"/>

</beans>


Jetty config file:

<?xml version="1.0" encoding="UTF-8"?>
<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="webappHandlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
        <property name="handlers">
            <list>
                <bean class="org.eclipse.jetty.webapp.WebAppContext">
                    <property name="contextPath" value="/"/>
                    <property name="resourceBase" value="/u/choudhab/activemq/activemq-test/webapps"/>
                    <property name="logUrlOnStart" value="true"/>
                </bean>
                <bean id="defaultHandler" class="org.eclipse.jetty.server.handler.DefaultHandler">
                </bean>
            </list>
        </property>
    </bean>

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

    <bean id="requestLogImpl" class="org.eclipse.jetty.server.NCSARequestLog">
        <property name="filename" value="/u/choudhab/activemq/activemq-test/logs/jetty-yyyy_MM_dd.log"/>
        <property name="filenameDateFormat" value="yyyyMMdd"/>
        <property name="LogTimeZone" value="EDT"/>
        <property name="retainDays" value="7"/>
        <property name="append" value="true"/>
    </bean>

    <bean id="requestLog" class="org.eclipse.jetty.server.handler.RequestLogHandler">
        <property name="requestLog">
            <ref bean="requestLogImpl"/>
        </property>
    </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="webappHandlers"/>
                        <ref bean="requestLog"/>
                    </list>
                </property>
            </bean>
        </property>
    </bean>
</beans>
Reply | Threaded
Open this post in threaded view
|

Re: Unable to launch ActiveMQ v5.14.3 with Jetty

xabhi
Looks like it is due to Jetty upgrade in ActiveMQ version and SelectChannelConnector seems to have been removed in new jetty version (http://stackoverflow.com/questions/36788049/selectchannelconnector-alternative-class-in-jetty-9-and-above)

Reply | Threaded
Open this post in threaded view
|

Re: Unable to launch ActiveMQ v5.14.3 with Jetty

Tim Bain
Could you please write a bug report in JIRA for this issue?

On Jan 5, 2017 9:04 AM, "xabhi" <[hidden email]> wrote:

> Looks like it is due to Jetty upgrade in ActiveMQ version and
> SelectChannelConnector seems to have been removed in new jetty version (
> http://stackoverflow.com/questions/36788049/selectchannelconnector-
> alternative-class-in-jetty-9-and-above
> <http://stackoverflow.com/questions/36788049/selectchannelconnector-
> alternative-class-in-jetty-9-and-above>
> )
>
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/Unable-to-launch-ActiveMQ-v5-14-3-with-Jetty-
> tp4720841p4720855.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>