activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dejan Bosanac <de...@nighttale.net>
Subject Re: Loading embedded broker with an xml configuration
Date Tue, 23 Mar 2010 09:02:19 GMT
Hi,

seems like you're not using 5.3 version of ActiveMQ.

Cheers
--
Dejan Bosanac - http://twitter.com/dejanb

Open Source Integration - http://fusesource.com/
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net


On Tue, Mar 23, 2010 at 8:00 AM, ami.rozen <amir@peer39.com> wrote:

>
> Hi
>
> I am starting the brkoer using the xml file but I get the following error
> (the activemq.xml file is attached):
>
> 2010-03-22 18:19:27,570 FATAL com.peer39.commons.pattern.jms.JMSBroker -
> Failed.Unrecognized xbean element mapping: kahaDB in namespace
> http://activemq.apache.org/schema/core
> org.springframework.beans.factory.BeanDefinitionStoreException:
> Unrecognized
> xbean element mapping: kahaDB in namespace
> http://activemq.apache.org/schema/core
>        at
>
> org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parseBeanFromExtensionElement(XBeanNamespaceHandler.java:278)
>        at
>
> org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parse(XBeanNamespaceHandler.java:156)
>        at
>
> org.apache.xbean.spring.context.v2.XBeanNamespaceHandler.parse(XBeanNamespaceHandler.java:49)
>        at
>
> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1114)
>        at
>
> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1104)
>        at
>
> org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parseChildExtensionBean(XBeanNamespaceHandler.java:768)
>        at
>
> org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parseNestedPropertyViaIntrospection(XBeanNamespaceHandler.java:604)
>        at
>
> org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.tryParseNestedPropertyViaIntrospection(XBeanNamespaceHandler.java:571)
>        at
>
> org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.addNestedPropertyElements(XBeanNamespaceHandler.java:540)
>        at
>
> org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parseBeanFromExtensionElement(XBeanNamespaceHandler.java:227)
>        at
>
> org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parseBeanFromExtensionElement(XBeanNamespaceHandler.java:276)
>        at
>
> org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parse(XBeanNamespaceHandler.java:156)
>        at
>
> org.apache.xbean.spring.context.v2.XBeanNamespaceHandler.parse(XBeanNamespaceHandler.java:49)
>        at
>
> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1114)
>        at
>
> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1104)
>        at
>
> org.apache.xbean.spring.context.v2.XBeanBeanDefinitionDocumentReader.parseBeanDefinitions(XBeanBeanDefinitionDocumentReader.java:84)
>        at
>
> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:90)
>        at
>
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:458)
>        at
>
> org.apache.xbean.spring.context.v2.XBeanXmlBeanDefinitionReader.registerBeanDefinitions(XBeanXmlBeanDefinitionReader.java:79)
>        at
>
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:353)
>        at
>
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
>        at
>
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:280)
>        at
>
> org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions(ResourceXmlApplicationContext.java:111)
>        at
>
> org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions(ResourceXmlApplicationContext.java:104)
>        at
>
> org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:101)
>        at
>
> org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:389)
>        at
>
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:324)
>        at
>
> org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)
>        at
>
> org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)
>        at
>
> org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:96)
>        at
>
> org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:52)
>        at
>
> org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)
>        at
>
> org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
>        at
>
> org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:85)
>        at
>
> com.peer39.commons.pattern.jms.JMSBroker.initializeJMSBroker(JMSBroker.java:161)
>        at
> com.peer39.commons.pattern.jms.JMSBroker.<init>(JMSBroker.java:140)
>
>
> Dejan Bosanac wrote:
> >
> > Hi Ami,
> >
> > that article seems a bit obsolete (I just updated it). You should use
> > xbean:
> > to try to load xml file from either classpath or file system. So try
> > something like
> >
> > BrokerService service = BrokerFactory.createBroker(new
> > URI("xbean:/workspace/apache-activemq-5.3.0/conf/activemq.xml"));
> >
> > Cheers
> > --
> > Dejan Bosanac - http://twitter.com/dejanb
> >
> > Open Source Integration - http://fusesource.com/
> > ActiveMQ in Action - http://www.manning.com/snyder/
> > Blog - http://www.nighttale.net
> >
> >
> > On Wed, Mar 17, 2010 at 10:15 AM, ami.rozen <amir@peer39.com> wrote:
> >
> >>
> >> We are using activemq 5.1 and running a broker embedded in our java
> >> application (a standard one).
> >> Currently we are configuring the broker using java code.
> >> The problems we have are:
> >> 1.We don't seem to be able to make the broker use the temp storage (the
> >> configuration is below)
> >> 2.When using persistent = true storage files seems to always grow and
> are
> >> never being deleted.
> >> 3. We can't start the embedded broker using an external xml
> configuration
> >> file. We tried understanding how to do it from
> >>
> http://activemq.apache.org/how-do-i-embed-a-broker-inside-a-connection.html
> >> using the BrokerFactory with a url in the format of
> >> file:foo/bar/activemq.xml but we get the following error:
> >> Caused by: java.io.IOException: Could not find factory class for
> >> resource:
> >> META-INF/services/org/apache/activemq/broker/file
> >>        at
> >>
> >>
> org.apache.activemq.util.FactoryFinder.doFindFactoryProperies(FactoryFinder.java:92)
> >>        at
> >>
> org.apache.activemq.util.FactoryFinder.newInstance(FactoryFinder.java:52)
> >>        at
> >>
> org.apache.activemq.util.FactoryFinder.newInstance(FactoryFinder.java:42)
> >>        at
> >>
> >>
> org.apache.activemq.broker.BrokerFactory.createBrokerFactoryHandler(BrokerFactory.java:41)
> >>        ... 11 more
> >>
> >> The java configuration of the broker is as follows:
> >>
> >> URI serviceUrl = new URI( brokerUri + "?jms.prefetchPolicy.all=" +
> >> jmsMaxMessages + "&wireFormat.maxInactivityDuration=0" + "?useJmx=true"
> >> );
> >>
> >> broker = new BrokerService();
> >> broker.setUseJmx( true );
> >> broker.addConnector( serviceUrl );
> >> broker.setPersistent( false );
> >> ManagementContext managementContext = new ManagementContext();
> >> managementContext.setConnectorPort( 1098 );
> >> broker.setManagementContext( managementContext );
> >>
> >> SystemUsage memoryManager = new SystemUsage();
> >> MemoryUsage memoryUsage = new MemoryUsage();
> >> memoryUsage.setLimit( 512000000 );
> >> memoryManager.setMemoryUsage( memoryUsage );
> >>
> >> TempUsage tempDiskUsage = new TempUsage();
> >> tempDiskUsage.setLimit( 100000000);
> >> memoryManager.setTempUsage( tempDiskUsage );
> >>
> >> StoreUsage storeUsage = new StoreUsage();
> >> storeUsage.setLimit( 999999999 );
> >> storeUsage.setName( "foo" );
> >> memoryManager.setStoreUsage( storeUsage );
> >>
> >> broker.setSystemUsage( memoryManager );
> >>
> >> broker.setTempDataStore( tempDataStore );
> >> broker.setTmpDataDirectory( new File( dataDirectory ) );
> >>
> >> {
> >>    PersistenceAdapter adapter = broker.getPersistenceAdapter();
> >>    adapter.setUsageManager( memoryManager );
> >>    if( adapter instanceof AMQPersistenceAdapter )
> >>    {
> >>    AMQPersistenceAdapter amqPersistenceAdapter = (AMQPersistenceAdapter)
> >> adapter;
> >>
> >>    if( persistent )
> >>        amqPersistenceAdapter.setPersistentIndex( true );
> >>    else
> >>        amqPersistenceAdapter.setPersistentIndex( false );
> >>    }
> >> }
> >> broker.start();
> >>
> >> We have tried to change the configuration in so many ways, none seems to
> >> work ...
> >>
> >> Thank you for your help
> >> Ami
> >> --
> >> View this message in context:
> >>
> http://old.nabble.com/Loading-embedded-broker-with-an-xml-configuration-tp27928619p27928619.html
> >> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > -----
> > Dejan Bosanac
> >
> > Open Source Integration - http://fusesource.com/
> > ActiveMQ in Action - http://www.manning.com/snyder/
> > Blog - http://www.nighttale.net
> >
> http://old.nabble.com/file/p27996925/activemq.xml activemq.xml
> --
> View this message in context:
> http://old.nabble.com/Loading-embedded-broker-with-an-xml-configuration-tp27928619p27996925.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message