FoxInCloud
Startup error
Gravatar is a globally recognized avatar based on your email address. Startup error
  Vincent H.
  All
  Mar 10, 2019 @ 11:25am

Hi Thierry,

I get this error when starting my application:

Thanks in advance

Gravatar is a globally recognized avatar based on your email address. re: Startup error
  FoxInCloud Support - Thierry N.
  Vincent H.
  Mar 11, 2019 @ 03:15am

Hi Vincent,

Your code attempts to open a dialog during the server startup procedure (xxxSets.Init() and/or dependent procedures), which makes no sense as the server may restart at any time, without user monitoring.

This generally occurs in 2 cases:

  1. a message box reporting a startup exception,
  2. the application's startup form.

message box reporting a startup exception

Just add the exception to the first parameter of xxxSets.Init(), like in the example below; you can use the cResultAdd() helper function to make it easier:

* ===================================================
DEFINE CLASS xxxSets as awSets of awPublic.prg

* ---------------------
PROCEDURE Init
lparameters ;
  result; && @ {en} result of application startup - appears in .../foxincloud-status.xxx {fr} résultat du démarrage de l'application - mentionné dans .../foxincloud-status.xxx
, toAppHost as awAppHost of awAppHost.fxp && {en} Web Application Host object {fr} Objet Hôte d'application Web

…
* wMessageBox('some startup exception') && replace this instruction by the following inst.
cResultAdd(@m.result, 'some startup exception')
…
  • In web mode, FoxInCloud adds the exception to wwRequestLog as 'startup error' and displays it in …/foxincloud-status.xxx

  • In desktop mode, you can just display the message when xxxSets.Init() has completed:

&& desktop startup program
local loSets as xxxSets of xxxSets.prg, result as string
loSets = newObject('xxxSets', 'xxxSets.prg', 0, @m.result)
if !empty(@m.result)
  messageBox(m.result)
endif
if vartype(m.loSets) == 'O'
  do form startup
endif

application's startup form

Just remove the call to the startup form from xxxSets.Init() (or called procedure) and move it to the desktop startup program like shown above.

In Web mode, you need to call the startup form in your Index process method:

modify command xxxServer.prg
…
DEFINE CLASS xxxProcess AS awProcess OF awServer.prg
…
Procedure Index
this.wFormStandardPage('startup.scx')
external form startup && for project manager
…

(startup.scx is just a sample name, you can use whatever name you want)

© 1996-2024