Instructions for starting Servoy Server with upgrade flag

Servoy’s wiki is a fabulous resource, though in transition it is understandably incomplete. Thanks guys for all your hard work - believe me: what you are doing is great.

Upgrading to Servoy 5.1 requires an upgrade to the repository, according to documentation on the Wiki. But in each of the Wiki locations where the upgrade is mentioned, it challenges me to log in to see the detail, which I am unable to do.

My Servoy Server install on a test box has no Developer. The servoy_log.txt records that the sever will not start unless the server is started with -upgradeRepository flag.

How do I start the Servoy Server from the command line once only with the flag set?

Note: Servoy Server test box is Windows XP.

I’ve added the relevant chapter on upgrading the Servoy Application Server to the docs: http://wiki.servoy.com/display/DOCS/Updating+the+server

Paul

Many thanks Paul for the wiki reference and the detail of the command to run. Here is my progress report.

In my default installation on XP, I have the application server directory at C:\Program Files\Servoy\application_server.
From the application_server directory I ran the command java -jar servoy_updater.jar -upgradeRepository, as specified in the wiki.
The response:

Unable to access jarfile servoy_updater.jar

Noticing that servoy_updater.jar is located in the parent directory at C:\Program Files, I moved the command line to that directory and ran the same command.
The response:

'Argument ‘-upgraderepository’ not recognized, assuming ‘-beta’ was meant.
Current Servoy version 956
Checking for new Servoy version
Working in directory: C:\Program Files\Servoy
Including beta notifies
Loading version info…
No update found, if you want beta versions start with option: -beta
Done, Servoy can be started.

On starting the Servoy Service manually using the Services admin snap-in, servoy_log.txt shows errors, each with 'Cannot upgrade repository: make a backup of your repository and start server with -upgradeRepository flag.
It seems that the wiki instruction does not apply in my case. I find this odd, as the Servoy directory tree is untouched after a clean installation. All I have changed is the servoy repository and added my db files.
I should add that my installation is a clean install using the 5.0.1 installer, modified by replacing the servoy_repository.db file with my old v10 servoy_repository.db, rebuilt to v11 according to Sybase instructions, and two additional .db files and logs, also rebuilt to v11, with sybase.config as in my Servoy version 4 test. The dbs are running fine and can be accessed by Developer v5 running on my Mac.
In these circumstances, are we sure that the command in the wiki reference is correct?

I corrected the path pointer to point to the root directory of the installation, instead of the /application_server directory.

Are you sure you speciefied “-upgradeRepository” and not “-upgraderepository”? From the posted error message it seems you specified the latter.

Paul

Thank you Paul.

Yes, I specified “-upgradeRepository” in my command. Prompted by your last post, I have repeated the command using -upgradeRepository and upgraderepository in turn. They both return the same result: “Argument ‘-upgraderepository’ not recognized, assuming ‘-beta’ was meant [and the rest as in my earlier post]”.

Richard

I’m sorry, I moved too fast, not thinking clearly.

So, to upgrade the repository, you do need to be in the application_server directory, but you need to start the Application Server with the -upgradeRepository option, and not the servoy_upgrade.jar.

I’ve corrected the docs (again) :)

Sorry for the inconvenience.

Paul

Thanks Paul: you have been very helpful.

To confirm, using a Windows command prompt, I browsed to the application_server directory and entered the following command:
servoy_server.bat -upgradeRepository
There was no message in response, and the command prompt returned after about a minute. Again, there was no message.

Looking in the servoy_log.txt file, again there is no message concerning the repository upgrade.

However, Servoy now starts as a service, so a change has occurred. The .service_log.txt file shows activity, but no messages specifically relating to the repository upgrade.

Is this lack of feedback to the user normal on upgrading the repository in this way?

Richard

Glad to hear we got there eventually

I guess it is “normal” now, will ask our R&D people to add some logging/feedback.

Paul

its weird that you don’t see anything in the servoy log file
We do log stuff like “Upgrading repository.” and “Repository update successful.”

That should be in the servoy log.
But i agree we should also do console output because its really a console command that you run.

pbakker:
So, to upgrade the repository, you do need to be in the application_server directory, but you need to start the Application Server with the -upgradeRepository option, and not the servoy_upgrade.jar.

