Contacts About Us

Powered by Dynamic PSP

Click Here to View This Page by JOPA servlet
Click Here to View This Page by using JSP

Click Here to Download this document


(this document related only to full version of JOPA servlet)

You may deploy the servlet manually or automatically through the server management and deployment tools. To deploy the servlet manually, you need to copy the supplied JAR or WAR file (jopa.jar or jopa.war) to the application server and add it to the servlets container class path. Deploying servlets differs from container to container, so you need to consult your container’s documentation for instructions on servlet deployment. This chapter will describe in detail how to deploy the servlet on Apache JServ and Oracle OC4J. Other containers may require different deployment procedures, though since the servlet is provided in standard WAR archive, there should be no problems deploying it to any J2EE 1.3 compatible container.

Apache JServ is configured through several property files. The root property file is specified in mod_jserv module’s main configuration file (usually jserv.conf) with ApJServProperties directive. Usually, this file is named jserv.properties and is located in $APACHE_HOME/Jserv/conf/ directory. Several properties should be changed or added to this file in purpose for the JOPA Servlet to function properly:

wrapper.bin Set this to JRE 1.4 executable (for example, c:\j2sdk1.4.2_05\bin\java.exe). The JOPA Servlet requires JRE 1.4.0 or later to function.
Note that this change may break the Oracle JSP engine – OJSP will be no longer able to compile the JSP pages because the new JRE has more recent class file format and the engine will use an older compiler. To fix this issue, you need to specify correct tools.jar from JDK 1.4 or later in zone properties file. Locate the line similar to the following:
where is your Oracle HTTP Server home directory, and replace this path with the path to the tools.jar library from JDK 1.4 or later.
For example:
Alternatively, you can add the following OJSP initialization argument (in zone properties file):
where is full path (including executable name) to the Java compiler 1.4 or later (for example, c:\j2sdk1.4.2_05\bin\javac.exe.)
wrapper.classpath Add new wrapper.classpath property entry and specify full path including file name to the JOPA.war
zones This property defines so-called servlet zones. There may be several zones defined, each with its own properties. Usually, one zone, called root is defined and is sufficient.

Depending on zone names defined in zones, each defined zone should have its own properties file. These files are defined with .properties property, where is replaced with the zone name. For example, for the root zone, corresponding property will be named root.properties. This property should contain full path including file name to the zone properties file.
For example:
servlet.acc.code=com.nnetworks.jopa.JOPA servlet.acc.initArgs=cfgfile=C:\\j2sdk1.4.2_06\\Jopa\\jopa.cfg servlet.acc.initArgs=logfile=C:\\j2sdk1.4.2_06\\Jopa\\jopa.log servlet.acc.initArgs=loglevel=3 servlet.acc.initArgs=debuglevel=0

Access will be:

The zone properties file should also be edited and new servlet alias should be added to it. Assuming that you have single zone defined, root, and properties for this zone are stored in zone.properties file (usually located in $APACHE_HOME/Jserv/servlets/ directory), you need to open this file and do the following modifications to it:

Add the following entries:

### JOPA configuration start

The above additions specify new alias for the JOPA Servlet, jopa, and specify which class is the main servlet class (com.nnetworks.jopa.JOPA). They also provide initialization arguments for the main servlet class. cfgfile is mandatory argument – it specifies the location of the JOPA Servlet configuration file, which contains other servlet parameters and DADs (Database Access Descriptors) definitions. The configuration file is an ASCII text file, which contains servlet configuration parameters. Its syntax is similar to the Windows .INI file syntax – the file is broken into sections; each section is delimited with section name in square brackets. Within each section there is one or more parameters related to that section. Each parameter is on separate line in parameter_name=value form. Parameter names are case-sensitive.

[Config] section defines global servlet configuration. Below is the list of all recognized servlet parameters, their meaning and allowed values:

