Configuring JBoss application servers to run as a Windows application

Configure a JBoss application server instance or cluster to run as an application in Windows. After the server starts, ongoing activity is displayed in a command window.

To configure the application instance, you need to alter the JVM memory allocation parameters to work with NexJ applications. Then you must create a shortcut to the JBoss application server run.bat file to specify additional parameters in the shortcut to start the JBoss application server.

To configure a JBoss application server to run as an application:

  1. Open the JBOSS_HOME\bin\run.conf.bat file in your XML or text editor.
  2. Locate the line containing the text "JVM memory allocation pool parameters" and modify the JAVA_OPTS variable as required:
    Table 1. Recommended JVM memory parameter values
    Java option description Recommended value Java option code
    Maximum heap space 2048 MB -Xmx2048m
    Minimum heap space 2048 MB -Xms2048m
    Maximum permanent generation (permgen) space 256 MB -XX:MaxPermSize=256m
    Minimum permanent generation (permgen) space 256 MB -XX:PermSize=256m
    Default stack size 8192 KB -Xss8192k
    Default thread stack size 8192 KB -XX:ThreadStackSize=8192k
    For example:
    set "JAVA_OPTS=-Xms2084m -Xmx2084m -XX:PermSize=256m -XX:MaxPermSize=256m -Xss8192k -XX:ThreadStackSize=8192k"
  3. In JBOSS_HOME\bin, create a shortcut to run.bat and place it in a desired location.
  4. Rename the shortcut to a unique and meaningful name. For example, run_projectdir, where projectdir is the name of the folder containing server information.
  5. Specify the properties to use when you launch the run_projectdir shortcut that executes the run.bat file.
    1. Right-click the shortcut and select Properties. Click the Shortcut tab.
    2. Specify the following parameters in the Target field:
      -c projectdir
      The server configuration that the shortcut will run.
      -b 0.0.0.0
      The IP of the network interface controller the instance will bind to. Specify 0.0.0.0 to bind to all NICs on the machine.
      -u 239.nnn.nnn.nnn
      The multicast IP address. If you are configuring a JBoss application server cluster, change the multicast IP address to avoid joining the node to other clusters. Replace nnn with a number between 1 and 255 inclusive. For example, 239.255.16.16. Ensure that the address does not conflict with the addresses used by other clusters. All nodes in a cluster must have the same IP address.
    3. Optional: If multiple JBoss application server instances need to run on the same machine, specify the following parameters in the Target field:
      -Djboss.service.binding.set=ports-0n
      Replace n with a number between 1 and 4 to specify a port offset profile. For example, specify ports-01 for HTTP port 8180, ports-02 for HTTP port 8280, and so on.
      -Djboss.hajndi.port=nnnn
      Use this property to specify the JNDI port of the server. The value is the combination of the default JNDI port (1100) and the port offset defined below.
      -Dnexj.port.offset=n00
      Use this property to shift all resource adapter listener ports. Replace n with a number to specify a port offset. For example, specify 100 for UDP local port 3101, 200 for UDP local port 3201, and so on.
      Table 2. Port binding chart
      Port offset profile HTTP port HTTPS port UPD localPort hajndi.port (JBoss 5)
      default 8080 8443 3001 1100
      ports-01 8180 8543 3101 1200
      ports-02 8280 8643 3201 1300
      ports-03 8380 8743 3301 1400

    For example:

    "C:\jboss-5.2.0.EAP\bin\run.bat" -c projectdir -b 0.0.0.0 
    -Djboss.server.binding.set=ports-01 -Djboss.hajndi.port=1200 -Dnexj.port.offset=100
  6. If you are configuring a JBoss application server cluster, for every node that you plan to include in the cluster, repeat steps 3 to 5.
    Create a shortcut for each additional node. For example, create shortcut run_projectdir2 pointing to the CRM_Prod_Node2 directory, shortcut run_projectdir3 pointing to the CRM_Prod_Node3 directory, and so on.
  7. To start each JBoss application server instance, execute the shortcut to the run.bat file for that instance.
Each JBoss application server instance now runs as an application. When you start an application, a command window opens and displays ongoing server activity. To shut down the server, press Ctrl+C in the command window.
You can now deploy your NexJ application on the JBoss application server instance or cluster.