Recipe for installing Servoy as Server only - PROBLEMS

I am trying to do the following: installing Servoy without the Developer and without the default database as part of the package (e.g. the database inside the Servoy directory).

I did the following, but it did not work:

  1. I run the Servoy Installer (servoy_installer.jar) with Developer and Database unchecked.

  2. I installed PostgreSQL separately using EDB installer. I created the login role (user) ‘DBA’ and the database ‘servoy_repository’ (to use as the Servoy’s repository/‘repository_server’)

— following recommendations from other posts:
http://www.servoy.com/forum/viewtopic.php?f=11&t=14906) (read Robert’s posts)
http://forum.servoy.com/viewtopic.php?f=11&t=14910#p79779 (read Scott’s posts)

  1. Then I copied the servoy.properties file from an installation of Servoy with the bundled database (see attachment: servoy.properties) into the /application_server directory.

— following instructions from: http://wiki.servoy.com/display/public/D … +databases

I opened the servoy.properties file and commented out the ‘start database engine’ lines because PostgreSQL server was already running, but I left intact the seven defined database server configurations. (I also tried by hard coding the PostgreSQL binary path. See the lines ‘#start database engine (custom installation)’)

  1. Then on the command line in ‘application_server’ I typed: ‘servoy_server.bat –upgradeRepository’. This should have created and populated the repository database (in this case servoy_repository too)

[attachment=1]cmd_upgradeRepository.GIF[/attachment]

  1. Then I clicked on the servoy_server.bat file (to start the Servoy Server)… But, unfortunately, the installation failed. I kept getting the following:

2010-09-27 13:24:37,359 ERROR [main] com.servoy.j2db.util.Debug - Cannot start repository: com.servoy.j2db.persistence.RepositoryException: Error checking repository
2010-09-27 13:24:37,359 ERROR [main] com.servoy.j2db.util.Debug - Do note Servoy server does not start any database!

I really do not understand. The database server is running, the DBA user is there (I tried it with a password and empty password), the servoy_repository database is there with all the necessary CRUD privileges, the servoy.properties seems Ok. (see attachment: servoy.properties).

What can be wrong?

servoy.properties.txt (3.12 KB)

cmd_upgradeRepository.GIF

Is PostgresQL running on port 5432 ? Were the tables from repository created (you can check with pgadmin)? What errors you have in the log (servoy_log.txt)?

Yes, postgresql is using that port (default EDB installation).

About the error, I copied and pasted the error lines (see my comment #5 above)

As for the DB tables, I’ll check tomorrow. I am posting this from my iPhone.

JC

Hi Carlos,

I looked at your servoy.properties file and I think you are missing a couple of properties for each connection:

server.0.maxPreparedStatementsIdle=100
server.0.connectionValidationType=0
server.0.enabled=true
server.0.skipSysTables=false

Also I think you need to use a password in there as well. Yours is blank.
Unless you setup PostgreSQL to trust connections from localhost it won’t accept it without a password.
You can simply put the plain password in the properties file, launch Servoy and when you shutdown the server the properties file should have been rewritten with the encrypted passwords.

Also I don’t see any logging settings. The following lines are in my properties file:

log4j.appender.configservlet=com.servoy.j2db.util.SlidingWindowAppender
log4j.appender.configservlet.layout=com.servoy.j2db.util.Log4JHTMLTableLayout
log4j.appender.configservlet.layout.dateTimeFormat=yyyy-MM-dd HH\:mm
log4j.appender.configservlet.windowSize=1000
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=%%servoy_app_server_dir%%/servoy_log.txt
log4j.appender.file.MaxBackupIndex=1
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d %p [%t] %c - %m%n
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%t] %c - %m%n
log4j.debug=false
log4j.logger.com.servoy.j2db.util.Debug=WARN
log4j.logger.org.apache.wicket=WARN
log4j.rootCategory=WARN, file, configservlet

Hope this helps.

That is a servoy.properties from install, before any init is done, so stuff will be added by Servoy in it.

lvostinar:
That is a servoy.properties from install, before any init is done, so stuff will be added by Servoy in it.

I see. Then if this is the properties file Carlos is using then it’s most likely that the empty passwords are the culprit.
I guess the quick test for this is to see if the tables were created.

You were right, the tables were NOT created. I gave the DBA a password and tried again. From the command line in the application_server directory I entered servoy_server.bat –upgradeRepository. The result was still an error.

2010-09-28 09:38:05,859 ERROR [main] com.servoy.j2db.util.Debug - Cannot upgrade repository: make a backup of your repository and start server with -upgradeRepository flag.
Then I retried as suggested (using the -upgradeRepository flag). It did not work.

This is the new servoy.properties file:

# Number of servers defined in this file
ServerManager.numberOfServers=1

# Definition 1
server.0.serverName=repository_server
server.0.URL=jdbc:postgresql://localhost:5432/servoy_repository
server.0.driver=org.postgresql.Driver
server.0.maxConnectionsActive=10
server.0.maxConnectionsIdle=10
server.0.userName=DBA
server.0.password=password
server.0.schema=<none>
server.0.catalog=<none>

#start database engine (default installation)
#nativeStartupLauncher=%%user.dir%%\\postgres_db\\bin\\pg_ctl|start|-D|database|-l|postgres_db\\postgres_log.txt
#waitForNativeStartup=false
#nativeShutdownLauncher=%%user.dir%%\\postgres_db\\bin\\pg_ctl|stop|-D|database|-l|postgres_db\\postgres_log.txt

#start database engine (custom installation)
#nativeStartupLauncher=C:\\Program Files\\PostgreSQL\\8.4\\bin\\pg_ctl|start|-D|database|-l|postgres_db\\postgres_log.txt
#waitForNativeStartup=false
#nativeShutdownLauncher=C:\\Program Files\\PostgreSQL\\8.4\\bin\\pg_ctl|stop|-D|database|-l|postgres_db\\postgres_log.txt

#this property will change once started first time
servoy.didFirstTimeInit=true

#for use by pdf_forms plugin
pdf_forms_plugin_servername=pdf_forms

#network config
SocketFactory.useTwoWaySocket=true
SocketFactory.useSSL=true
java.rmi.server.hostname=127.0.0.1

What is missing? I was hoping to make a short and sweet recipe for installation of Servoy as a server only. Am I doing something wrong?

JC

Hmm…
Use this:

server.0.URL=jdbc\:postgresql\://localhost\:5432/servoy_repository

ROCLASI:
Hmm…
Use this:

server.0.URL=jdbc\:postgresql\://localhost\:5432/servoy_repository

I see. You escaped the “:”. I tried it. It did not work either :-(

Could this problem has something to do with PostgreSQL?

This is the database definition for the repository:

CREATE DATABASE servoy_repository
WITH OWNER = “DBA”
ENCODING = ‘UTF8’
TABLESPACE = pg_default
LC_COLLATE = ‘English_United States.1252’
LC_CTYPE = ‘English_United States.1252’
CONNECTION LIMIT = -1;

This is the role (user) definition:

CREATE ROLE “DBA” LOGIN
ENCRYPTED PASSWORD ‘md561e33e7936420b86098c440ceb6474c4’
NOSUPERUSER INHERIT CREATEDB CREATEROLE;

These definitions are mostly set by pgAdmin III when creating databases.

I also noticed that the only role selectable in the ‘Privileges’ tab of the pdAdmin/Databases/servoy_repository/ is ‘public’. See the captured image below.

[attachment=0]pg_db_privileges.GIF[/attachment]

Hi JC – You have run into the same confusion as I did recently. In the vocabulary of postgres the word “role” does not, unfortunately, have a single atomic meaning. There are “log-in roles” which would be DBA in your example, and then there are “group roles”. “Public” is a special group role that cannot be created nor deleted (at least it should not be deleted). It is the default group any database will be in.

You right-clicked on servoy_repository in the list and then viewed the Privileges pane. The pane is confusing because at the bottom it offers you the chance to choose “Role”. It sure does seem to indicate that this is where you would apply user rights to the db. In actuality the choices in that “Role” drop-down would be only group roles, both the built-in Public role and any other Group Roles you create on the server. Individual user accounts do not show here.

It is on the “Properties” pane of that window where the Owner is declared.

kazar:
It is on the “Properties” pane of that window where the Owner is declared.

Thank you very much for the clarification. Actually, I declared the owner as you indicated. That was pretty much required while creating the database.

My question now is:

Is the user declared in the servoy.properties file equal to the database’s owner in PostgreSQL? This is what I have:
server.0.userName=DBA
Where DBA is the owner of the servoy_repository database

Do I need to create a Group Role named ‘DBA’?
CORRECTION: I can’t create a group role DBA because already there is the user role DBA.

I did this to make sure that DBA has all of the required privileges:

CREATE DATABASE servoy_repository
WITH OWNER = “DBA”
ENCODING = ‘UTF8’
TABLESPACE = pg_default
LC_COLLATE = ‘English_United States.1252’
LC_CTYPE = ‘English_United States.1252’
CONNECTION LIMIT = 1;
GRANT ALL ON DATABASE servoy_repository TO “DBA”;
GRANT ALL ON DATABASE servoy_repository TO public;

But, it did not work either. I still keep getting the error message:
2010-09-28 14:12:51,812 ERROR [main] com.servoy.j2db.util.Debug - Cannot start repository: com.servoy.j2db.persistence.RepositoryException: Error checking repository
2010-09-28 14:12:51,812 ERROR [main] com.servoy.j2db.util.Debug - Do note Servoy server does not start any database!

I think that what I’ve done is correct. I am just trying to figure out and assemble a recipe of the various steps to ‘install Servoy as Server only’ when using a third party PostgreSQL installation and not the Servoy installer.

Hi Carlos,

Your database setup looks fine. No need to use another group role.
Do you see anything in your PostgreSQL log ? You can check that straight from within PgAdmin by connecting to the database and then select from the menubar > Tools > Server Status.
This will open up a new window with several panes. On the right you see the logfile pane. Set the refresh rate at the top to, lets say, 10 seconds and keep this window open. Now try to run the upgradeRepository procedure again. See if you see any errors in the log.
If not then it very much looks like Servoy doesn’t even start a connection so then you should focus on Servoy instead of PostgreSQL.

Hope this helps.

ROCLASI:
On the right you see the logfile pane. Set the refresh rate at the top to, lets say, 10 seconds and keep this window open. Now try to run the upgradeRepository procedure again. See if you see any errors in the log.
If not then it very much looks like Servoy doesn’t even start a connection so then you should focus on Servoy instead of PostgreSQL.

Done exactly as described. Thank you! This is what I got:

2010-09-28 15:34:12 PDT LOG database system was shut down at 2010-09-28 15:34:07 PDT
2010-09-28 15:34:13 PDT LOG database system is ready to accept connections
2010-09-28 15:34:13 PDT LOG autovacuum launcher started
2010-09-28 15:45:15 PDT LOG could not receive data from client: No connection could be made because the target machine actively refused it.

2010-09-28 15:45:15 PDT LOG unexpected EOF on client connection
2010-09-28 15:46:42 PDT LOG could not receive data from client: No connection could be made because the target machine actively refused it.

2010-09-28 15:46:42 PDT LOG unexpected EOF on client connection

The lines in red and green were logged once I run the upgradeRepository and the upgradeRepository flag procedures respectively.

I think that Servoy is starting a connection but then it refused it. Correct? What do you think it’s going on?

JC

jcarlos:
The lines in red and green were logged once I run the upgradeRepository and the upgradeRepository flag procedures respectively.

Not sure what you mean with that. You used 2 different upgrade commands ?

jcarlos:
I think that Servoy is starting a connection but then it refused it. Correct? What do you think it’s going on?

Do you use a firewall on that machine ?
Also check if PostgreSQL is listening on any IP. You can see that by using PgAdmin, connect to the server, select in the menubar > Tools > Server Configuration > postgresql.conf. This will open the config file and shows it in a tableview. See if listen_address has the value ‘*’ and the checkbox in front of it is checked.
Then to be sure that PostgreSQL does accept connections from localhost you can do the same but select pg_hba.conf.
See if it has the following:

√ host all all 127.0.0.1/32 md5

Hope this helps.

ROCLASI:
Not sure what you mean with that. You used 2 different upgrade commands ?

Rob: just to clarify,

  1. I run the upgradeRepository procedure, and this was logged:
    2010-09-28 15:45:15 PDT LOG could not receive data from client: No connection could be made because the target machine actively refused it.
    2010-09-28 15:45:15 PDT LOG unexpected EOF on client connection

It did not work. Then…

  1. I run upgradeRepository flag procedure, and this was logged:
    2010-09-28 15:46:42 PDT LOG could not receive data from client: No connection could be made because the target machine actively refused it.
    2010-09-28 15:46:42 PDT LOG unexpected EOF on client connection

None of them work. I’ll check what you suggested.

ROCLASI:
Do you use a firewall on that machine ?
Also check if PostgreSQL is listening on any IP. You can see that by using PgAdmin, connect to the server, select in the menubar > Tools > Server Configuration > postgresql.conf. This will open the config file and shows it in a tableview. See if listen_address has the value ‘*’ and the checkbox in front of it is checked.
Then to be sure that PostgreSQL does accept connections from localhost you can do the same but select pg_hba.conf.
See if it has the following:

√ host all all 127.0.0.1/32 md5

Yes, the machine uses Firewall. But I just created the exceptions for the port 5432 (TCP and UDP exceptions).

I checked the two servers’ configuration files as you indicated. They seem Ok. See the images below.

postgresql.conf:[attachment=1]pgConfig.GIF[/attachment]
pg_hba.conf:[attachment=0]pghbaConfig.GIF[/attachment]
I started the Server with the upgradeRepository procedure once again. And once again this was logged in the PostgreSQL log (Server Status):
2010-09-28 15:45:15 PDT LOG could not receive data from client: No connection could be made because the target machine actively refused it.
2010-09-28 15:45:15 PDT LOG unexpected EOF on client connection

It did not work. I don’t know what it’s going on. I feel that we have checked all possible known issues.

I am uninstalling Servoy and installing it again. If it doesn’t work, I’ll try it in another machine.

Servoy: I am insisting on getting this straight because it is in the interest of all us. I just don’t want to get it working –like installing developer but not using it. I am trying to install Servoy server only. There was a post describing similar issue (http://forum.servoy.com/viewtopic.php?f=11&t=14910). The user resolved the problem by forgetting about PostgreSQL and using Sybase ASA (the old default database). I don’t just want to solve my particular issue. What should I do next?

Hi Carlos,

I dunno what is going on. I tested it on XP using your config file (with only 1 server connection defined) and it all worked fine. With or without escaping the semicolons in the URL, I guess Servoy dropped that requirement over the past few versions.
But humor me, disable your firewall and try it again. See what happens.

does your setup works when you have servoy server and the db on the same machine?
(or are you testing that already?)

ROCLASI:
… humor me, disable your firewall and try it again. See what happens.

jcompagner:
does your setup works when you have servoy server and the db on the same machine?
(or are you testing that already?)

The database server and Servoy (without Developer and PostgreSQL) are both in the same machine. As for Servoy, there is really no a need for Firewall exceptions for the database. They are in the same machine.

In any case, I am going to disable the Firewall and try again.

JC

Same errors,

from database log
2010-09-29 08:49:10 PDT LOG could not receive data from client: No connection could be made because the target machine actively refused it.
2010-09-29 08:49:10 PDT LOG unexpected EOF on client connection

and and Servoy log
2010-09-29 08:49:10,000 ERROR [main] com.servoy.j2db.util.Debug - Cannot upgrade repository: make a backup of your repository and start server with -upgradeRepository flag.

I tried the -upgradeRepository flag procedure. I did not work either.

I’ll try in another XP machine and then in the Server 2003. (The one I have in production with Servoy.) Hopefully, I don’t encounter this problem, which is pretty much the same that Armin encounter while installing Servoy and Postgres in Windows Server 2003 / 2008 R2. (http://forum.servoy.com/viewtopic.php?f=11&t=14910)

Thanks guys for your effort. JC