Deploying a JSP to the J2EE Reference Implementation Server

In this document we walk you through all the steps you must take to deploy the sample JSP into J2EE Reference Implementation Application Server.

The steps involved

  1. Preparation

  2. Deploy the example

  3. Run the example
  4. Setting Up the Environment
  5. Troubleshooting

Preparation

  1. We want to share excel.jar and jintegra.jar. In order to share these two files you must add them to your J2EE_CLASSPATH environment variable. If your J2EE application server is running, you must stop it and set this environment variable first and then restart the J2EE application server.

  2. In order to have access to a COM object, Windows NT needs to authenticate you. J-Integra® can do this for you, if it can find a native DLL that performs the authentication. You must include the bin sub-directory under J-Integra® directory to your path environment variable. Again, if your J2EE server is running, stop it and set this environment variable properly and then restart the J2EE server.

  3. Copy the provided ExcelCalculatorJSP.html, and ExcelCalculatorExample.jsp files into a local directory that will be the target directory of your deployment. These files are included in your jintegra\examples\servlet-com\ServletToExcelCalculator directory when you download J-Integra®.

Deploy the example

This section explains how you can deploy the ExcelCalculatorExample.jsp on the J2EE Reference Application Server provided by Sun Microsystem. The deployment tool used to deploy the JSP is Application Deployment Tool Version 1.3. The same procedure applies if you are using other version of this deployment tool.

  1. Ensure that you have you have installed the J-Integra® license.

  2. Open a DOS session and set the PATH, CLASSPATH, and J2EE_CLASSPATH environment variables and start your J2EE application server by entering the command:
    j2ee -verbose

  3. Open another DOS session and set the PATH, CLASSPATH, and J2EE_CLASSPATH environment variables and enter this command to start the deployment tool:
    deploytool

  4. The Application Deployment Tool should open.

  5. In the File menu, click New, and then click Application

  6. Select the directory that you want to put the files that are generated by the deploytool. Name the new application ExcelCalculatorExampleJSP.ear. Do not forget the .ear extension.

  7. ExcelCalculatorExampleJSP is now shown under Files>Applications in the Application Deployment Tool. Click ExcelCalculatorExampleJSP to select it. In the File menu, click New, and then click Web Component

  8. The New Web Component Wizard opens. Bypass the Introduction by clicking Next.

  9. In WAR File General Properties, enter ExcelCalculatorJSP as the WAR Display Name and click the Add button.

  10. The Edit Contents of ExcelCalculatorJSP dialogue box opens. Browse to the ExcelCalculatorExample.jsp file and click Add to add it to the Contents of ExcelCalculatorJSP. Browse to the ExcelCalculatorJSP.html file and click Add. Click Next.

  11. Ensure that JSP is selected as the type of web component you are creating. Click Next.

  12. Select ExcelCalculatorExample.jsp as the JSP Filename. Enter ExcelCalculatorJSP as the Web Component Name. Click Next.

  13. Click Next on the Component Initialization Parameters page. Click Next, then click Finish to complete the New Web Component Wizard.

  14. Select ExcelCalculatorExampleJSP in the left panel. Click the Web Context tab in the right panel and enter ExcelCalculatorJSP as the Context Root.

  15. From the Tool menu, select Deploy Click Next to skip past the Introduction.

  16. Ensure that ExcelCalculatorJSP is shown as the Context Root. This is very important.

    Click Next and then click Finish.

Run the example

After you deployed the example successfully, open your Web browser and enter http://localhost:8000/ExcelCalculatorJSP/ExcelCalculatorJSP.html as the URL.

Enter two numbers and click Submit.

Setting Up the Environment

For information on setting up the environment for different platforms, see Setting up the environment to run a JSP and/or Servlet file.

Troubleshooting

If you get a message saying Exception:java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup), then follow these steps:

1. Make sure that you passed the login credentials of AuthInfo.setDefault("Domain", "username", "password") correctly in the ExcelCalculatorExample.jsp.

2. Add the following lines in C:\j2sdkee1.4\lib\security\server.policy
 

grant codeBase "file:C:\jintegra\lib\jintegra.jar" {
   permission java.security.AllPermission;
};

grant codeBase "file:C:\jintegra\lib\excelXP.jar" {
   permission java.security.AllPermission;
};

grant {
   ...
   permission java.lang.RuntimePermission "modifyThread";
   permission java.lang.RuntimePermission "modifyThreadGroup";
};