6 Replies Latest reply on Jun 25, 2012 7:29 AM by nicolas duminil

    Can't create ActiveMQ broker

    nicolas duminil Master

      Greetings,

       

      I created a broker with the command:

       

      activemq:create-broker --name b1 --type spring

       

      This created a config file for the broker in the deploy directory listening on 61616. But the broker didn't start as there is no process listening on 61616. Looking in the log file I got the following:

       

      19:08:45,199 | INFO  | ExtenderThread-2 | XmlBeanDefinitionReader          | ?                                   ? | 73 - org.springframework.beans - 3.0.5.RELEASE | Loading XML bean definitions from URL bundle://446.0:0/META-INF/spring/b1-broker.xml

      19:08:45,758 | INFO  | ExtenderThread-2 | DependencyServiceManager         | ?                                   ? | 84 - org.springframework.osgi.extender - 1.2.1 | OsgiBundleXmlApplicationContext(bundle=b1-broker.xml, config=osgibundle:/META-INF/spring/*.xml) is waiting for u

      nsatisfied dependencies [[&transactionManager]]

      19:13:45,760 | WARN  | Timer-0          | WaiterApplicationContextExecutor | ?                                   ? | 84 - org.springframework.osgi.extender - 1.2.1 | Timeout occurred before finding service dependencies for [OsgiBundleXmlApplicationContext(bundle=b1-broker.xml,

      config=osgibundle:/META-INF/spring/*.xml)]

      19:13:45,762 | ERROR | Timer-0          | WaiterApplicationContextExecutor | ?                                   ? | 84 - org.springframework.osgi.extender - 1.2.1 | Unable to create application context for , unsatisfied dependencies: Dependency on [(objectClass=

      javax.transaction.TransactionManager)] (from bean )

      org.springframework.context.ApplicationContextException: Application context initialization for 'b1-broker.xml' has timed out

      19:13:45,763 | ERROR | Timer-0          | ContextLoaderListener            | ?                                   ? | 84 - org.springframework.osgi.extender - 1.2.1 | Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=b1-broker.xml, config=osgibundle:/MET

      A-INF/spring/*.xml))

      org.springframework.context.ApplicationContextException: Application context initialization for 'b1-broker.xml' has timed out

       

      Trying to list the brokers with activemq:list doesn't display anything.

       

      Why is javax.transaction.TransactionManager an unsatisfied dependency or why does the automatically generated configuration relying on a possible unsatisfied dependency ?

       

      Many thanks in advance,

       

      Nicolas

        • 1. Re: Can't create ActiveMQ broker
          Gert Vanthienen Novice

          L.S.,

           

           

          Assuming you're using 4.4.1-fuse here (as in one of your previous posts), there should be a bundle in your system that's called "Apache Aries Transaction Manager" that provides this service.  Did you perhaps modify the boot features or remove some features you weren't using?  Could you check if that bundle appears in the osgi:list and if it's active?

           

           

          Regards,

           

          Gert

          • 2. Re: Can't create ActiveMQ broker
            nicolas duminil Master

            Hi Gert,

             

            Thanks for takiing the time to reply to my post. yes, I'm using 4.4.1-fuse-03-06.

            Here is what I got:

             

            karaf@root> osgi:list | grep Aries

            Apache Aries Transaction Manager (0.3.0)

            Apache Aries Transaction Enlisting JDBC Datasource (0.3.0)

            Apache Aries Transaction Blueprint (0.3.0)

             

            Is that normal that bundle #50 be Resolved and not Active ?

             

            Kind regards,

             

            Nicolas

            • 3. Re: Can't create ActiveMQ broker
              Freeman(Yue) Fang Master

              Hi,

               

              No, it's not normal

              50 Resolved 60 Apache Aries Transaction Manager (0.3.0)

               

              is the reason why you can't create AMQ broker, the Apache Aries Transaction Manager bundle is the one which provide javax.transaction.TransactionManager OSGi service

               

              The correct status should be "Active" but not "Resolved". As Gert already asked you "Did you perhaps modify the boot features or remove some features you weren't using", Did you change any default configuration of FUSE ESB?

               

              Freeman

              • 4. Re: Can't create ActiveMQ broker
                nicolas duminil Master

                Hi,

                 

                Yes, as a matter of fact, as a post-install operation I removed JBI and anything related to JBI and, probably, more than that. I installed a fresh instance and then I got:

                 

                Default ActiveMQ Broker (b2) configuration file created at: D:\apache-servicemix-4.4.1-fuse-06-03\deploy\b2-broker.xml

                Please review the configuration and modify to suite your needs.

                 

                0

                karaf@root> Exception in thread "SpringOsgiExtenderThread-12" java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans

                Context

                        at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:171)

                        at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:368)

                        at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)

                        at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)

                        at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExec

                        at java.lang.Thread.run(Thread.java:662)

                 

                but the broker is there and it works. Now I would like to have the activemq console as well and did:

                 

                featurees:install activemq-web-console

                 

                It worked but the is noting listening on 8161. How could I know the TCP port number of the activemq console ?

                 

                Many thanks,

                 

                Nicolas

                • 5. Re: Can't create ActiveMQ broker
                  Gert Vanthienen Novice

                  Nicolas,

                   

                   

                  While we do try to ensure that all our feature definitions are fully self-contained, allowing you to install any features in any combination, we can't really test all possible permutations.  If you can provide us with the list of features you are installing, I'll give it a go here to see if I can reproduce/fix that combination for a next release.

                   

                  The "Exception in thread "SpringOsgiExtenderThread-12" java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans

                  Context" is the generic exception that is thrown by Spring DM - you can find more details about what really went wrong in the logs.  Perhaps you have the default configuration in there as well and you end up with a port already in use or something like that.

                   

                  In a plain Fuse MB distribution, they start a Jetty server on 8161, but in Fuse ESB, we already have a Jetty instance running on port 8181 so that one is being reused for the ActiveMQ console webapp as well.  You should be able to reach it at http://localhost:8181/activemqweb

                   

                   

                  Regards,

                   

                  Gert

                  • 6. Re: Can't create ActiveMQ broker
                    nicolas duminil Master

                    Hi Gert,

                     

                    I understand now, many thanks.

                     

                    Kind regards,

                     

                    Nicolas