Ask Reuben

_studio.xcf

Why does my Genero application not restart when I click refresh in my browser? 

What is difference between .xcf file that ends _studio and one that does not?

What is difference in URL that ends _studio and one that does not? 

What is gsproxy?

Why does my Web Application not start, what is wrong with my .xcf?

When using Genero Studio, and you have the Display configured to “Use Application Server”, that is running through a Web Browser rather than via Genero Desktop Client, something interesting happens that innocently has some flow on effects.

To start with, two .xcf (Application Configuration) files are created and are placed in the /app subdirectory of the  appdata directory.   They will have a filename that consists of program-name_your-name.xcf and program-name_your-name_studio.xcf.

If you look in the address-bar of the browser you will see a URL that is of the form server-name/ua/r/program-name_your-name_studio .  You can correctly guess that Genero Studio is creating an .xcf file named program-name_your-name_studio.xcf and then launching a Genero Web Application using that .xcf file.  However before using that .xcf file, you should understand what is inside it, as without understanding what is inside that particular .xcf file, false assumptions are made that leaves you scratching your head.

The first problem arises if in your Web Browser, you decide you want to restart that particular Genero program, so you click on the refresh button and your browser screen goes blank, the Genero program does not restart.

The second problem arises when you are creating your first .xcf for deployment of your Genero Web Application to another server and you find the _studio.xcf file and copy and paste parts of it to create your deployment .xcf file.

To understand the issue, open program-name_your-name.xcf and program-name_your-name_studio.xcf in a text editor and examine them, or even better do a diff  on the two files.

Using Hello World from Tutorials & Samples page in Genero Studio I get the following differences …

2c2
< <!--Application Server configuration file for use with a browser only. This file is for development only. Do not use in a production environment.-->
---
> <!--Application Server configuration file for use with Genero Studio only. This file is for development only. Do not use in a production environment.-->
54,56c54,64
<     <DVM>"/Applications/fourjs/fgl/4.01.04/bin/fglrun"</DVM>
<     <MODULE>"HelloWorld"</MODULE>
<     <PARAMETERS/>
---
>     <DVM>"/Applications/Genero Studio 4.01.01-202211071225.app/Contents/MacOS/gsproxy"</DVM>
>     <MODULE/>
>     <PARAMETERS>
>       <PARAMETER>--host</PARAMETER>
>       <PARAMETER>127.0.0.1</PARAMETER>
>       <PARAMETER>--port</PARAMETER>
>       <PARAMETER>58780</PARAMETER>
>       <PARAMETER>--console</PARAMETER>
>       <PARAMETER>/Applications/fourjs/fgl/4.01.04/bin/fglrun</PARAMETER>
>       <PARAMETER>HelloWorld</PARAMETER>
>     </PARAMETERS>

Remember that the EXECUTION elements (ENVIRONMENT, PATH, DVM, MODULE, PARAMETERS) combine to create the command executed.  So having set the same environment and cd’ing to the same directory, the difference between the two .xcf is the command executed.

The file that ends _studio effectively executes the following command …

gsproxy --host host-name --port port-number -- console fglrun program-name

The file that does not end _studio effectively executes the following command …

fglrun program-name

So your question should then be, “what is gsproxy?”.  gsproxy is a process that acts as the intermediary between the Genero Studio application and the fglrun process.  When you are debugging, it is gsproxy that is managing the communication as you enter debugging commands into Genero Studio and sends the commands to the fglrun process.  Data such as parameters values, current line number flows the other way from the fglrun process to Genero Studio via gsproxy.

So if you have a URL that ends _studio in the browser address bar and you press refresh in the browser, or you copy and paste that URL and use it later, you are attempting to restart gsproxy, you are not attempting to restart fglrun!!!.  gsproxy is designed to be started by Genero Studio.

Similarly if you use the  _studio.xcf as a basis to create a Genero Application configuration file for deployment, you are copying the instructions to start gsproxy, not to start fglrun!!!

The .xcf that does not end _studio.xcf, that is the program-name_your-name.xcf file is the better one to use as a basis to create a Genero Application configuration file for deployment.    There is one additional step you should do and look at what is common between your various program-name_your-name.xcf files and create an Abstract Application.  This typically means that all the environment variables you need to be set should be set once in an Abstract Application and not repeated in many different .xcf files.

The simple thing to remember, if you want to star the Genero application again, don’t press refresh if the URL in the address bar ends “_studio”, delete “_studio” from the URL in the address bar and then press refresh.  Similarly don’t copy and paste from the .xcf ending “_studio.xcf”, copy and paste from the .xcf that does not end “_studio.xcf”