Skip to main content

Schedule service restart


For different reasons, it might be good to schedule a restart of the AVIX Server that is hosted by a Windows service. For instance, in the AVIX5.0 train we've hade experiences at customers when the SFV stops answering. 

NET START can be used to start Windows services. NET STOP can be used to stop Windows services.

When typed at the command prompt, service names of two words or more must be enclosed in quotation marks. For example, NET START "Solme AviXServer" starts the Solme AviXServer service.

You can use this technique with any Windows Service responding to the NET command.

Some web resources on Windows task scheduler: 

INSTRUCTIONS

  1. Open the Windows Services Management Console by typing "services.msc" in the run box.
    1. image.png

  2. Locate the GSXAVIX MonitorServer service and open its properties.
  3. Take note of the Service name for future use:

In a clean server installation, no such file exists yet. However, there is an example file entitled "repositories.xml.example" that can be used to get started:

image-1645720029317.png

This is the content of the example file, showcasing the usage of both Postgre SQL, MS SQL Server and H2 databases.

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<repositoryConfig>
	<!-- POSTGRE SQL repository example -->
	<repository name="repo1" type="se.solme.avix.server.cdo.postgresql"
		serverHost="localhost"
		portNumber="5432"
		databaseName="avix1"
		databaseUser="postgres"
		databasePassword="postgres"
		useSSL="false"/>
	
	<!-- MS SQL Server repository example -->
	<repository name="repo2" type="se.solme.avix.server.cdo.mssql"
		serverHost="localhost"
		portNumber="1433"
		instance="SQLEXPRESS"
		databaseName="avix2"
		databaseUser="user"
		databasePassword="pw"
		useSSL="false"/>
	
	<!-- MS SQL Server repository example 2 (same server, another db) -->
	<repository name="repo3" type="se.solme.avix.server.cdo.mssql"
		serverHost="localhost"
		portNumber="1433"
		instance="SQLEXPRESS"
		databaseName="avix3"
		databaseUser="user"
		databasePassword="pw"
		useSSL="false"/>
		
	<!-- h2 repository example (self-hosted by the AVIX server) -->
	<repository name="admin" type="se.solme.avix.server.cdo.h2" databaseName="admin"/>
</repositoryConfig>


Configure your database repository

To connect the AVIX server to a database you intend to use for the AVIX application, make sure to create the "repositories.xml" file, and define a "repository" XML element with the appropriate values. Example of "repositories.xml", which connects to an available Postgre SQL DBMS:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<repositoryConfig>
	<repository name="repo1" 
                type="se.solme.avix.server.cdo.postgresql"
				serverHost="localhost"
				portNumber="5432"
				databaseName="testavix2"
				databaseUser="postgres"
				databasePassword="c863qsQt5sr3WlRPdogc1m"
				useSSL="false"/>
</repositoryConfig>

When finished, restart the server. 


Verify database repository and connection

To test the example configuration described above, you may launch an AVIX application and connect to your server. 

  1. Start AVIX5 application
  2. Open the "Database browser" dialog: 
    1. image-1645786778348.pngimage.png

  3. ConnectOpen tothe yourTask server,Scheduler toby seetyping allTask repositories.in the Windows search box:
    1. Host: If you are running the AVIX application on the same machine as the server is running, enter "localhost". Otherwise, the host name or its IP will have to be inserted. 
    2. Port: The default port is 45500
    3. Example of connection URL:  localhost:45500
    4. Terminate with "Enter", to connect.

      image.png

  4. IfCreate connectiona coulddedicated befolder established,named you"AVIXTasks", shouldwhere seewe thewill repositorydefine thatour the server holds:tasks:
    1. image-1645787102481.pngimage.png

  5. Select Create a Basic Task from the Actions list on the right:
    1. image.png

  6. Name the task Stop AVIX Server:
    1. image.png

  7. Click Next and select Weekly Trigger:
    1. image.png

  8. Pick time(s) when there will be little activity/usage. We select 01:00 AM, two days/week here:
    1. image.png

  9. Click Next and for the Action select Start a program:
    1. image.png

  10. For the Program/Script type NET and add the arguments  Stop "SolmeAviXServer" (i.e. the service name):
    1. image.png

  11. Before Finishing, select the Open the Properties dialog option:
    1. image.png

  12. In the exampleGeneral above,tab noselect AVIXRun storagewhether yetuser existsis logged in theor repository.not and Run with highest privileges:
    1. image.png

  13. CreateThe yourtask firstwe storage,have ifnow desired.defined will stop the AVIX Server service, twice weekly at a chosen time, now we need to create another task to launch it again.


Troubleshooting

The log file "logs/AviXLogfile.log" of the server can be inspected, to see information relating to repository management. Some excerpts indicating what you can look out for .

The path to the "repositories.xml" that the server reads should be presented:

AviX CDO Server starting
Default location for CDO Server 'repositories.xml' file is in Platform.getInstallLocation(), resulting in: file:/C:/AVIX/Servers/se.solme.avix.server.product-win32.win32.x86_64/
...
CDO Server 'repositories.xml' config file is read from existing file C:\AVIX\Servers\se.solme.avix.server.product-win32.win32.x86_64\repositories.xml

Information relating to creation of defined repository: 

Creating CDO repository for PostgreSQL with name: "repo1"
Server:localhost, Port:5432, DbName:testavix2, User:postgres, SSL:false 

If successful connection, you should be able to see something like:

(s.s.a.s.c.p.PostgreSQLUtil:64)    - SUCCESS creating repo: "repo1"

In case of failure, expect something like this instead: 

s.s.a.s.c.p.PostgreSQLUtil:67)    - Unsuccesful with creating the repo.
org.eclipse.net4j.db.DBException: org.postgresql.util.PSQLException: FATAL: password authentication failed for user "postgres"
	at org.eclipse.net4j.internal.db.DataSourceConnectionProvider.getConnection(DataSourceConnectionProvider.java:56)
	at org.eclipse.emf.cdo.server.internal.db.DBStore.getConnection(DBStore.java:220)
	...


Other

As stated above, the AVIX server will by default pick up the file "repositories.xml" if existing in the root directory of the server. However, if you would like to put this file elsewhere, this is possible by explicitly setting the cdo.server.repository.configuration preference in the "configuration/se.solme.avix.prefs" file of the server. Example:

#
# CDO Server settings
#
[se.solme.avix.server.cdo]
cdo.server.repository.configuration=\\SomeServer\\AVIXConfiguration\\repositories.xml