You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by "Wright, Peter" <Pe...@six-group.com> on 2012/10/31 15:06:49 UTC

ActiveMQ multiple instances: start problems when passing config file

Hi,

I'm currently to migrating from IBM-WMQ to activemq.
On WMQ I have a number of separate queue managers
to separate the applications from each other
(so possible problems in one queue manager do not affect
other applications).

On activemq (5.7.0) I therefore want to configure multiple
broker instances on my linux server running SLES 11.
Q1: any disadvantages in this approach with activemq?

I'm able to create the instances, but if I try to start them
with the config file argument, then errors are issued (see further below).
If I start them without the config file argument, it seems to work OK, but
Q2: am I missing out on configuration options?

It also appears to me that the two files created at the start are never used:
- config file "/export/home/mqm/.activemqrc-instance-INSTANCE1" created by the setup command
- softlink "/export/home/mqm/activeMQ/apache-activemq-5.7.0/bin/activemq-instance-INSTANCE1"
Q3: Are these two files needed? Am I overlooking something?

Thanks for any help,

Best regards,
Peter

=========================================

Actions taken
=============

# 1. Move to the activeMQ root directory
% cd /export/home/mqm/activeMQ/apache-activemq-5.7.0

# 2. Create the instances:
# 2a. INSTANCE1
% bin/activemq create INSTANCE1
% bin/activemq setup /export/home/mqm/.activemqrc-instance-INSTANCE1
% ln -s activemq bin/activemq-instance-INSTANCE1

# 2b. INSTANCE2
% bin/activemq create INSTANCE2
% bin/activemq setup /export/home/mqm/.activemqrc-instance-INSTANCE2
% ln -s activemq bin/activemq-instance-INSTANCE2

# 3. Set unique ports for the instances in the conf/activemq.xml and conf/jetty.xml files
#    created by the "create" command above
#    i.e. in /export/home/mqm/activeMQ/apache-activemq-5.7.0
./INSTANCE1/conf/activemq.xml: <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
./INSTANCE1/conf/jetty.xml: <property name="port" value="8161" />
./INSTANCE2/conf/activemq.xml: <transportConnector name="openwire" uri="tcp://0.0.0.0:61626"/>
./INSTANCE2/conf/jetty.xml: <property name="port" value="8162" />

# 3. Start the instances

# 3a. Start without passing the config file: works correctly
% ./INSTANCE1/bin/INSTANCE1 start
% ./INSTANCE1/bin/INSTANCE2 start

# 3b. Start by passing the config file: errors "Invalid broker URI, no scheme specified" are issued(!)
% ./INSTANCE1/bin/INSTANCE1 start /export/home/mqm/.activemqrc-instance-INSTANCE1
% ./INSTANCE1/bin/INSTANCE2 start /export/home/mqm/.activemqrc-instance-INSTANCE2


Error messages from Start command
=================================
INFO: Using default configuration
(you can configure options in one of these file: /etc/default/activemq /export/home/mqm/.activemqrc)

INFO: Invoke the following command to create a configuration file
/export/home/mqm/activeMQ/apache-activemq-5.7.0/bin/activemq setup [ /etc/default/activemq | /export/home/mqm/.activemqrc ]

INFO: Using java '/usr/java/jdk1.6.0_27/bin/java'
Java Runtime: Sun Microsystems Inc. 1.6.0_27 /usr/java/jdk1.6.0_27/jre
  Heap sizes: current=1004928k  free=999683k  max=1004928k
    JVM args: -Xms1G -Xmx1G -Djava.util.logging.config.file=logging.properties -Dactivemq.classpath=/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/conf; -Dactivemq.home=/export/home/mqm/activeMQ/apache-activemq-5.7.0 -Dactivemq.base=/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1 -Dactivemq.conf=/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/conf -Dactivemq.data=/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/data
Extensions classpath:
  [/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/lib,/export/home/mqm/activeMQ/apache-activemq-5.7.0/lib,/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/lib/camel,/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/lib/optional,/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/lib/web,/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/lib/extra,/export/home/mqm/activeMQ/apache-activemq-5.7.0/lib/camel,/export/home/mqm/activeMQ/apache-activemq-5.7.0/lib/optional,/export/home/mqm/activeMQ/apache-activemq-5.7.0/lib/web,/export/home/mqm/activeMQ/apache-activemq-5.7.0/lib/extra]
