In this document we walk you through all the steps you must take to deploy the sample JSP into J2EE Reference Implementation Application Server.
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.
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.
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®.
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.
Ensure that you have you have installed the J-Integra® license.
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
Open another DOS session and set the PATH, CLASSPATH, and J2EE_CLASSPATH
environment variables and enter this command to start the deployment tool:
deploytool
The Application Deployment Tool should open.
In the File menu, click New, and then click Application
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.
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
The New Web Component Wizard opens. Bypass the Introduction by clicking Next.
In WAR File General Properties, enter ExcelCalculatorJSP as the WAR Display Name and click the Add button.
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.
Ensure that JSP is selected as the type of web component you are creating. Click Next.
Select ExcelCalculatorExample.jsp as the JSP Filename. Enter ExcelCalculatorJSP as the Web Component Name. Click Next.
Click Next on the Component Initialization Parameters page. Click Next, then click Finish to complete the New Web Component Wizard.
Select ExcelCalculatorExampleJSP in the left panel. Click the Web Context tab in the right panel and enter ExcelCalculatorJSP as the Context Root.
From the Tool menu, select Deploy Click Next to skip past the Introduction.
Ensure that ExcelCalculatorJSP is shown as the Context Root. This is very important.
Click Next and then click Finish.
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.
For information on setting up the environment for different platforms, see Setting up the environment to run a JSP and/or Servlet file.
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 { |