Insight Remote Support
cancel
Showing results for 
Search instead for 
Did you mean: 

org.postgresql.util.PSQLException:

kewisvijay
Occasional Visitor

org.postgresql.util.PSQLException:

org.postgresql.util.PSQLException:connection refused.check that host name and port are correct and that the postmaster is accepting tcp/ip connections
3 REPLIES
Witron_1
Advisor

Re: org.postgresql.util.PSQLException:

how does this error occur?
Do you have problems connecting to the webUI of WEBES 5.6 ???
Witron_1
Advisor

Re: org.postgresql.util.PSQLException:

I have the same issue with PostgreSQL

Spoke to our HP ASCE, he told me HP has numerous issues with WEBES 5.6 and Postgre

they advised to uninstall WEBES in RSSWM, using the WEBES cleanup tool (found on WEBES website) afterwards, which will clean the registry and try a new install

If this does not sort this out, they advised me to collect all relevant logs for analyzing

Keep you informed

Witron_1
Advisor

Re: org.postgresql.util.PSQLException:

HP ASCE was not able to help with provided tools
So I went through all logs and found a workaround to fix it:
Problem is, that Postgre SQL is not installed properly. you can check this as you will not find any postgres.exe processes running.
WEBES install log will report:

Proceeding with WEBES 5.6 Installation..."
"PostgreSQL Registry Key=""HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-8.3" /v Version
"PostgreSQL Version=8.3"
"PostgreSQL 8.3 is Found on this system. The PostgreSQL 8.3 Installation is skipped..."
"Postgre SQL 8.3 installed on this system was not installed during previous WEBES installations..."
"Postgre SQL 8.3 is already found installed on this Server. The existing Postgre SQL install has not been carried out by WEBES."
"WEBES 5.6 requires Postgre SQL 8.3 for its functioning. Please follow the below mentioned instructions to create the WEBES Databases and enable WEBES Functionality. "
"1. Edit the following line in the file in C:\Program Files\HP\CM\Installers\WEBES\CreateWEBESDBs.bat. set PGPASSWORD=Webe$rules8552 .Replace Webe$rules8552 with the super password used during Postgre SQL Installation. "
"2. Execute C:\Program Files\HP\CM\Installers\WEBES\CreateWEBESDBs.bat"
"3. net Start Desta_Service "
PostgreSQL Data Directory PATH Query=C:\WINDOWS\system32\reg.exe QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-8.3" /v Version
"PostgreSQL Data Directory ="
PSQLCMD PATH Query=C:\WINDOWS\system32\reg.exe QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-8.3" /v "Base Directory"
"PSQLCMD PATH VALUE =C:\Program Files/PostgreSQL/8.3\bin\psql"
"Now running CreateWEBESDBs.bat for creating the WEBES databases..."
"The destadb database is not created"
"The ed database is not created"
"The me database is not created"
"The wbemdb database is not created"


The logs advises to follow steps 1 to 3. Well, the password is correct, so there is no need to change it. Once you will execute CREATEWEBESDBS.bat (as advised in the log) you will receive another error, indicating "-h" is not recognized as an internal command. Another logical error from HP as they have forgotten to provide the correct parameters.
So you have to execute CREATEWEBESDBS.bat like follows:

createWEBESDBs.bat "C:\Program Files/PostgreSQL/8.3\bin\psql"

Then the batch is executed, but comes back with the following errors:

C:\Program Files\HP\CM\Installers\WEBES>rem
C:\Program Files\HP\CM\Installers\WEBES>rem Now logging to Postgre SQL. And crea
ting the required databases...
C:\Program Files\HP\CM\Installers\WEBES>rem
C:\Program Files\HP\CM\Installers\WEBES>set PGPORT=7950
C:\Program Files\HP\CM\Installers\WEBES>set PGPASSWORD=Webe$rules8552
C:\Program Files\HP\CM\Installers\WEBES>"C:\Program Files/PostgreSQL/8.3\bin\psq
l" -h localhost -p 7950 -U postgres -c "CREATE ROLE ""WEBES"" WITH SUPERUSER LOG
IN PASSWORD 'Webe$rules8552' CREATEDB";
psql: could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" and accepting
TCP/IP connections on port 7950?
C:\Program Files\HP\CM\Installers\WEBES>"C:\Program Files/PostgreSQL/8.3\bin\psq
l" -h localhost -p 7950 -U postgres -c "DROP DATABASE IF EXISTS destadb";
psql: could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" and accepting
TCP/IP connections on port 7950?


And so on...

So when verifying within netstat, you will see no listening port 7950, so the above script cannot execute successfully and your setup will not work:

These steps will fix this issue finally:
1.execute POSTGRESQL.EXE within C:\Program Files\HP\CM\Installers\WEBES
2.POSTGRESQL.EXE will report a found installation configured with port 7950 , which will be updated
3.Provide the password "Webe$rules8552" as found in WEBES InstallLog and finish the installation.
4. check, if port 7950 is now LISTENING in netstat
5. If so, continue with
cmd>
cd "C:\Program Files\HP\CM\Installers\WEBES"
C:\Program Files\HP\CM\Installers\WEBES>createWEBESDBs.bat "C:\Program Files/PostgreSQL/8.3\bin\psql"
the batch file is now executing without errors
6. Reboot server and log on to WEBES UI