ACTIVEMQ_HOME: /export/home/mqm/activeMQ/apache-activemq-5.7.0
ACTIVEMQ_BASE: /export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1
ACTIVEMQ_CONF: /export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/conf
ACTIVEMQ_DATA: /export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/data
Loading message broker from: /export/home/mqm/.activemqrc-instance-INSTANCE1
ERROR: java.lang.RuntimeException: Failed to execute start task. Reason: java.lang.IllegalArgumentException: Invalid broker URI, no scheme specified: /export/home/mqm/.activemqrc-instance-INSTANCE1
java.lang.RuntimeException: Failed to execute start task. Reason: java.lang.IllegalArgumentException: Invalid broker URI, no scheme specified: /export/home/mqm/.activemqrc-instance-INSTANCE1
        at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:98)
        at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
        at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:148)
        at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
        at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:90)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.activemq.console.Main.runTaskClass(Main.java:262)
        at org.apache.activemq.console.Main.main(Main.java:115)
Caused by: java.lang.IllegalArgumentException: Invalid broker URI, no scheme specified: /export/home/mqm/.activemqrc-instance-INSTANCE1
        at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:68)
        at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
        at org.apache.activemq.console.command.StartCommand.startBroker(StartCommand.java:115)
        at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:91)
        ... 10 more
ERROR: java.lang.Exception: java.lang.IllegalArgumentException: Invalid broker URI, no scheme specified: /export/home/mqm/.activemqrc-instance-INSTANCE1
java.lang.Exception: java.lang.IllegalArgumentException: Invalid broker URI, no scheme specified: /export/home/mqm/.activemqrc-instance-INSTANCE1
        at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:99)
        at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
        at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:148)
        at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
        at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:90)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.activemq.console.Main.runTaskClass(Main.java:262)
        at org.apache.activemq.console.Main.main(Main.java:115)
Caused by: java.lang.IllegalArgumentException: Invalid broker URI, no scheme specified: /export/home/mqm/.activemqrc-instance-INSTANCE1
        at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:68)
        at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
        at org.apache.activemq.console.command.StartCommand.startBroker(StartCommand.java:115)
        at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:91)
        ... 10 more



The content of this e-mail is intended only for the confidential use of the person addressed. 
If you are not the intended recipient, please notify the sender and delete this email immediately.
Thank you.

Re: ActiveMQ multiple instances: start problems when passing config file

