The best place to ask programming/development questions, imo. UPDATE: stackoverflow is the *worst* place to *ask* questions (if your first question/comment doesn't get any up-rating/response, then u can't ask anymore questions--ridiculously unrealistic), but a great reference for finding answers.

My Music (Nickleus)


how to install RHQ and create default rhq postgresql database


install postgresql:
sudo apt-get install postgresql
sudo passwd postgres
sudo adduser rhqadmin
su - postgres
psql template1
create database rhq;
psql rhq
create user rhqadmin with password 'mysecretpw';
grant all privileges on database rhq to rhqadmin;

fyi: how to log into the database:
su - rhqadmin
psql -d rhq -U rhqadmin

set RHQ_SERVER_JAVA_HOME in ~/.bashrc:
echo "export RHQ_SERVER_JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64" >> ~/.bashrc
source ~/.bashrc

generate encoded password value for <rhq-install-dir>/bin/ > rhq.server.database.password (line 8):
cd ~/Downloads/rhq-server-4.5.1/bin
chmod +x
./ --dbpassword=mysecretpw

// output
Encoded password: 5190c896b298c0f6d669b731438ce42e331761a902fa3908

paste this encoded value into <rhq-install-dir>/bin/ > rhq.server.database.password (line 8)

NOTE: : DO NOT PUT rhq.autoinstall.enabled=true , leave it as "false"

start rhq server:
./ start

open in web browser:

click the link to continue installation

enter the clear-text db password (not the encoded one)

click "test connection"

click "install server"

username: rhqadmin
password: rhqadmin

change the default password:
administration > users
click "rhqadmin"
change password

[SOLVED] RHQ install error: javax.servlet.ServletException: /start.jsp(245,12) '#{configurationBean.haServer.endpointAddress}' Target Unreachable, 'haServer' returned null

when i clicked "test connection" in the rhq web install interface: http://localhost:7080/installer/welcome.jsf

i got the following jsp error:
javax.servlet.ServletException: /start.jsp(245,12) '#{configurationBean.haServer.endpointAddress}' Target Unreachable, 'haServer' returned null

i found out that this was because i had set:

in <rhq-install-dir>/bin/

*use the default value instead*:


sahi - how to click a span inside a table and match table id using regex

i have an html page rendered by richfaces which made things a little problematic for my sahi script test:

* even though the rich:dataTable had a hardcoded id:
<rich:dataTable id="providerListTA" ...

when the page gets rendered by richfaces, the id looks like this in the rendered html code:

* the table is rendered inside a rich:modalPanel and contains a list of providers to select. inside that table there's a row with a link in the first column that i want to click on
Provider X

the problem is that behind the modalpanel there's a list of price agreements which also contains "Provider X", so the following code doesn't work:

specifying the element number also doesn't work because it will change from user to user, depending on what's in the price agreement list:

so i read the sahi api documentation and found out how to use the DOM relation marker called "_in", together with a regexp that matched only the hardcoded id in the xhtml/jsf code, leaving out the richfaces-appended texts, i.e. "j_id1045:" and ":tb":

_click(_span($transporter_name, _in(_table(/.*providerListTA.*/))));

Provider X is passed into the sahi script method as $transporter_name and the regex part of the code is this:

which means to match an id containing providerListTA with any characters in front or behind it.