Hi,

you need

<plugins>

</plugins>

around <simpleAuthenticationPlugin>


Regards
--
Dejan Bosanac
----------------------
Red Hat, Inc.
FuseSource is now part of Red Hat
dbosa...@redhat.com
Twitter: @dejanb
Blog: http://sensatic.net
ActiveMQ in Action: http://www.manning.com/snyder/


On Fri, Jan 10, 2014 at 1:50 AM, Rodrigo Ramos <crackdu...@gmail.com> wrote:

> Hi Folks
>
> Im trying set up user and password into activemq.xml, as follow lines:
>
> <broker xmlns="http://activemq.apache.org/schema/core";
> brokerName="broker-instance-1" dataDirectory="${activemq.data}">
>
>         <!--
>             For better performances use VM cursor and small memory limit.
>             For more information, see:
>
>             http://activemq.apache.org/message-cursors.html
>
>             Also, if your producer is "hanging", it's probably due to
> producer flow control.
>             For more information, see:
>             http://activemq.apache.org/producer-flow-control.html
>         -->
>
>         *<simpleAuthenticationPlugin>*
> *            <users>*
> *                <authenticationUser username="system" password="manager"
> groups="users,admins"/>*
> *                 <authenticationUser username="guest" password="password"
> groups="guests"/>*
> *           </users>*
> *        </simpleAuthenticationPlugin>*
>
>         <destinationPolicy>
>             <policyMap>
>               <policyEntries>
>                 <policyEntry producerFlowControl="true" topic="&gt;">
>                     <!-- The constantPendingMessageLimitStrategy is used to
> prevent
>                          slow topic consumers to block producers and affect
> other consumers
>                          by limiting the number of messages that are
> retained
>                          For more information, see:
>
>
> http://activemq.apache.org/slow-consumer-handling.html
>
>                     -->
>                   <pendingMessageLimitStrategy>
>                     <constantPendingMessageLimitStrategy limit="1000"/>
>                   </pendingMessageLimitStrategy>
>                 </policyEntry>
>                 <policyEntry memoryLimit="1mb" producerFlowControl="true"
> queue="&gt;">
>                   <!-- Use VM cursor for better latency
>
>
> These directives I got from http://activemq.apache.org/security.html
>
> The error is below:
>
> 2014-01-09 18:40:20,198 | ERROR | Failed to load: class path resource
> [activemq.xml], reason: Line 26 in XML document from class path resource
> [activemq.xml] is invalid; nested exception is
> org.xml.sax.SAXParseException; lineNumber: 26; columnNumber: 30;
> cvc-complex-type.2.4.a: Invalid content was found starting with element
> 'simpleAuthenticationPlugin'. One of '{"
> http://activemq.apache.org/schema/core":adminView, "
> http://activemq.apache.org/schema/core":brokerContext, "
> http://activemq.apache.org/schema/core":consumerSystemUsage, "
> http://activemq.apache.org/schema/core":destinationFactory, "
> http://activemq.apache.org/schema/core":destinationInterceptors, "
> http://activemq.apache.org/schema/core":destinationPolicy, "
> http://activemq.apache.org/schema/core":destinations, "
> http://activemq.apache.org/schema/core":ioExceptionHandler, "
> http://activemq.apache.org/schema/core":jmsBridgeConnectors, "
> http://activemq.apache.org/schema/core":jobSchedulerStore, "
> http://activemq.apache.org/schema/core":managementContext, "
> http://activemq.apache.org/schema/core":messageAuthorizationPolicy, "
> http://activemq.apache.org/schema/core":networkConnectorURIs, "
> http://activemq.apache.org/schema/core":networkConnectors, "
> http://activemq.apache.org/schema/core":persistenceAdapter, "
> http://activemq.apache.org/schema/core":persistenceFactory, "
> http://activemq.apache.org/schema/core":persistenceTaskRunnerFactory, "
> http://activemq.apache.org/schema/core":plugins, "
> http://activemq.apache.org/schema/core":producerSystemUsage, "
> http://activemq.apache.org/schema/core":proxyConnectors, "
> http://activemq.apache.org/schema/core":regionBroker, "
> http://activemq.apache.org/schema/core":services, "
> http://activemq.apache.org/schema/core":shutdownHooks, "
> http://activemq.apache.org/schema/core":sslContext, "
> http://activemq.apache.org/schema/core":systemUsage, "
> http://activemq.apache.org/schema/core":taskRunnerFactory, "
> http://activemq.apache.org/schema/core":tempDataStore, "
> http://activemq.apache.org/schema/core":transportConnectorURIs, "
> http://activemq.apache.org/schema/core":transportConnectors, WC[##other:"
> http://activemq.apache.org/schema/core"]}' is expected. |
> org.apache.activemq.xbean.XBeanBrokerFactory | main
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
> 26 in XML document from class path resource [activemq.xml] is invalid;
> nested exception is org.xml.sax.SAXParseException; lineNumber: 26;
> columnNumber: 30; cvc-complex-type.2.4.a: Invalid content was found
> starting with element 'simpleAuthenticationPlugin'. One of '{"
> http://activemq.apache.org/schema/core":adminView, "
> http://activemq.apache.org/schema/core":brokerContext, "
> http://activemq.apache.org/schema/core":consumerSystemUsage, "
> http://activemq.apache.org/schema/core":destinationFactory, "
> http://activemq.apache.org/schema/core":destinationInterceptors, "
> http://activemq.apache.org/schema/core":destinationPolicy, "
> http://activemq.apache.org/schema/core":destinations, "
> http://activemq.apache.org/schema/core":ioExceptionHandler, "
> http://activemq.apache.org/schema/core":jmsBridgeConnectors, "
> http://activemq.apache.org/schema/core":jobSchedulerStore, "
> http://activemq.apache.org/schema/core":managementContext, "
> http://activemq.apache.org/schema/core":messageAuthorizationPolicy, "
> http://activemq.apache.org/schema/core":networkConnectorURIs, "
> http://activemq.apache.org/schema/core":networkConnectors, "
> http://activemq.apache.org/schema/core":persistenceAdapter, "
> http://activemq.apache.org/schema/core":persistenceFactory, "
> http://activemq.apache.org/schema/core":persistenceTaskRunnerFactory, "
> http://activemq.apache.org/schema/core":plugins, "
> http://activemq.apache.org/schema/core":producerSystemUsage, "
> http://activemq.apache.org/schema/core":proxyConnectors, "
> http://activemq.apache.org/schema/core":regionBroker, "
> http://activemq.apache.org/schema/core":services, "
> http://activemq.apache.org/schema/core":shutdownHooks, "
> http://activemq.apache.org/schema/core":sslContext, "
> http://activemq.apache.org/schema/core":systemUsage, "
> http://activemq.apache.org/schema/core":taskRunnerFactory, "
> http://activemq.apache.org/schema/core":tempDataStore, "
> http://activemq.apache.org/schema/core":transportConnectorURIs, "
> http://activemq.apache.org/schema/core":transportConnectors, WC[##other:"
> http://activemq.apache.org/schema/core"]}' is expected.
> at
>
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
> at
>
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
> at
>
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
> 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:131)
> at
>
> org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:530)
> at
>
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:444)
> 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$1.<init>(XBeanBrokerFactory.java:101)
> at
>
> org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:101)
> at
>
> org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:65)
> at
>
> org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)
> at
>
> org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
> at
>
> org.apache.activemq.console.command.StartCommand.startBroker(StartCommand.java:125)
> at
>
> org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:84)
> at
>
> org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
> at
>
> org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:150)
> at
>
> org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
> 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:57)
> at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at org.apache.activemq.console.Main.runTaskClass(Main.java:262)
> at org.apache.activemq.console.Main.main(Main.java:115)
> Caused by: org.xml.sax.SAXParseException; lineNumber: 26; columnNumber: 30;
> cvc-complex-type.2.4.a: Invalid content was found starting with element
> 'simpleAuthenticationPlugin'. One of '{"
> http://activemq.apache.org/schema/core":adminView, "
> http://activemq.apache.org/schema/core":brokerContext, "
> http://activemq.apache.org/schema/core":consumerSystemUsage, "
> http://activemq.apache.org/schema/core":destinationFactory, "
> http://activemq.apache.org/schema/core":destinationInterceptors, "
> http://activemq.apache.org/schema/core":destinationPolicy, "
> http://activemq.apache.org/schema/core":destinations, "
> http://activemq.apache.org/schema/core":ioExceptionHandler, "
> http://activemq.apache.org/schema/core":jmsBridgeConnectors, "
> http://activemq.apache.org/schema/core":jobSchedulerStore, "
> http://activemq.apache.org/schema/core":managementContext, "
> http://activemq.apache.org/schema/core":messageAuthorizationPolicy, "
> http://activemq.apache.org/schema/core":networkConnectorURIs, "
> http://activemq.apache.org/schema/core":networkConnectors, "
> http://activemq.apache.org/schema/core":persistenceAdapter, "
> http://activemq.apache.org/schema/core":persistenceFactory, "
> http://activemq.apache.org/schema/core":persistenceTaskRunnerFactory, "
> http://activemq.apache.org/schema/core":plugins, "
> http://activemq.apache.org/schema/core":producerSystemUsage, "
> http://activemq.apache.org/schema/core":proxyConnectors, "
> http://activemq.apache.org/schema/core":regionBroker, "
> http://activemq.apache.org/schema/core":services, "
> http://activemq.apache.org/schema/core":shutdownHooks, "
> http://activemq.apache.org/schema/core":sslContext, "
> http://activemq.apache.org/schema/core":systemUsage, "
> http://activemq.apache.org/schema/core":taskRunnerFactory, "
> http://activemq.apache.org/schema/core":tempDataStore, "
> http://activemq.apache.org/schema/core":transportConnectorURIs, "
> http://activemq.apache.org/schema/core":transportConnectors, WC[##other:"
> http://activemq.apache.org/schema/core"]}' is expected.
> at
>
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
> at
>
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
> at
>
> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:437)
> at
>
> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
> at
>
> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:325)
> at
>
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:453)
> at
>
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3232)
> at
>
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1791)
> at
>
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:741)
> at
>
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:376)
> at
>
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2717)
> at
>
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
> at
>
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116)
> at
>
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:489)
> at
>
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
> at
>
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
> at
>
> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
> at
>
> com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:237)
> at
>
> com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:300)
> at
>
> org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
> at
>
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
> ... 26 more
> ^]^]
>
>
>
>
> The question is Have I include any jar before start activemq broker?
>
>
> Regards
>

Reply via email to