Posted by Christian Posta <ch...@gmail.com>.
>
> Maybe it would be an idea to improve the description about running multiple
> instances
> in the shell script web page
> (http://activemq.apache.org/unix-shell-script.html).
> - "create" command (is currently not even mentioned)
> - "start" command e.g. ./INSTANCE1/bin/INSTANCE1 start



Done. Might take an hour or two for the changes to propagate.




On Mon, Nov 5, 2012 at 2:15 AM, Peter Wright <pe...@six-group.com>wrote:

> Thanks for the feedback. That suits me fine. I'll just start each instance
> with the command:
> ./INSTANCE1/bin/INSTANCE1 start
>
> This also means that the only necessary step is the "create" command
> % bin/activemq create INSTANCE1
>
> and the other two steps are not required:
> % bin/activemq setup /export/home/mqm/.activemqrc-instance-INSTANCE1
> % ln -s activemq bin/activemq-instance-INSTANCE1
> as these two files are never used.
>
> Maybe it would be an idea to improve the description about running multiple
> instances
> in the shell script web page
> (http://activemq.apache.org/unix-shell-script.html).
> - "create" command (is currently not even mentioned)
> - "start" command e.g. ./INSTANCE1/bin/INSTANCE1 start
>
> Best regards,
> Peter
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-multiple-instances-start-problems-when-passing-config-file-tp4658532p4658762.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta

Re: ActiveMQ multiple instances: start problems when passing config file

Posted by Peter Wright <pe...@six-group.com>.
Thanks for the feedback. That suits me fine. I'll just start each instance
with the command:
./INSTANCE1/bin/INSTANCE1 start

This also means that the only necessary step is the "create" command
% bin/activemq create INSTANCE1

and the other two steps are not required:
% bin/activemq setup /export/home/mqm/.activemqrc-instance-INSTANCE1
% ln -s activemq bin/activemq-instance-INSTANCE1
as these two files are never used.

Maybe it would be an idea to improve the description about running multiple
instances
in the shell script web page
(http://activemq.apache.org/unix-shell-script.html).
- "create" command (is currently not even mentioned)
- "start" command e.g. ./INSTANCE1/bin/INSTANCE1 start

Best regards,
Peter




--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-multiple-instances-start-problems-when-passing-config-file-tp4658532p4658762.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ multiple instances: start problems when passing config file

Posted by Gary Tully <ga...@gmail.com>.
cat /export/home/mqm/.activemqrc-instance-INSTANCE1
and note that it is not an xml configuration file.

the xml config is the file you edited in #3

and is the file picked up by default.
If you want to reference that file, use some thing like:
> % ./INSTANCE1/bin/INSTANCE1 start xbean:conf/activemq.xml


On 2 November 2012 11:08, Peter Wright <pe...@six-group.com> wrote:
> Still getting errors (see output below):
>
> % ./INSTANCE1/bin/INSTANCE1 start
> xbean:/export/home/mqm/.activemqrc-instance-INSTANCE1
> INFO: Using default configuration
> (you can configure options in one of these file: /etc/default/activemq
> /export/home/mqm/.activemqrc)
>
> INFO: Invoke the following command to create a configuration file
> /export/home/mqm/activeMQ/apache-activemq-5.7.0/bin/activemq setup [
> /etc/default/activemq | /export/home/mqm/.activemqrc ]
>
> INFO: Using java '/usr/java/jdk1.6.0_27/bin/java'
> Java Runtime: Sun Microsystems Inc. 1.6.0_27 /usr/java/jdk1.6.0_27/jre
>   Heap sizes: current=1004928k  free=999683k  max=1004928k
>     JVM args: -Xms1G -Xmx1G
> -Djava.util.logging.config.file=logging.properties
> -Dactivemq.classpath=/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/conf;
> -Dactivemq.home=/export/home/mqm/activeMQ/apache-activemq-5.7.0
> -Dactivemq.base=/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1
> -Dactivemq.conf=/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/conf
> -Dactivemq.data=/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/data
> Extensions classpath:
>
> [/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/lib,/export/home/mqm/activeMQ/apache-activemq-5.7.0/lib,/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/lib/camel,/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/lib/optional,/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/lib/web,/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/lib/extra,/export/home/mqm/activeMQ/apache-activemq-5.7.0/lib/camel,/export/home/mqm/activeMQ/apache-activemq-5.7.0/lib/optional,/export/home/mqm/activeMQ/apache-activemq-5.7.0/lib/web,/export/home/mqm/activeMQ/apache-activemq-5.7.0/lib/extra]
> ACTIVEMQ_HOME: /export/home/mqm/activeMQ/apache-activemq-5.7.0
> ACTIVEMQ_BASE: /export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1
> ACTIVEMQ_CONF:
> /export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/conf
> ACTIVEMQ_DATA:
> /export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/data
> Loading message broker from:
> xbean:/export/home/mqm/.activemqrc-instance-INSTANCE1
>  INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@78ce5b1c:
> startup date [Fri Nov 02 12:03:51 CET 2012]; root of context hierarchy
> ERROR | Failed to load: file
> [/export/home/mqm/.activemqrc-instance-INSTANCE1], reason: Line 1 in XML
> document from file [/export/home/mqm/.activemqrc-instance-INSTANCE1] is
> invalid; nested exception is org.xml.sax.SAXParseException: Content is not
> allowed in prolog.
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
> 1 in XML document from file
> [/export/home/mqm/.activemqrc-instance-INSTANCE1] is invalid; nested
> exception is org.xml.sax.SAXParseException: Content is not allowed in
> prolog.
>         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:130)
>         at
> org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
>         at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
>         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:102)
>         at
> org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:102)
>         at
> org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:66)
>         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:115)
>         at
> org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:91)
>         at
> org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
>         at
> org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:148)
>         at
> org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
>         at
> org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:90)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         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: Content is not allowed in prolog.
>         at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
>         at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1414)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1039)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
>         at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
>         at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
>         at
> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
>         at
> com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:235)
>         at
> com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
>         at
> org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
>         at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
>         ... 26 more
> ERROR: java.lang.RuntimeException: Failed to execute start task. Reason:
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
> 1 in XML document from file
> [/export/home/mqm/.activemqrc-instance-INSTANCE1] is invalid; nested
> exception is org.xml.sax.SAXParseException: Content is not allowed in
> prolog.
> java.lang.RuntimeException: Failed to execute start task. Reason:
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
> 1 in XML document from file
> [/export/home/mqm/.activemqrc-instance-INSTANCE1] is invalid; nested
> exception is org.xml.sax.SAXParseException: Content is not allowed in
> prolog.
>         at
> org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:98)
>         at
> org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
>         at
> org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:148)
>         at
> org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
>         at
> org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:90)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.apache.activemq.console.Main.runTaskClass(Main.java:262)
>         at org.apache.activemq.console.Main.main(Main.java:115)
> Caused by:
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
> 1 in XML document from file
> [/export/home/mqm/.activemqrc-instance-INSTANCE1] is invalid; nested
> exception is org.xml.sax.SAXParseException: Content is not allowed in
> prolog.
>         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:130)
>         at
> org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
>         at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
>         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:102)
>         at
> org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:102)
>         at
> org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:66)
>         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:115)
>         at
> org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:91)
>         ... 10 more
> Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
>         at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
>         at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1414)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1039)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
>         at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
>         at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
>         at
> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
>         at
> com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:235)
>         at
> com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
>         at
> org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
>         at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
>         ... 26 more
> ERROR: java.lang.Exception:
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
> 1 in XML document from file
> [/export/home/mqm/.activemqrc-instance-INSTANCE1] is invalid; nested
> exception is org.xml.sax.SAXParseException: Content is not allowed in
> prolog.
> java.lang.Exception:
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
> 1 in XML document from file
> [/export/home/mqm/.activemqrc-instance-INSTANCE1] is invalid; nested
> exception is org.xml.sax.SAXParseException: Content is not allowed in
> prolog.
>         at
> org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:99)
>         at
> org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
>         at
> org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:148)
>         at
> org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
>         at
> org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:90)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.apache.activemq.console.Main.runTaskClass(Main.java:262)
>         at org.apache.activemq.console.Main.main(Main.java:115)
> Caused by:
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
> 1 in XML document from file
> [/export/home/mqm/.activemqrc-instance-INSTANCE1] is invalid; nested
> exception is org.xml.sax.SAXParseException: Content is not allowed in
> prolog.
>         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:130)
>         at
> org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
>         at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
>         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:102)
>         at
> org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:102)
>         at
> org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:66)
>         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:115)
>         at
> org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:91)
>         ... 10 more
> Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
>         at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
>         at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1414)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1039)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
>         at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
>         at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
>         at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
>         at
> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
>         at
> com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:235)
>         at
> com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
>         at
> org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
>         at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
>         ... 26 more
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-multiple-instances-start-problems-when-passing-config-file-tp4658532p4658649.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
http://redhat.com
http://blog.garytully.com

