Re: Debug the Java broker using Idea
On Wed, Jun 18, 2008 at 4:52 AM, lahiru gunathilake <[EMAIL PROTECTED]> wrote: > Ok I will try, I think you are telling me to change the variables in the > code rather changing those variables in the bashrc. Ah, .bashrc won't be picked up, those are set by qpid-server which pulls them from the environment. You to set them as system properties. I often find it helpful to use -run:print-command in qpid-server to get the full commandline and then paste that into my launcher. - Aidan -- aim/y!:aidans42 g:[EMAIL PROTECTED] http://aidan.skinner.me.uk/ "We belong to nobody and nobody belongs to us. We don't even belong to each other."
RE: Debug the Java broker using Idea
Hi Lahiru,
Do you know the line number where the problem occurred?
Or is that the stacktrace below?
Best regards,
Wai Yang
>hi Wai,
>Thanks Wai and I found the axact main class and now know what's going
on.
>On Tue, Jun 17, 2008 at 7:39 PM, Wai Yang Yap <[EMAIL PROTECTED]>
wrote:
>> Hi Lahiru,
>>
>> It seems that it cannot create the directory log with the files
>> alert.log and qpid.log. Can you create the directory and possibly the
>> rights to directory to create the files?
>Yep I did that and now it gives me an error about log4j.
>Also at the end it is giving you an error "Property ${QPID_HOME} has
not
>> been set". Maybe you have to add this to your path.
>Did this but still giving me that exception. :-(
>This exception is thrown inside the log4j class and I couldn't find
what is
>the issue.
===
2008-06-18 09:16:47,449 ERROR [main] server.Main (Main.java:206) - Error
configuring message broker:
org.apache.commons.configuration.ConfigurationException: Property
${QPID_HOME} has not been set
org.apache.commons.configuration.ConfigurationException: Property
${QPID_HOME} has not been set
at
org.apache.qpid.server.security.auth.database.ConfigurationFilePrincipal
DatabaseManager.initialisePrincipalDatabase(ConfigurationFilePrincipalDa
tabaseManager.java:159)
at
org.apache.qpid.server.security.auth.database.ConfigurationFilePrincipal
DatabaseManager.initialisePrincipalDatabases(ConfigurationFilePrincipalD
atabaseManager.java:88)
at
org.apache.qpid.server.security.auth.database.ConfigurationFilePrincipal
DatabaseManager.(ConfigurationFilePrincipalDatabaseManager.java:56
)
at
org.apache.qpid.server.registry.ConfigurationFileApplicationRegistry.ini
tialise(ConfigurationFileApplicationRegistry.java:112)
at
org.apache.qpid.server.registry.ApplicationRegistry.initialise(Applicati
onRegistry.java:97)
at
org.apache.qpid.server.registry.ApplicationRegistry.initialise(Applicati
onRegistry.java:85)
at org.apache.qpid.server.Main.startup(Main.java:263)
at org.apache.qpid.server.Main.execute(Main.java:195)
at org.apache.qpid.server.Main.(Main.java:95)
at org.apache.qpid.server.Main.main(Main.java:457)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Caused by: org.apache.qpid.configuration.PropertyException: Property
${QPID_HOME} has not been set
at
org.apache.qpid.configuration.PropertyUtils.replaceProperties(PropertyUt
ils.java:83)
at
org.apache.qpid.server.security.auth.database.ConfigurationFilePrincipal
DatabaseManager.initialisePrincipalDatabase(ConfigurationFilePrincipalDa
tabaseManager.java:149)
... 14 more
Can anybody help me.
Regards
lahiru
>
>
> Best regards
>
> Wai Yang
>
> -Original Message-
> From: lahiru gunathilake [mailto:[EMAIL PROTECTED]
> Sent: dinsdag 17 juni 2008 16:04
> To: [email protected]
> Subject: Debug the Java broker using Idea
>
> hi Devs,
>
> I want to debug the broker using Idea and here's what I did,
>
> 1. I ran mvn idea:idea to build idea project and open the project in
> idea
> and build it using idea.
> 2. It builds successfully but there are some Warnings. And now I want
to
> start the broker and debug using idea. But I couldn't find what is
the
> main
> file to run it.
> 3. I found there's a main file in this location
> luster/src/main/java/org/apache/qpid/server/cluster/Main.java Is that
> the
> main file you are running when we run the script qpid-server script.
> 4. When I run that file it gives this message
> File etc/config.xml could not be found. Check the file exists and is
> readable.
> Note: QPID_HOME is not set. (But i have already set the QPID_HOME
> environment variable. (I'm successfully running the broker in
> console).So I
> change the code and hardcoded the QpidHome variable. And it throws an
> Exception like this.
>
> ==
> log4j:ERROR setFile(null,false) call failed.
> java.io.FileNotFoundException: /log/alert.log (No such file or
> directory)
>at java.io.FileOutputStream.open(Native Method)
>at java.io.FileOutputStream.(FileOutputStream.java:179)
>at java.io.FileOutputStream.(FileOutputStream.java:102)
>at org.apache.log4j.FileAppender.setFile(FileAppender.java:289)
>at
> org.apache.log4j.FileAppender.activateOptions(FileAppender.java:163)
>at
>
org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:256)
>at
>
org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:
> 220)
>at
>
org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfig
Re: Debug the Java broker using Idea
Hi Marnie, In this location there are some instruction which I used to import in to Idea. http://cwiki.apache.org/qpid/qpid-java-build-how-to.html Are there any documents to read on how to do this. Regards Lahiru On Tue, Jun 17, 2008 at 8:36 PM, Marnie McCormack < [EMAIL PROTECTED]> wrote: > Our wiki has a getting started guide which talks about these vars etc - > have > a look if you don't get it working. > > Bfn, > Marnie > > > On 6/17/08, Aidan Skinner <[EMAIL PROTECTED]> wrote: > > > > On Tue, Jun 17, 2008 at 3:03 PM, lahiru gunathilake <[EMAIL PROTECTED]> > > wrote: > > > > > 3. I found there's a main file in this location > > > luster/src/main/java/org/apache/qpid/server/cluster/Main.java Is that > the > > > main file you are running when we run the script qpid-server script. > > > > Don't use cluster it's old and crufty, you want > > broker/src/main/org/apache/qpid/server/Main.java > > > > You'll want to set QPID_HOME and QPID_WORK appropriately as well. > > > > - Aidan > > -- > > aim/y!:aidans42 g:[EMAIL PROTECTED] <[EMAIL PROTECTED]>< > [EMAIL PROTECTED] <[EMAIL PROTECTED]>> > > http://aidan.skinner.me.uk/ > > "We belong to nobody and nobody belongs to us. We don't even belong to > > each other." > > >
Re: Debug the Java broker using Idea
HI Aidan, On Tue, Jun 17, 2008 at 8:11 PM, Aidan Skinner <[EMAIL PROTECTED]> wrote: > On Tue, Jun 17, 2008 at 3:03 PM, lahiru gunathilake <[EMAIL PROTECTED]> > wrote: > > > 3. I found there's a main file in this location > > luster/src/main/java/org/apache/qpid/server/cluster/Main.java Is that the > > main file you are running when we run the script qpid-server script. > > Don't use cluster it's old and crufty, you want > broker/src/main/org/apache/qpid/server/Main.java > > You'll want to set QPID_HOME and QPID_WORK appropriately as well. > Ok I will try, I think you are telling me to change the variables in the code rather changing those variables in the bashrc. Regs lahiru > > - Aidan > -- > aim/y!:aidans42 g:[EMAIL PROTECTED] <[EMAIL PROTECTED]> > http://aidan.skinner.me.uk/ > "We belong to nobody and nobody belongs to us. We don't even belong to > each other." >
Re: Debug the Java broker using Idea
hi Wai,
Thanks Wai and I found the axact main class and now know what's going on.
On Tue, Jun 17, 2008 at 7:39 PM, Wai Yang Yap <[EMAIL PROTECTED]> wrote:
> Hi Lahiru,
>
> It seems that it cannot create the directory log with the files
> alert.log and qpid.log. Can you create the directory and possibly the
> rights to directory to create the files?
Yep I did that and now it gives me an error about log4j.
Also at the end it is giving you an error "Property ${QPID_HOME} has not
> been set". Maybe you have to add this to your path.
Did this but still giving me that exception. :-(
This exception is thrown inside the log4j class and I couldn't find what is
the issue.
===
2008-06-18 09:16:47,449 ERROR [main] server.Main (Main.java:206) - Error
configuring message broker:
org.apache.commons.configuration.ConfigurationException: Property
${QPID_HOME} has not been set
org.apache.commons.configuration.ConfigurationException: Property
${QPID_HOME} has not been set
at
org.apache.qpid.server.security.auth.database.ConfigurationFilePrincipalDatabaseManager.initialisePrincipalDatabase(ConfigurationFilePrincipalDatabaseManager.java:159)
at
org.apache.qpid.server.security.auth.database.ConfigurationFilePrincipalDatabaseManager.initialisePrincipalDatabases(ConfigurationFilePrincipalDatabaseManager.java:88)
at
org.apache.qpid.server.security.auth.database.ConfigurationFilePrincipalDatabaseManager.(ConfigurationFilePrincipalDatabaseManager.java:56)
at
org.apache.qpid.server.registry.ConfigurationFileApplicationRegistry.initialise(ConfigurationFileApplicationRegistry.java:112)
at
org.apache.qpid.server.registry.ApplicationRegistry.initialise(ApplicationRegistry.java:97)
at
org.apache.qpid.server.registry.ApplicationRegistry.initialise(ApplicationRegistry.java:85)
at org.apache.qpid.server.Main.startup(Main.java:263)
at org.apache.qpid.server.Main.execute(Main.java:195)
at org.apache.qpid.server.Main.(Main.java:95)
at org.apache.qpid.server.Main.main(Main.java:457)
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:585)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Caused by: org.apache.qpid.configuration.PropertyException: Property
${QPID_HOME} has not been set
at
org.apache.qpid.configuration.PropertyUtils.replaceProperties(PropertyUtils.java:83)
at
org.apache.qpid.server.security.auth.database.ConfigurationFilePrincipalDatabaseManager.initialisePrincipalDatabase(ConfigurationFilePrincipalDatabaseManager.java:149)
... 14 more
Can anybody help me.
Regards
lahiru
>
>
> Best regards
>
> Wai Yang
>
> -Original Message-
> From: lahiru gunathilake [mailto:[EMAIL PROTECTED]
> Sent: dinsdag 17 juni 2008 16:04
> To: [email protected]
> Subject: Debug the Java broker using Idea
>
> hi Devs,
>
> I want to debug the broker using Idea and here's what I did,
>
> 1. I ran mvn idea:idea to build idea project and open the project in
> idea
> and build it using idea.
> 2. It builds successfully but there are some Warnings. And now I want to
> start the broker and debug using idea. But I couldn't find what is the
> main
> file to run it.
> 3. I found there's a main file in this location
> luster/src/main/java/org/apache/qpid/server/cluster/Main.java Is that
> the
> main file you are running when we run the script qpid-server script.
> 4. When I run that file it gives this message
> File etc/config.xml could not be found. Check the file exists and is
> readable.
> Note: QPID_HOME is not set. (But i have already set the QPID_HOME
> environment variable. (I'm successfully running the broker in
> console).So I
> change the code and hardcoded the QpidHome variable. And it throws an
> Exception like this.
>
> ==
> log4j:ERROR setFile(null,false) call failed.
> java.io.FileNotFoundException: /log/alert.log (No such file or
> directory)
>at java.io.FileOutputStream.open(Native Method)
>at java.io.FileOutputStream.(FileOutputStream.java:179)
>at java.io.FileOutputStream.(FileOutputStream.java:102)
>at org.apache.log4j.FileAppender.setFile(FileAppender.java:289)
>at
> org.apache.log4j.FileAppender.activateOptions(FileAppender.java:163)
>at
> org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:256)
>at
> org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:
> 220)
>at
> org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.
> java:150)
>at
> org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigur
> ator.java:163)
>at
> org.apache.log4j.xml.DOMC
Re: Debug the Java broker using Idea
Our wiki has a getting started guide which talks about these vars etc - have a look if you don't get it working. Bfn, Marnie On 6/17/08, Aidan Skinner <[EMAIL PROTECTED]> wrote: > > On Tue, Jun 17, 2008 at 3:03 PM, lahiru gunathilake <[EMAIL PROTECTED]> > wrote: > > > 3. I found there's a main file in this location > > luster/src/main/java/org/apache/qpid/server/cluster/Main.java Is that the > > main file you are running when we run the script qpid-server script. > > Don't use cluster it's old and crufty, you want > broker/src/main/org/apache/qpid/server/Main.java > > You'll want to set QPID_HOME and QPID_WORK appropriately as well. > > - Aidan > -- > aim/y!:aidans42 g:[EMAIL PROTECTED] <[EMAIL PROTECTED]> > http://aidan.skinner.me.uk/ > "We belong to nobody and nobody belongs to us. We don't even belong to > each other." >
Re: Debug the Java broker using Idea
On Tue, Jun 17, 2008 at 3:03 PM, lahiru gunathilake <[EMAIL PROTECTED]> wrote: > 3. I found there's a main file in this location > luster/src/main/java/org/apache/qpid/server/cluster/Main.java Is that the > main file you are running when we run the script qpid-server script. Don't use cluster it's old and crufty, you want broker/src/main/org/apache/qpid/server/Main.java You'll want to set QPID_HOME and QPID_WORK appropriately as well. - Aidan -- aim/y!:aidans42 g:[EMAIL PROTECTED] http://aidan.skinner.me.uk/ "We belong to nobody and nobody belongs to us. We don't even belong to each other."
RE: Debug the Java broker using Idea
Hi Lahiru,
It seems that it cannot create the directory log with the files
alert.log and qpid.log. Can you create the directory and possibly the
rights to directory to create the files?
Also at the end it is giving you an error "Property ${QPID_HOME} has not
been set". Maybe you have to add this to your path.
Best regards,
Wai Yang
-Original Message-
From: lahiru gunathilake [mailto:[EMAIL PROTECTED]
Sent: dinsdag 17 juni 2008 16:04
To: [email protected]
Subject: Debug the Java broker using Idea
hi Devs,
I want to debug the broker using Idea and here's what I did,
1. I ran mvn idea:idea to build idea project and open the project in
idea
and build it using idea.
2. It builds successfully but there are some Warnings. And now I want to
start the broker and debug using idea. But I couldn't find what is the
main
file to run it.
3. I found there's a main file in this location
luster/src/main/java/org/apache/qpid/server/cluster/Main.java Is that
the
main file you are running when we run the script qpid-server script.
4. When I run that file it gives this message
File etc/config.xml could not be found. Check the file exists and is
readable.
Note: QPID_HOME is not set. (But i have already set the QPID_HOME
environment variable. (I'm successfully running the broker in
console).So I
change the code and hardcoded the QpidHome variable. And it throws an
Exception like this.
==
log4j:ERROR setFile(null,false) call failed.
java.io.FileNotFoundException: /log/alert.log (No such file or
directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.(FileOutputStream.java:179)
at java.io.FileOutputStream.(FileOutputStream.java:102)
at org.apache.log4j.FileAppender.setFile(FileAppender.java:289)
at
org.apache.log4j.FileAppender.activateOptions(FileAppender.java:163)
at
org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:256)
at
org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:
220)
at
org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.
java:150)
at
org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigur
ator.java:163)
at
org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMCon
figurator.java:425)
at
org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:
345)
at
org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:827)
at
org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:71
2)
at
org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:60
4)
at
org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:733)
at org.apache.qpid.server.Main.configureLogging(Main.java:512)
at org.apache.qpid.server.Main.startup(Main.java:252)
at org.apache.qpid.server.Main.execute(Main.java:195)
at org.apache.qpid.server.Main.(Main.java:95)
at org.apache.qpid.server.Main.main(Main.java:456)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
log4j:ERROR setFile(null,false) call failed.
java.io.FileNotFoundException: /log/qpid.log (No such file or directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.(FileOutputStream.java:179)
at java.io.FileOutputStream.(FileOutputStream.java:102)
at org.apache.log4j.FileAppender.setFile(FileAppender.java:289)
at
org.apache.log4j.FileAppender.activateOptions(FileAppender.java:163)
at
org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:256)
at
org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:
220)
at
org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.
java:150)
at
org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigur
ator.java:163)
at
org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMCon
figurator.java:425)
at
org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:394)
at
org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:829)
at
org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:71
2)
at
org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:60
4)
at
org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:733)
at org.apache.qpid.server.Main.configureLogging(Main.java:512)
at org.apache.qpid.server.Main.startup(Main.java:252)
at org.apache.qpid.server.Main.execute(Main.java:195)
at org.apache.qpid.server.Main.(Main.java:95)
at org.apach
