2 Replies Latest reply on Aug 7, 2014 12:08 PM by matt_madhavan

    Error with embedded A-MQ in JBoss EAP 6.2

    jamiebez

      I am trying to run A-MQ embedded within JBoss (by which I mean running as a RAR within JBoss, not as its own executable) and I am running into an issue.  Good news is that my queues seem to work fine once the server starts up, but I am running into the following exception at startup:

       

      14:27:57,705 ERROR [stderr] (JMX connector) Exception in thread "JMX connector" java.lang.UnsupportedOperationException: JBAS011859: Naming context is read-only

      14:27:57,706 ERROR [stderr] (JMX connector) at org.jboss.as.naming.WritableServiceBasedNamingStore.requireOwner(WritableServiceBasedNamingStore.java:144)

      14:27:57,706 ERROR [stderr] (JMX connector) at org.jboss.as.naming.WritableServiceBasedNamingStore.bind(WritableServiceBasedNamingStore.java:62)

      14:27:57,706 ERROR [stderr] (JMX connector) at org.jboss.as.naming.NamingContext.bind(NamingContext.java:248)

      14:27:57,706 ERROR [stderr] (JMX connector) at org.jboss.as.naming.InitialContext.bind(InitialContext.java:147)

      14:27:57,706 ERROR [stderr] (JMX connector) at org.jboss.as.naming.NamingContext.bind(NamingContext.java:257)

      14:27:57,706 ERROR [stderr] (JMX connector) at javax.naming.InitialContext.bind(InitialContext.java:400)

      14:27:57,706 ERROR [stderr] (JMX connector) at javax.management.remote.rmi.RMIConnectorServer.bind(RMIConnectorServer.java:625)

      14:27:57,707 ERROR [stderr] (JMX connector) at javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:412)

      14:27:57,707 ERROR [stderr] (JMX connector) at org.apache.activemq.broker.jmx.ManagementContext$1.run(ManagementContext.java:131)

       

      I am following the instructions here for the mostpart: Integration of JBoss AS 7 with ActiveMQ but I'll summarize.

       

      I am using JBoss EAP 6.2 and A-MQ 6.1, both on Windows 7

       

      1. I unpacked the activemq-ra.rar from the download and edited META-INF/ra.xml
        • Set ServerUrl configuration property to vm://localhost
        • Make sure that BrokerXmlConfig configuration property is set to xbean:broker-config.xml
      2. Edited broker-config.xml in activemq-ra.rar
        • Set <kahaDB directory="..."/> to point to ../standalone/data/activemq
      3. Repackaged the rar and deployed in JBoss
      4. Edited my standalone-full.xml config as follows:

       

      <resource-adapters> 

          <resource-adapter> 

              <archive> 

                  activemq-ra.rar 

              </archive> 

              <transaction-support>XATransaction</transaction-support> 

              <config-property name="ServerUrl"> 

                  vm://transport 

              </config-property> 

              <connection-definitions> 

                  <connection-definition class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory" jndi-name="java:/activemq/ConnectionFactory" enabled="true" use-java-context="true" pool-name="ActiveMQConnectionFactoryPool" use-ccm="true"> 

                      <xa-pool> 

                          <min-pool-size>1</min-pool-size> 

                          <max-pool-size>20</max-pool-size> 

                      </xa-pool> 

                  </connection-definition> 

              </connection-definitions> 

              <admin-objects> 

              ... configured a few queues/topics

              </admin-objects> 

          </resource-adapter> 

      </resource-adapters> 

       

      Restarted JBoss when done.  Exception appears in the JBoss log just after my application starts.

       

      It looks like it's JMX related so I tried setting <broker xmlns="http://activemq.apache.org/schema/core" useJmx="false" useShutdownHook="false"> in my broker-config.xml and redeploying the new .rar.  No change.