Re: ActiveMQ multiple instances: start problems when passing config file

Posted by Peter Wright <pe...@six-group.com>.
Still getting errors (see output below):

% ./INSTANCE1/bin/INSTANCE1 start
xbean:/export/home/mqm/.activemqrc-instance-INSTANCE1 
INFO: Using default configuration
(you can configure options in one of these file: /etc/default/activemq
/export/home/mqm/.activemqrc)

INFO: Invoke the following command to create a configuration file
/export/home/mqm/activeMQ/apache-activemq-5.7.0/bin/activemq setup [
/etc/default/activemq | /export/home/mqm/.activemqrc ]

INFO: Using java '/usr/java/jdk1.6.0_27/bin/java'
Java Runtime: Sun Microsystems Inc. 1.6.0_27 /usr/java/jdk1.6.0_27/jre
  Heap sizes: current=1004928k  free=999683k  max=1004928k
    JVM args: -Xms1G -Xmx1G
-Djava.util.logging.config.file=logging.properties
-Dactivemq.classpath=/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/conf;
-Dactivemq.home=/export/home/mqm/activeMQ/apache-activemq-5.7.0
-Dactivemq.base=/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1
-Dactivemq.conf=/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/conf
-Dactivemq.data=/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/data
Extensions classpath:
 
