README for OracleJSP 1.1.2.3.1 samples ************************************** ***** Steps for running these samples in other (non-OSE/JVM) web servers (e.g. iAS, and the Oracle HTTP Server): ------------------------------------------------------------------------ - copy the WEB-INF and demo directories to the doc root or application root of your web server - make sure all the related jar files are in your web server's classpath; they include the Oracle JSP files ojsp.jar, ojsputil.jar. Also include the JDBC (classes111.zip or classes12.zip), SQLJ libraries (runtime and translator zip files), Oracle XML SQL (xsu111.jar or xsu12.jar) and XML parser (xmlparsrev2.jar) for demos which use SQL for database access, SQLJ or XML operations. - For EJB samples, do step [1] of OSE EJB instructions listed below. Rename the resulting common and server jar files (so as not to conflict with the corba sample) and put them under WEB-INF/lib. Also add them to you webserver's classpath. - For CORBA samples, do step [1] of OSE CORBA instructions listed below. Put the generated jars in your web server's classpath. - For the EJB and CORBA samples you will also need aurora_common.zip, mts.jar, aurora_client_orbindep.jar, aurora_client.jar, vbjorb.jar and vbjapp.jar in your web server's classpath. ***** Steps for running the JSP samples in Oracle Servlet Engine (OSE) in Oracle9i: ----------------------------------------------------------------------------- Creating Scott Context and Granting Permissions for loading and running demos The unix Makefile and the NT makeit.bat both require that you have created a separate service for scott. The samples run as SCOTT/tiger in the /scottRoot/contexts/scottContext context. You can create the scott service and contexts by running $ORACLE_HOME/javavm/demo/examples/web/service/scottService.ssh (uncomment the enpoints first) and scottDomain.ssh. (See the Makefile in that directory for example usage of these scripts). Also run scottPerm.sql which grants most of the required permissions to scott. You will also need to grant hotload and socket permission to scott. You can do this from sqlplus with call dbms_java.grant_permission('SCOTT', 'SYS:oracle.aurora.security.JServerPermission', 'HotLoader', '' ); and call dbms_java.grant_permission('SCOTT', 'SYS:java.net.SocketPermission', '*', 'connect, resolve' ); Note that the scottContext is accessed as /ose, and the default endpoint is 8088, so you would access the samples as http://:8088/ose/demo/index.html. Extra Steps for some samples NOTE: To run the "helloxml" demo on OSE in the database, you should change the following line in the file demo/xml/helloxml/hello.jsp from: to: This is a known limitation (bug #1399032). See the release notes for additional details. NOTE: To run the EJB and CORBA samples, please see the instructions, Steps for running the CallEJB.jsp sample on OSE: and Steps for running the CallCORBA.jsp sample on OSE: NOTE:The XMLQuery.jsp example requires that the file xsu111.jar or xsu12.jar be loaded into the database before building the demos. cd $ORACLE_HOME/rdbms/jlib and run loadjava. If you are using jdk 1.1 load xsu111.jar with loadjava -v -r -u SYS/change_on_install -grant PUBLIC xsu111.jar For jdk 1.2 use xsu12.jar. NOTE: The JSP "events" demo requires Scott to create a public synonym for the globals.jsa class. You can use the following commands in SQL*Plus to do this: % sqlplus /nolog connect sys/change_on_install as sysdba grant create public synonym to scott; connect scott/tiger grant execute on "_demo/_ojspext/_events/_globals" to public ; create public synonym "_demo/_ojspext/_events/_globals" for "_demo/_ojspext/_events/_globals" ; Example Unix Makefile to demonstrate the Steps using scottContext The sample Unix makefile $ORACLE_HOME/jsp/demo/Makefile illustrates the steps to create the demo files using the unix make command. Before running the Makefile, be sure you have created the scottService and scottDomain and granted permission to scott as detailed above and done extra steps for some samples if you wish. Finally, you can type make all at the command line to load and compile the demos. Example BAT file to demonstrate the Steps using scottContext on NT makeit.bat is a batch file which illustrates the steps to create the demo files on NT. Type makeit help for instructions on how to use this bat file. Manual Steps Alternatively, you can create the demos manually. Both the unix and nt make scripts are doing the following steps. - copy all the static files (gif/jpg/htm files) to the doc root of OSE. - loadjava jar files under WEB-INF/lib - loadjava class files under WEB-INF/classes - publishjsp all jsp and sqljsp files Refer to the Oracle Java Server Pages Developer's Guide and Reference for additional information on how to publish as SCOTT. You can deploy the demos in the scottContext as mentioned above or you can create a different context for SCOTT. For example, you can create a context called /webdomains/contexts/scottTest as follows: - Put the following commands in a file called domain.ssh, and then execute it as : sess_sh -u sys/change_on_install -s http://localhost:8000 -c @domain.ssh In this case you should use port 8000 here instead of 8080 which is the Admin port. This script creates a scottTest context which belongs to SCOTT. Then, you can use this context in publishing JSPs and servlets as SCOTT. echo Creating context... createcontext -virtualpath /scottTest/ webdomains scottTest chown -R SCOTT /webdomains/contexts/scottTest chmod +rx SCOTT /webdomains chmod +rx SCOTT /webdomains/contexts chmod +rwx SCOTT /webdomains/contexts/scottTest chmod +rw SCOTT /webdomains/contexts/scottTest/config chmod +rw SCOTT /webdomains/contexts/scottTest/named_servlets Steps for running the CallEJB.jsp sample on OSE (OSE EJB instructions): First, load and deploy the EJB in Oracle8i, including the common classes. If you are running on OSE, you will then load and publish the JSP page in 8i. The steps are outlined below: [1] Deploy the EJB object in 8i. On a UNIX system, commands like the following are required: # deploy the EJB % cd $ORACLE_HOME/javavm/demo/examples/ejb/basic/sqljimpl % make [2] Now load and publish your JSP. You can use the demo Makefile: % cd $ORACLE_HOME/jsp/demo/ % make compileJsp2EJB Check the status of the deployed class through SQL*Plus. It should be valid. [3] To run the CallEJB.jsp, you must consider the user privileges. The EJB is deployed as SCOTT. To access it from JSPs deployed as SYS (as in the sample Makefile), you can either: a) Define a table synonym in SQL*Plus as follows: CREATE PUBLIC SYNONYM EMP FOR SCOTT.EMP; Or, b) Publish and run the JSP in schema SCOTT. Refer to the OracleJSP Developer's Guide and the Oracle Servlet Engine Developer's Guide, for the steps. [4] To hotload the JSP in schema SCOTT, you must first grant the hotload permission to SCOTT. You can use the following command in SQL*Plus to do this: call dbms_java.grant_permission('SCOTT', 'SYS:oracle.aurora.security.JServerPermission', 'HotLoader', null); Then, you can use the 'publishjsp -hotload -schema SCOTT ... CallEJB.jsp' command in session shell. ***** Steps for running the CallCORBA.jsp sample on OSE (OSE CORBA instructions): [1] Deploy the CORBA object in 8i. On a UNIX system, commands like the following are required: % cd $ORACLE_HOME/javavm/demo/examples/corba/basic/helloWorld % make [2] After the CORBA object has been deployed, you can use the JSP demo Makefile to load and publish your JSP: % cd $ORACLE_HOME/jsp/demo % make compileJsp2CORBA To hotload the JSP, look at Step [4] above for CallEJB.jsp. ** Please be aware that the EJB and CORBA 'sqljimpl' samples re-define the same Java types, so they cannot be deployed simultaneously in 8i. ** ****** The World of Books Example This is a sample NLS application for an online Book store. Please see the $ORACLE_HOME/javavm/examples/world-o-books directory for details. ****** Note: when viewing source links with Internet Explorer some of the source files are rendered as html because they contain tags. For these files, such as the CallEJB.jsp and simple Welcome.jsp, check the source using IE's View menu's Source option.