log_prefix Defines a sequence of characters with which all log entries will be prefixed.
Default is blank (no prefix.)
error_prefix Defines a sequence of characters with which all error log entries will be prefixed.
Default is ** (double asterisks.)
logfile Log file name and location. If loglevel is higher than 0, the servlet will log its actions to the specified file.
This parameter is optional and defaults to /jopa.log ( is extracted from cfgfile parameter.) It may also be specified in servlet initialization property (servlet..initArgs.)
loglevel Logging level. Defines level of verbosity for servlet actions logging. Valid range of values is 0..5. 0 turns logging off, 5 is the most verbose level. Note that critical errors (unexpected exceptions, etc.) are still logged to the log file even if loglevel is set to 0. Such errors are prefixed with a sequence of characters defined by error_prefix parameter.
This parameter is optional and defaults to 0 (no log.)
debuglevel Console logging level. Defines level of verbosity for servlet actions log that goes to the system console. Valid range of values is 0..5. 0 turns logging off, 5 is the most verbose level. This parameter should be set to 0 in production environments and is only useful with text-mode servlet runners.
This parameter is optional and defaults to 0 (no log.)

You now need to restart the Apache daemon, so that it will reload mod_jserv and the module will re-read its configuration and recognize new settings for JRE, class path and new servlet definition. Servlet deployment is now complete and the JOPA Servlet is accessible at //jopa/, where is location configured in Apache to be handled by mod_jserv. However, you will also need to define some DADs before you will be able to use it.
DAD definition format is discussed further in this chapter.

Unlike Apache JServ, OC4J Standalone follows the J2EE specifications and is configured through XML configuration files.
To deploy the JOPA Gateway Servlet on OC4J, you should first copy the jopa.war archive to the
{oc4jhome}/j2ee/home/applications directory, modify {oc4jhome}/j2ee/home/config/http-website.
xml file by adding new entry to the section:

and restart the OC4J. can be any prefix of your choice that will be used to access your PL/SQL applications. For example, if you set it to /pls, you will access your PL/SQL applications through the JOPA
Servlet as http://server/pls///. is customizable,
too (see below.)
When you restart OC4J, the jopa.war archive will be automatically expanded into the
{oc4jhome}/j2ee/home/applications/jopa/ directory. You now need to modify the WEB-INF/web.xml file in that directory to set correct value for the cfgfile servlet initialization parameter. Locate


tags in the web.xml file and alter the {path_to_config_file} tag to contain full path to the servlet configuration file (default is jopa.cfg with no path, which resolves to the directory, from which the JRE was started). You can store the configuration file anywhere on your file system. The default configuration file will be in {oc4jhome}/j2ee/home/applications/jopa/ directory when OC4J auto-extracts the WAR archive, so you can set the tag to {oc4jhome}/j2ee/home/applications/jopa/jopa.cfg
to use the default configuration file. The servlet is now ready – OC4J will automatically reload the application configuration and re-deploy the servlet when you save the web.xml file.
You can also alter to use in gateway access URLs by modifying the tag value under tag in the web.xml file. Locate


tags in the web.xml file and edit the contents of the tag. After you save the file, OC4J will automatically re-deploy the servlet on next access and new mapping will be used. Default mapping is /jpls/*, so by default you will access your PL/SQL applications through an URL similar to this:
Apache Tomcat 5.x.x is the JServ offspring fully conformant to the J2EE 1.3 and later specifications. Deployment to the Tomcat server is very simple:
Copy the jopa.war file to the {CATALINA_HOME}/webapps directory or upload it through the Tomcat management interface. The Tomcat server will detect the new WAR and deploy it automatically. However, before the JOPA Servlet can be used, you need to edit the WEB-INF/web.xml file in the {CATALINA_HOME}/webapps/jopa directory, where the servlet will be automatically deployed, and set cfgfile initialization parameter to contain correct full path to the JOPA configuration file. Save the web.xml file and the Servlet will be fully functional.
Click Here to Download this document
email us
Copyright © 2000-2019 by HitMedia LLC. All Rights Reserved.