Setting up RMI Services

With the Enterprise Edition of KonaKart it is possible to configure KonaKart to use RMI versions of the engines. In simple terms, RMI ("Remote Method Invocation") is a way of distributing KonaKart processing over a network rather like SOAP web services but using a different protocol.

This section describes a step-by-step guide to setting up KonaKart on two servers that communicate using RMI.

Step by Step Guide to setting Up KonaKart to use RMI

This guide assumes that we will be setting up KonaKart on two machines (we'll call them chester (our "client") and wolves (our "server")).

  • Install the KonaKart Enterprise Edition on both machines. The easiest way to do this is to use the installation wizards. It is only necessary to populate the database during one of the two installations because we will be using the same database for this distributed configuration.
  • On the "client" machine (chester) we will run only the KonaKart application client engine (KKAppEng) which is used by the storefront client and the Admin Application client part. The KKAppEng client engine will communicate with the application engine (KKEng) on the server machine. The Admin Application client will communicate with the Admin Engine (KKAdmin) on the server machine.

    The KonaKart application server engine (KKEng) and the KonaKart admin server engine (KKAdmin) will both run on the "server" machine (wolves).

  • On the client machine (chester) modify the following files:
    • webapps/konakart/WEB-INF/struts-config.xml - (Applicable only if you're using the Struts-1 storefront - this isn't required if you're using the Struts-2 storefront) ensure that only the KKAppEng plug-in is started. At the bottom of this file you should set it as follows (notice how the KKEngPlugin block is commented out):

      
      <!-- START: This one for a full konakart.war configuration
      <plug-in className="com.konakart.plugins.KKEngPlugin">
      	<set-property property="propertiesPath" value="konakart.properties"/>
      	<set-property property="mode" value="2"/>
      	<set-property property="customersShared" value="false"/>
      	<set-property property="productsShared" value="false"/>
      	<set-property property="definitions-debug" value="2"/>
      </plug-in>
      END: This one for a full konakart.war configuration -->
                     
      

    • webapps/konakart/WEB-INF/konakart_app.properties - specify the RMI Application Engine as follows:

      
      # -----------------------------------------------------------------------------------
      # KonaKart engine class used by the KonaKart Application users
      #
      # For the default engine use:         com.konakart.app.KKEng
      # For the JAXWS engine use:           com.konakart.jws.KKJAXWSEng
      # For the web services engine use:    com.konakart.app.KKWSEng
      # For the RMI services engine use:    com.konakart.rmi.KKRMIEng
      
      #konakart.app.engineclass=com.konakart.app.KKEng
      #konakart.app.engineclass=com.konakart.jws.KKJAXWSEng
      #konakart.app.engineclass=com.konakart.app.KKWSEng
      konakart.app.engineclass=com.konakart.rmi.KKRMIEng
                     
      

    • webapps/konakart/WEB-INF/konakart.properties - ensure that you specify the server machine as wolves as follows:

      
      # -----------------------------------------------------------------------------------
      # RMI Registry Location - This is used to locate (not create) the RMI Registry
      # The definition for the port that the RMI Registry will listen on is in the web.xml
      
      konakart.rmi.host = wolves
      konakart.rmi.port = 8790
                     
      

    • webapps/konakartadmin/WEB-INF/konakartadmin_gwt.properties - ensure that you specify the RMI Admin Engine as follows:

      
      # ----------------------------------------------------------------------
      # KonaKart engine class used by the KonaKart Admin Application users
      #
      # For the default engine use:       com.konakartadmin.bl.KKAdmin
      # For the web services engine use:  com.konakartadmin.ws.KKWSAdmin
      # For the RMI services engine use:  com.konakartadmin.rmi.KKRMIAdminEng
      # For the JSON services engine use: com.konakartadmin.json.KKJSONAdminEng
      
      #konakartadmin.gwt.engineclass=com.konakartadmin.bl.KKAdmin
      #konakartadmin.gwt.engineclass=com.konakartadmin.ws.KKWSAdmin
      konakartadmin.gwt.engineclass=com.konakartadmin.rmi.KKRMIAdminEng
      #konakartadmin.gwt.engineclass=com.konakartadmin.json.KKJSONAdminEng
                     
      

    • webapps/konakartadmin/WEB-INF/konakartadmin.properties - ensure that you specify the server machine as wolves as follows (in this example this is the same as the konakart.properties version above - but they don't have to be!):

      
      # -----------------------------------------------------------------------------------
      # RMI Registry Location - This is used to locate (not create) the RMI Registry
      # The definition for the port that the RMI Registry will listen on is in the web.xml
      
      konakart.rmi.host = wolves
      konakart.rmi.port = 8790
                     
      

  • On the "server" machine (wolves) there is very little to configure if you have installed using the wizard installation kits. We just need to ensure that the RMI services are configured to start up in the respective web.xml files as follows:
    • webapps/konakart/WEB-INF/web.xml - enable the RMI server for the Application engine as follows (basically just ensure that this section is uncommented):

      
      <!-- RMI Server -->
      <servlet>
      	<servlet-name>KonakartRMIServlet</servlet-name>
      	<display-name>KonaKart RMI Server</display-name>
      	<description>KonaKart RMI Server</description>
      	<servlet-class>
      		com.konakart.rmi.KKRMIServer
      	</servlet-class>
      	<init-param>
      		<param-name>port</param-name>
      		<param-value>8790</param-value>
      	</init-param>
      	<init-param>
      		<param-name>rmiEnabled</param-name>
      		<param-value>true</param-value>
      	</init-param>
      	<load-on-startup>20</load-on-startup>
      </servlet>
      <!-- End of RMI Server -->
                     
      

    • webapps/konakartadmin/WEB-INF/web.xml - similar to the above, enable the RMI server for the Admin engine as follows:

      
      <!-- RMI Server --> 
      <servlet>
      	<servlet-name>KonakartAdminRMIServlet</servlet-name>
      	<display-name>KonaKartAdmin RMI Server</display-name>
      	<description>KonaKartAdmin RMI Server</description>
      	<servlet-class>
      		com.konakartadmin.rmi.KKRMIAdminServer
      	</servlet-class>
      	<init-param>
      		<param-name>port</param-name>
      		<param-value>8790</param-value>
      	</init-param>
      	<init-param>
      		<param-name>rmiEnabled</param-name>
      		<param-value>true</param-value>
      	</init-param>
      	<load-on-startup>20</load-on-startup>
      </servlet>
      <!-- End of RMI Server -->
                     
      

  • You may wish to configure the report that is shown in the status panel of the Admin App to use the birtviewer on the wolves machine if your chester machine does not have access to the shared database. Set this in the Configuration >> Reports section of the Admin App.
  • Start up tomcat on the server machine and then start up tomcat on the client machine then click on the following links (or appropriate versions in your environment!) to test: