Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 62346 invoked from network); 17 Sep 2010 14:16:39 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 17 Sep 2010 14:16:39 -0000 Received: (qmail 76070 invoked by uid 500); 17 Sep 2010 14:16:39 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 74984 invoked by uid 500); 17 Sep 2010 14:16:36 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 73897 invoked by uid 99); 17 Sep 2010 14:16:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Sep 2010 14:16:35 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of donzymeth@gmail.com designates 209.85.160.43 as permitted sender) Received: from [209.85.160.43] (HELO mail-pw0-f43.google.com) (209.85.160.43) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Sep 2010 14:16:27 +0000 Received: by pwi9 with SMTP id 9so3063947pwi.2 for ; Fri, 17 Sep 2010 07:16:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type; bh=zHxyuhxlydK73lozd4dZAe2QBO4+nxQD501e4X59caQ=; b=hhQfpWBA7rCO2xG8Xy2QKjo6wkn1+ANT0vPs5nkYBrqlGw2/XfiMSPHokeg+ztUDAp SM0YxqbiprvpE+vFtILwXa/LDZRrxjisotPoWOSt2isgJAr+/YPHxrNMdAUuhxWsCs+6 d6qGRy9spNA2aGZYDwmjqBe2HafXO+MuVnEpI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; b=ZUabQletYC+4ljCiNppErs40YIiv8ExCrdwKYjmuyUJAPwMVsBpdeeK075ukBWA47i rokppQdMBV+e5L/iegQreDApwxcvbPMPbSevQHUrZrfobxcfgMm2vqAcAVIjoe3VA9fz PtidEqHuoOuZ9XIF3kduKPoHoSGGqoj7bUR08= Received: by 10.142.195.14 with SMTP id s14mr788324wff.257.1284732967289; Fri, 17 Sep 2010 07:16:07 -0700 (PDT) Received: from [192.168.11.10] ([125.212.33.206]) by mx.google.com with ESMTPS id i20sm3674267wff.5.2010.09.17.07.16.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 17 Sep 2010 07:16:05 -0700 (PDT) Message-ID: <4C93781A.3010201@gmail.com> Date: Fri, 17 Sep 2010 22:15:54 +0800 From: Don Santillan User-Agent: Thunderbird 2.0.0.24 (X11/20100411) MIME-Version: 1.0 To: users@activemq.apache.org Subject: Re: StatisticsBrokerPlugin activation References: <0951468E4CC9D74F94A6FC9E557F786F426713C650@AMRXM3113.dir.svc.accenture.com> <4C91D431.6020701@gmail.com> <4C921B5C.1070207@gmail.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------050301080300060506050702" --------------050301080300060506050702 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Thanks for your help Gary, it's working now. Gary Tully wrote: > oops, sorry, my bad, so there is a broker factory for xbean but no > transport factory. The correct syntax is to use the vm transport > factory and tell it to use the xbean broker factory using the > brokerConfig attribute: > > The brokerURI should be of the form: vm://localhost?brokerConfig=xbean:... > so you still get a vm connection, but the embedded broker is created > using the referenced xml file. > > On 16 September 2010 14:27, Don Santillan wrote: > >> Hello Gary, >> >> Here's what I did: >> 1. added activemq.xml to classpath (classes/activemq.xml) >> 2. used xbean to initialize broker >> >> String brokerURI = "xbean:activemq.xml"; >> ActiveMQConnectionFactory connectionFactory = new >> ActiveMQConnectionFactory(brokerURI); >> connection = connectionFactory.createConnection(); >> connection.start(); >> >> 3. run the test. >> >> The test fails on the "connection = connectionFactory.createConnection();" >> line with the error: >> javax.jms.JMSException: Could not create Transport. Reason: >> java.io.IOException: Transport scheme NOT recognized: [xbean] >> at >> org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:35) >> at >> org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:245) >> at >> org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:258) >> at >> org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:230) >> at >> org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:178) >> at >> com.babelcentral.tallyho.gateway.messaging.MonitoringTest.initConnection(MonitoringTest.java:94) >> at >> com.babelcentral.tallyho.gateway.messaging.MonitoringTest.setUp(MonitoringTest.java:37) >> at junit.framework.TestCase.runBare(TestCase.java:132) >> at junit.framework.TestResult$1.protect(TestResult.java:110) >> at junit.framework.TestResult.runProtected(TestResult.java:128) >> at junit.framework.TestResult.run(TestResult.java:113) >> at junit.framework.TestCase.run(TestCase.java:124) >> at junit.framework.TestSuite.runTest(TestSuite.java:232) >> at junit.framework.TestSuite.run(TestSuite.java:227) >> at >> org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83) >> at >> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46) >> at >> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) >> at >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) >> at >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) >> at >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) >> at >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) >> Caused by: java.io.IOException: Transport scheme NOT recognized: [xbean] >> at >> org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:27) >> at >> org.apache.activemq.transport.TransportFactory.findTransportFactory(TransportFactory.java:204) >> at >> org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:79) >> at >> org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:243) >> ... 19 more >> Caused by: java.io.IOException: Could not find factory class for resource: >> META-INF/services/org/apache/activemq/transport/xbean >> at >> org.apache.activemq.util.FactoryFinder$StandaloneObjectFactory.loadProperties(FactoryFinder.java:96) >> at >> org.apache.activemq.util.FactoryFinder$StandaloneObjectFactory.create(FactoryFinder.java:58) >> at >> org.apache.activemq.util.FactoryFinder.newInstance(FactoryFinder.java:146) >> at >> org.apache.activemq.transport.TransportFactory.findTransportFactory(TransportFactory.java:201) >> ... 21 more >> >> >> -don >> >> >> Gary Tully wrote: >> >>> Use the xbean: uri syntax to reference an xml configuration file in >>> your brokerURI, that is the most flexible way to configure an embedded >>> broker. >>> >>> http://activemq.apache.org/broker-configuration-uri.html >>> >>> >>> >>> On 16 September 2010 09:24, Don Santillan wrote: >>> >>> >>>> Hello, >>>> >>>> I am using activemq as a dependency in a web app. My web app is deployed >>>> to >>>> a jetty server which is run through maven by issuing "mvn jetty:run". >>>> >>>> Of course, one part of the web app is to create and start a broker. I am >>>> doing this through ActiveMQConnectionFactory (as described at the last >>>> part >>>> of >>>> >>>> http://activemq.apache.org/how-do-i-embed-a-broker-inside-a-connection.html, >>>> titled "Using ActiveMQConnectionFactory"): >>>> >>>> String brokerURI = "vm://testBroker?broker.persistent=false"; >>>> ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory(brokerURI); >>>> Connection connection = cf.createConnection(); >>>> connection.start(); >>>> >>>> Now, since I am running my web web app through maven, and activemq is >>>> used >>>> as a library (not as a standalone app), I don't have an activemq.xml >>>> configuration file. So, I don't know where to activate/enable >>>> StatisticsBrokerPlugin as described at >>>> http://activemq.apache.org/statisticsplugin.html: >>>> >>>> >>>> >>>> statisticsBrokerPlugin/> >>>> >>>> >>>> >>>> Also, since I am using ActiveMQConnectionFactory to create and start the >>>> broker, I can't take advantage of setting the plugin through >>>> BrokerService: >>>> >>>> BrokerPlugin plugin = new StatisticsBrokerPlugin(); >>>> BrokerPlugin[] plugins = {plugin}; >>>> >>>> BrokerService broker = new BrokerService(); >>>> try { >>>> broker.addConnector(brokerURI); >>>> broker.setPlugins(plugins); >>>> broker.start(); >>>> } catch (Exception e) { >>>> e.printStackTrace(); >>>> } >>>> >>>> Now, my questions are: >>>> 1. How will I be able to set the StatisticsBrokerPlugin with the above >>>> scenario? >>>> 2. Is there a way to get a reference to the broker to be able to set the >>>> plugin? >>>> 3. Is there a way to add and use activemq.xml if it is used as a library >>>> and >>>> run through maven? Set in pom.xml? >>>> >>>> Please help. I really need this to work. >>>> >>>> Thanks in advance. >>>> >>>> -don >>>> >>>> >>>> >>> >>> >>> > > > > --------------050301080300060506050702--