[/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/lib,/export/home/mqm/activeMQ/apache-activemq-5.7.0/lib,/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/lib/camel,/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/lib/optional,/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/lib/web,/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/lib/extra,/export/home/mqm/activeMQ/apache-activemq-5.7.0/lib/camel,/export/home/mqm/activeMQ/apache-activemq-5.7.0/lib/optional,/export/home/mqm/activeMQ/apache-activemq-5.7.0/lib/web,/export/home/mqm/activeMQ/apache-activemq-5.7.0/lib/extra]
ACTIVEMQ_HOME: /export/home/mqm/activeMQ/apache-activemq-5.7.0
ACTIVEMQ_BASE: /export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1
ACTIVEMQ_CONF:
/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/conf
ACTIVEMQ_DATA:
/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/data
Loading message broker from:
xbean:/export/home/mqm/.activemqrc-instance-INSTANCE1
 INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@78ce5b1c:
startup date [Fri Nov 02 12:03:51 CET 2012]; root of context hierarchy
ERROR | Failed to load: file
[/export/home/mqm/.activemqrc-instance-INSTANCE1], reason: Line 1 in XML
document from file [/export/home/mqm/.activemqrc-instance-INSTANCE1] is
invalid; nested exception is org.xml.sax.SAXParseException: Content is not
allowed in prolog.
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
1 in XML document from file
[/export/home/mqm/.activemqrc-instance-INSTANCE1] is invalid; nested
exception is org.xml.sax.SAXParseException: Content is not allowed in
prolog.
        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:130)
        at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
        at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
        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:102)
        at
org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:102)
        at
org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:66)
        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:115)
        at
org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:91)
        at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
        at
org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:148)
        at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
        at
org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:90)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        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: Content is not allowed in prolog.
        at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
        at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
        at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
        at
com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1414)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1039)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
        at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
        at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
        at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
        at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
        at
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:235)
        at
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
        at
org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
        ... 26 more
ERROR: java.lang.RuntimeException: Failed to execute start task. Reason:
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
1 in XML document from file
[/export/home/mqm/.activemqrc-instance-INSTANCE1] is invalid; nested
exception is org.xml.sax.SAXParseException: Content is not allowed in
prolog.
java.lang.RuntimeException: Failed to execute start task. Reason:
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
1 in XML document from file
[/export/home/mqm/.activemqrc-instance-INSTANCE1] is invalid; nested
exception is org.xml.sax.SAXParseException: Content is not allowed in
prolog.
        at
org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:98)
        at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
        at
org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:148)
        at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
        at
org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:90)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.activemq.console.Main.runTaskClass(Main.java:262)
        at org.apache.activemq.console.Main.main(Main.java:115)
Caused by:
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
1 in XML document from file
[/export/home/mqm/.activemqrc-instance-INSTANCE1] is invalid; nested
exception is org.xml.sax.SAXParseException: Content is not allowed in
prolog.
        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:130)
        at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
        at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
        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:102)
        at
org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:102)
        at
org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:66)
        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:115)
        at
org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:91)
        ... 10 more
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
        at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
        at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
        at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
        at
com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1414)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1039)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
        at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
        at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
        at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
        at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
        at
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:235)
        at
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
        at
org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
        ... 26 more
ERROR: java.lang.Exception:
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
1 in XML document from file
[/export/home/mqm/.activemqrc-instance-INSTANCE1] is invalid; nested
exception is org.xml.sax.SAXParseException: Content is not allowed in
prolog.
java.lang.Exception:
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
1 in XML document from file
[/export/home/mqm/.activemqrc-instance-INSTANCE1] is invalid; nested
exception is org.xml.sax.SAXParseException: Content is not allowed in
prolog.
        at