I’m not sure that is the full extent of flags/parameters. I say that because when I run this:```
servoy_server.sh -upgradeRepository


> 2010-02-28 05:02:38,290 ERROR [main] com.servoy.j2db.util.Debug - Error upgrading repository: com.servoy.j2db.persistence.RepositoryException: com.servoy.j2db.persistence.RepositoryException: java.sql.SQLException: No database selected

So I guessed I should add the databasename on the end as in```
servoy_server.sh -upgradeRepository servoy_repository
``` which results in this message:

> 2010-02-28 05:03:43,695 ERROR [main] com.servoy.j2db.util.Debug - Cannot upgrade repository: make a backup of your repository and start server with -upgradeRepository flag.

I've also tried it with "repository_server" as the database name with the same results as above.

So, as I said, there does seem to be the need to specify the database name, although in my case it didn't help much.

what kind of database do you use there?
Because what you get is an SQL Exception on the moment we are trying to upgrade the repository
Somehow thats impossible because of a misconfigured connection or something like that.

adding an argument after -upgradeRepository is of no use.

The only thing you need on the server is a correct repository server connection.

jcompagner:
what kind of database do you use there?

I’m using the MySQL db provided by my webhost. I’m sort of thinking maybe the pathname to that db is not known by Servoy since the db is not stored in the database directory in application_server as it would if I had installed Sybase. If I’m right then I need to know what the correct pathname should be. This the URL in the servoy.properties:

server.0.URL=jdbc:mysql://localhost/?ServiceName=acsp_repository

How do I modify it to reflect a different path? Or is there another way?

as far as i know doesnt mysql have any direct file path.
It just has a name i think that reference a db inside the mysql instance.

jcompagner:
as far as i know doesnt mysql have any direct file path.
It just has a name I think that reference a db inside the mysql instance.

I installed this by copying over a full Sybase install from my Mac to the webhost, deleting the developer directory, and editing servoy.properties to reflect mySQL instead of the sybase install. I ran the servoy.update process to take it from 4.1.4(681) to 4.1.5(687). No problems there, except the repository won’t upgrade no matter how many time I drop it and remake it.

So, now I’m lost for the next step forward. Is there a problem with the methodology I’ve used?

I should add that I’ve attempted to install 4.1.x on three different Macs now, using MySQL and OpenBase. Failed in all cases.

Only the default install of Sybase seems to work. Is this commonly experienced? If not, what are others doing to get the right result?

i dont think a real repository upgrade is needed d when you move from 4.1.4 to 4.1.5

Of course if you start clean it has to create the tables (so not an upgrade but a real new install)

i just think that your url of your repository database is incorrect:
com.servoy.j2db.persistence.RepositoryException: java.sql.SQLException: No database selected

thats the exception we get when we try to connect to it.

Finally! I discovered that the pathname was wrong. This Webhost expects it like this:jdbc:mysql://localhost/DATABASE_NAME?user=USERNAME&password=PASSWORD instead of ```
jdbc:mysql://localhost/?Servicename=DATABASE_NAME


> http://WEBSITE:8080/servoy-admin/

Investigating the log gives me

> SEVERE: Catalina.start: 
> LifecycleException: service.getName(): "Catalina"; Protocol handler start failed: java.net.BindException: Address already in use:8080
> at org.apache.catalina.connector.Connector.start(Connector.java:1139)
> at org.apache.catalina.core.StandardService.start(StandardService.java:531)
> at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
> at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
> 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:592)
> at com.servoy.j2db.server.WebServer.startWebServer(WebServer.java:74)
> at com.servoy.j2db.server.ApplicationServer.startWebServer(ApplicationServer.java:5)
> at com.servoy.j2db.server.ApplicationServer.main(ApplicationServer.java:167)
> 2/03/2010 04:26:04 org.apache.catalina.startup.Catalina start
> INFO: Server startup in 1082 ms

So apart from fixing my graceless way of restarting Servoy what needs to be done to get access?

if you have this:

LifecycleException: service.getName(): “Catalina”; Protocol handler start failed: java.net.BindException: Address already in use:8080

then that means that something is already running on 8080, this can be servoy itself (or another instance) or a completely other program.