Troubleshooting the Framework

This document covers the following topics:

See Web Application Development for introduction and concepts, and Error Messages for troubleshooting help.


Performance Monitoring

Performance monitoring provides the ability to trace the performance of all sessions/single sessions, and save them to a CSV (Excel) file.

This feature monitors the process of an instant/generated page, from pressing a host key until the result page is fully loaded. The monitoring includes browser performance, Web server performance and ApplinX server/host performance.

The monitoring includes:

  • The entire wait time the user waits between pressing an action key, until receiving the HTML result of the target screen - Total Request.

  • The entire time that the Web server processed the user request (including ApplinX server & the host response times) - Total Server Side.

  • The send key response time - SendKeys.

  • The HTML page loading time - Client Load.

  • Important ApplinX actions such as attaching to ApplinX server, creating the instant page (Generate Instant), updating controls from the host screen, updating tables (when tables exist), detaching from ApplinX server.

JavaScript Logger Engine

The JavaScript logger engine is used to log JavaScript errors (primarily) as well as to debug specific modules of the JavaScript engine. The engine logs JavaScript errors which occur to users of the Web application. These errors are logged to the framework JavaScript log, with the following user information: Session ID, IP, browser details.

Each line in the log displays a timestamp, module name, log level, and the message.

Logging JavaScript Errors

The JavaScript logger engine automatically logs JavaScript errors to a log text file on the server (logs/javascript_log.txt).

Note:
Applications created in ApplinX versions prior to 5.2.4 this file should be replaced/edited (if changes were made) with the config/gx_logConfig.xml file from the new application/config directory of the relevant framework type jsp/c#/vb.

Debugging JavaScript Modules

The JavaScript Logger Engine can be used by ApplinX developers to debug specific modules of the JavaScript engine (The JavaScript engine core, Emulation, modal windows, type ahead, Natural data transfer), by displaying the information in the log console (or writing to the server log when the log console is not shown).

To configure the JavaScript log console, configure parameters in the config/gx_clientConfig.xml file as follows:

<engineConfig
logLevel="3" <- 3-activate debug mode (0-Error , 1-Warnings , 2-Massage , 3-Debug)
debugModules=:z_engine.js,z_emulator.js,z_window.js,z_typeAhead,z_ndt.js" <- which modules to debug
showLogConsole="true" <- show/hide the log console
/>

Note:
The log text file also logs any error/debug (when active) messages when the browser is refreshed, when the system is disconnected, when clicking on the Write to server log button in the log console (if the log console is displayed) and when the log console's size reaches 5k (to avoid reducing the speed of the browser).

Example:

Whenever myFunc is executed the Boolean variable "myBool" is evaluated. If the value received is "false", a message is logged in the debug log stating that there is a problem.

function myFunc(){
      var myBool = false;
      doSomthing(myBool);
      if (!myBool){
       GXLog.debug("myModule","Something went terribly wrong!!");
      }
      return myBool;
}

Ensure to set the config/gx_clientConfig.xml as detailed above.

Refer to the API:

Investigating the Web Application's Code

It is possible to use the ApplinX framework log to analyze and debug the code in the Web application. This is implemented by making changes in the config/gx_logConfig.xml file.

Start of instruction setTo define the messages that will be displayed in the framework log:

  1. Open config/gx_logConfig.xml.

  2. Uncomment the following section:

    JSP:

    <!--category additivity="false" name="<Category-Name>">
    	<level value="info"/>
    	<appender-ref ref="FRAMEWORK_LOG"/>
    </category
    -->

    .NET

    <!-- logger additivity="false" name="<Category-Name>">
    	<level value="info"/>
    	<appender-ref ref="FRAMEWORK_LOG"/>
    </logger
    -->
    
    
  3. Change the level tag value to either: info, error, warning, or debug.

  4. Change the <Category-Name> to a meaningful value. This will make it easier for you to find log entries at a later time.

  5. Restart your web server, in order for the changes to take effect.

  6. To write to the log file from anywhere in your code, make sure that the call looks similar to the following (depending on the log level):

    GXLog.info("Category-Name","<Message>");
    GXLog.error("Category-Name","<Message>");
    GXLog.warning("Category-Name","<Message>");
    GXLog.debug("Category-Name","<Message>");
    

Redirecting back to hostLogin Page

When using the hostLogin.jsp/hostLogin.aspx files and disconnecting the user, use the following JavaScript syntax to redirect back to the hostLogin page in the ApplinX Framework application:

window.parent.location="<landing page url>"

The hostLogin page needs to be loaded outside of the ApplinX Framework frameset.

Customizing the Session ID

The necessary steps depend on whether you are using Natural under UNIX or another scenario.

Start of instruction setTo customize the session ID when running under Natural UNIX

  1. Create new Java file under WEB-INF/contexts - we called it "aaa" in this example.

  2. Implement the Java class in this manner:

    package contexts; 
    
    import com.sabratec.applinx.j2ee.framework.web.GXHostLoginContext; 
    import com.sabratec.applinx.framework.*; 
    
    public class aaa extends GXHostLoginContext { 
    
    private static final long serialVersionUID = 1L; 
    
    public void gx_onLoad() { 
           super.gx_onLoad(); 
    } 
    public void doLogin() { 
           super.doLogin(); 
    } 
    
    @Override 
    public void gx_initSessionConfig() { 
           GXWebAppConfig gx_appConfig = getGXAppConfig(); 
           gx_appConfig.getSessionConfig().setSessionId(getTagsAccesor().getTagContent("GXUser")); 
           gx_appConfig.getSessionConfig().setDescription("desc1"); 
           super.gx_initSessionConfig(); 
    
    } 
    
  3. Edit the hostLogin.jsp to use this new Java file, by pointing the gx_page to the new class <gx:page gx_context="contexts.aaa">.

  4. Use the build script (make.sh) to recompile this class.

  5. Restart Tomcat and try again.

Start of instruction setTo customize the ApplinX session ID in another (non-Natural/UNIX) scenario

  1. Go to the ApplinX web application folder.

  2. Edit the GXBasicContext.java file.

  3. In the gx_initSessionConfig method, uncomment the following line:

    gx_appConfig.getSessionConfig().setSessionId("<YOUR_SESSION_ID>"); 
    
  4. Change <YOUR_SESSION_ID> to the required value.

  5. Use the build script (make.sh etc) to recompile this class.