org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:99)
        at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
        at
org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:148)
        at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
        at
org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:90)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.activemq.console.Main.runTaskClass(Main.java:262)
        at org.apache.activemq.console.Main.main(Main.java:115)
Caused by:
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
1 in XML document from file
[/export/home/mqm/.activemqrc-instance-INSTANCE1] is invalid; nested
exception is org.xml.sax.SAXParseException: Content is not allowed in
prolog.
        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:130)
        at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
        at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
        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:102)
        at
org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:102)
        at
org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:66)
        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:115)
        at
org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:91)
        ... 10 more
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
        at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
        at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
        at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
        at
com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1414)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1039)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
        at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
        at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
        at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
        at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
        at
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:235)
        at
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
        at
org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
        ... 26 more




--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-multiple-instances-start-problems-when-passing-config-file-tp4658532p4658649.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ multiple instances: start problems when passing config file

Posted by Dejan Bosanac <de...@nighttale.net>.
Try using

 ./INSTANCE1/bin/INSTANCE1 start
xbean:/export/home/mqm/.activemqrc-instance-INSTANCE1

that should do the trick.

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


On Wed, Oct 31, 2012 at 3:06 PM, Wright, Peter
<Pe...@six-group.com> wrote:
> Hi,
>
> I'm currently to migrating from IBM-WMQ to activemq.
> On WMQ I have a number of separate queue managers
> to separate the applications from each other
> (so possible problems in one queue manager do not affect
> other applications).
>
> On activemq (5.7.0) I therefore want to configure multiple
> broker instances on my linux server running SLES 11.
> Q1: any disadvantages in this approach with activemq?
>
> I'm able to create the instances, but if I try to start them
> with the config file argument, then errors are issued (see further below).
> If I start them without the config file argument, it seems to work OK, but
> Q2: am I missing out on configuration options?
>
> It also appears to me that the two files created at the start are never used:
> - config file "/export/home/mqm/.activemqrc-instance-INSTANCE1" created by the setup command
> - softlink "/export/home/mqm/activeMQ/apache-activemq-5.7.0/bin/activemq-instance-INSTANCE1"
> Q3: Are these two files needed? Am I overlooking something?
>
> Thanks for any help,
>
> Best regards,
> Peter
>
> =========================================
>
> Actions taken
> =============
>
> # 1. Move to the activeMQ root directory
> % cd /export/home/mqm/activeMQ/apache-activemq-5.7.0
>
> # 2. Create the instances:
> # 2a. INSTANCE1
> % bin/activemq create INSTANCE1
> % bin/activemq setup /export/home/mqm/.activemqrc-instance-INSTANCE1
> % ln -s activemq bin/activemq-instance-INSTANCE1
>
> # 2b. INSTANCE2
> % bin/activemq create INSTANCE2
> % bin/activemq setup /export/home/mqm/.activemqrc-instance-INSTANCE2
> % ln -s activemq bin/activemq-instance-INSTANCE2
>
> # 3. Set unique ports for the instances in the conf/activemq.xml and conf/jetty.xml files
> #    created by the "create" command above
> #    i.e. in /export/home/mqm/activeMQ/apache-activemq-5.7.0
> ./INSTANCE1/conf/activemq.xml: <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
> ./INSTANCE1/conf/jetty.xml: <property name="port" value="8161" />
> ./INSTANCE2/conf/activemq.xml: <transportConnector name="openwire" uri="tcp://0.0.0.0:61626"/>
> ./INSTANCE2/conf/jetty.xml: <property name="port" value="8162" />
>
> # 3. Start the instances
>
> # 3a. Start without passing the config file: works correctly
> % ./INSTANCE1/bin/INSTANCE1 start
> % ./INSTANCE1/bin/INSTANCE2 start
>
> # 3b. Start by passing the config file: errors "Invalid broker URI, no scheme specified" are issued(!)
> % ./INSTANCE1/bin/INSTANCE1 start /export/home/mqm/.activemqrc-instance-INSTANCE1
> % ./INSTANCE1/bin/INSTANCE2 start /export/home/mqm/.activemqrc-instance-INSTANCE2
>
>
> Error messages from Start command
> =================================
> INFO: Using default configuration
> (you can configure options in one of these file: /etc/default/activemq /export/home/mqm/.activemqrc)
>
> INFO: Invoke the following command to create a configuration file
> /export/home/mqm/activeMQ/apache-activemq-5.7.0/bin/activemq setup [ /etc/default/activemq | /export/home/mqm/.activemqrc ]
>
> INFO: Using java '/usr/java/jdk1.6.0_27/bin/java'
> Java Runtime: Sun Microsystems Inc. 1.6.0_27 /usr/java/jdk1.6.0_27/jre
>   Heap sizes: current=1004928k  free=999683k  max=1004928k
>     JVM args: -Xms1G -Xmx1G -Djava.util.logging.config.file=logging.properties -Dactivemq.classpath=/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/conf; -Dactivemq.home=/export/home/mqm/activeMQ/apache-activemq-5.7.0 -Dactivemq.base=/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1 -Dactivemq.conf=/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/conf -Dactivemq.data=/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/data
> Extensions classpath:
>   [/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/lib,/export/home/mqm/activeMQ/apache-activemq-5.7.0/lib,/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/lib/camel,/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/lib/optional,/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/lib/web,/export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/lib/extra,/export/home/mqm/activeMQ/apache-activemq-5.7.0/lib/camel,/export/home/mqm/activeMQ/apache-activemq-5.7.0/lib/optional,/export/home/mqm/activeMQ/apache-activemq-5.7.0/lib/web,/export/home/mqm/activeMQ/apache-activemq-5.7.0/lib/extra]
> ACTIVEMQ_HOME: /export/home/mqm/activeMQ/apache-activemq-5.7.0
> ACTIVEMQ_BASE: /export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1
> ACTIVEMQ_CONF: /export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/conf
> ACTIVEMQ_DATA: /export/home/mqm/activeMQ/apache-activemq-5.7.0/INSTANCE1/data
> Loading message broker from: /export/home/mqm/.activemqrc-instance-INSTANCE1
> ERROR: java.lang.RuntimeException: Failed to execute start task. Reason: java.lang.IllegalArgumentException: Invalid broker URI, no scheme specified: /export/home/mqm/.activemqrc-instance-INSTANCE1
> java.lang.RuntimeException: Failed to execute start task. Reason: java.lang.IllegalArgumentException: Invalid broker URI, no scheme specified: /export/home/mqm/.activemqrc-instance-INSTANCE1
>         at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:98)
>         at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
>         at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:148)
>         at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
>         at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:90)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.apache.activemq.console.Main.runTaskClass(Main.java:262)
>         at org.apache.activemq.console.Main.main(Main.java:115)
> Caused by: java.lang.IllegalArgumentException: Invalid broker URI, no scheme specified: /export/home/mqm/.activemqrc-instance-INSTANCE1
>         at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:68)
>         at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
>         at org.apache.activemq.console.command.StartCommand.startBroker(StartCommand.java:115)
>         at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:91)
>         ... 10 more
> ERROR: java.lang.Exception: java.lang.IllegalArgumentException: Invalid broker URI, no scheme specified: /export/home/mqm/.activemqrc-instance-INSTANCE1
> java.lang.Exception: java.lang.IllegalArgumentException: Invalid broker URI, no scheme specified: /export/home/mqm/.activemqrc-instance-INSTANCE1
>         at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:99)
>         at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
>         at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:148)
>         at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
>         at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:90)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.apache.activemq.console.Main.runTaskClass(Main.java:262)
>         at org.apache.activemq.console.Main.main(Main.java:115)
> Caused by: java.lang.IllegalArgumentException: Invalid broker URI, no scheme specified: /export/home/mqm/.activemqrc-instance-INSTANCE1
>         at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:68)
>         at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
>         at org.apache.activemq.console.command.StartCommand.startBroker(StartCommand.java:115)
>         at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:91)
>         ... 10 more
>
>
>
> The content of this e-mail is intended only for the confidential use of the person addressed.
> If you are not the intended recipient, please notify the sender and delete this email immediately.
> Thank you.