Oracle Application Server Containers for J2EE User's Guide 10g (9.0.4) Part Number B10322-01 |
|
This appendix contains complete information about the following topics:
Most of these sections discuss how to modify your XML files. Modify all XML files only through Oracle Enterprise Manager. Do not modify XML files on a single node.
OC4J uses configuration and deployment XML files. The following sections describe each of these files and their function.
This section describes the following XML files, which are necessary for OC4J configuration:
This file contains the configuration for the application server. The server.xml
file is the root configuration file--it contains references to other configuration files. In this file, specify the following:
data-sources.xml
configuration
Specify these locations by adding entries that list the location of the Web site configuration files. You can have multiple Web sites. The default-web-site.xml
file defines a default Web site; therefore, there is only one of these XML files. All other Web sites are defined in web-site.xml
configuration files. Register each Web site within the server.xml
file, as follows:
<web-site path="./default-web-site.xml" /> <web-site path="./another-web-site.xml" />
Specify the applications that run on the container in the server.xml
file. You can have as many application directories as you want, and they do not have to be located under the OC4J installation directory.
This file contains the configuration for a Web site. In the default-web-site.xml
file, specify the following:
/~user/ sites
)
This file contains security information for the OC4J server. It defines the user and group configuration for employing the default JAZNUserManager
. In the jazn-data.xml
file, specify the following:
This file contains security information for the OC4J server. It defines the user and group configuration for employing the XMLUserManager
, which is no longer the default security manager. In the principals.xml
file, specify the following:
This file contains configuration for the data sources that are used. In addition, it contains information on how to retrieve JDBC connections. In the data-sources.xml
file, specify the following:
This file contains the configuration for the OC4J Java Message Service (JMS) implementation. In the jms.xml
file, specify the following:
This file contains configuration for the Remote Method Invocation (RMI) system. It contains the setting for the RMI listener, which provides remote access for EJBs. In the rmi.xml
file, specify the following:
The OC4J-specific deployment XML files contain deployment information for different components. If you do not create the OC4J-specific files, they are automatically generated when the application is deployed. You can edit OC4J-specific deployment XML files manually. OC4J uses these files to map environment entries, resources references, and security-roles to actual deployment-specific values.
This section describes the following XML files necessary for J2EE application deployment:
This file identifies the Web or EJB applications that are contained within the J2EE application. See "Elements in the application.xml File" for a list of the elements.
This file configures the global application. In the orion-application.xml
file, specify the following:
See "Elements in the orion-application.xml File" for a list of the elements.
This file defines the deployment parameters for the EJBs in this JAR file. See the Sun Microsystems EJB specification for a description of these elements.
This file is the OC4J-specific deployment descriptor for EJBs. In the orion-ejb-jar.xml
file, specify the following:
See the appendix in the Oracle Application Server Containers for J2EE Enterprise JavaBeans Developer's Guide for description of the elements.
This file contains deployment information about the servlets and JSPs in this application. See the Sun Microsystems specifications for a description of these elements.
This is the OC4J-specific deployment descriptor for mapping Web settings. This XML file contains the following:
See the appendix in the Oracle Application Server Containers for J2EE Servlet Developer's Guide for description of the elements.
This file contains JNDI information for accessing the server application and other client information. See "Elements in the application-client.xml File" for a list of the elements.
This OC4J-specific deployment file is for the client application. It contains JNDI mappings and entries for the client. See "Elements in the orion-application-client.xml File" for a list of the elements.
The server.xml
file is where you perform the following tasks:
Configuring the OC4J server includes defining the following elements in the server.xml
file:
Referencing other configuration files in the server.xml
file includes specifying the following:
Several XML files and directories are defined in the server.xml
file. The path to these files or directories can be relative or absolute. If relative, the path should be relative to the location of the server.xml
file.
The top level element of the server.xml
file is the <application-server>
element.
<application-server>
This element contains the configuration for an application server.
Attributes:
application-auto-deploy-directory=".../applications/auto"
--Specifies the directory from which EAR files are automatically detected and deployed by the running OC4J server. In addition, it performs the Web application binding for the default Web site.
auto-start-applications="true|false"
--If set to true
, all applications defined in the <applications>
elements are automatically started when the OC4J server is started. If set to false
, the applications are not started unless their auto-start
attribute is set to true
. The default for auto-start-applications
is true
.
application-directory=".../applications"
-- Specifies a directory in which to store applications (EAR files). If none is specified (the default), OC4J stores the information in j2ee/home/applications
.
deployment-directory=".../application-deployments"
--Specifies the master location where applications that are contained in EAR files are deployed. The location defaults to j2ee/home/application-deployments/
.
connector-directory
--The location and file name of the oc4j-connectors.xml
file.
check-for-updates="true|false"
--This attribute is only used for standalone OC4J.
recovery-procedure="automatic|prompt|ignore"
-- Specifies how the EJB container reacts for recovery if an error occurred in the middle of a global transaction (JTA). If a CMP bean is in the middle of a global transaction, the EJB container saves the transactional state to a file. The next time OC4J is started, these attributes specify how to recover the JTA transaction.
automatic
-- automatically attempts recovery (the default)
prompt
-- prompts the user (system in/out)
You may notice a prompt for recovery even if no CMP beans were executing. This is because the OC4J server asks for permission to see if there was anything to recover.
ignore
-- ignores recovery (useful in development environments or if you are never executing a CMP entity bean)
taskmanager-granularity=
milliseconds.
The task manager is a background process that performs cleanup. However, the task manager can be expensive. You can manage when the task manager performs its duties through this attribute, which sets how often the task manager is kicked off for cleanup. Value is in milliseconds. Default is 1000 milliseconds.
Within the <application-server>
element, the following elements, which are listed alphabetically and not by DTD ordering, can be configured:
<application>
An application is a entity with its own set of users, Web applications, and EJB JAR files.
Attributes:
auto-start="true|false"
-- Specifies whether the application should be automatically started when the OC4J server starts. The default is true
. Setting auto-start
to false
is useful if you have multiple applications installed and want them to start on demand. This can improve general server startup time and resource usage.
deployment-directory=".../application-deployments/myapp"
-- Specifies a directory to store application deployment information. If none is specified (the default), OC4J looks in the global deployment-directory
, and if none exists there, it stores the information inside the EAR file. The path can be relative or absolute. If relative, the path should be relative to the location of the server.xml
file.
name="anApplication"
-- Specifies the name used to reference the application.
parent="anotherApplication"
-- The name of the optional parent application. The default is the global application. Children see the namespace of its parent application. This is used to share services such as EJBs among multiple applications.
path=".../applications/myApplication.ear" />
-- The path to the EAR file containing the application code. In this example, the EAR file is named myApplication.ear
.
<compiler>
This element is deprecated for version 9.0.4 and forward. See the <java-compiler>
element for the alternative. For previous releases, it specifies an alternative compiler (such as Jikes) for EJB/JSP compiling.
Attributes:
classpath="/my/rt.jar"
-- Specifies an alternative/additional classpath when compiling. Some compilers need an additional classpath (such as Jikes, which needs the rt.jar
file of the Java 2 VM to be included).
executable="jikes" />
-- The name of the compiler executable to use, such as Jikes or JVC.
<cluster>
Cluster settings for this server.
Attribute:
<execution-order>
Defines the ordering of how the startup classes are executed. Value is an integer. OC4J loads from 0 on up. If duplicate numbers, OC4J chooses the ordering for those classes.
<global-application>
The default application for this server. This acts as a parent to other applications in terms of object visibility.
Attributes:
path=".../application.xml" />
-- Specifies the path to the global application.xml
file, which contains the settings for the default application. An application.xml
file exists for each application as the standard J2EE application descriptor file, which is different than this file. This application.xml
may have the same name, but it exists to provide global settings for all J2EE applications.
<global-thread-pool>
You can specify unbounded, one, or two thread pools for an OC4J process through this element. If you do not specify this element, then an infinite number of threads can be created. See "Thread Pool Settings" for a full description.
Attributes:
min
--The minimum number of threads that OC4J can simultaneously execute. By default, a minimum number of threads are preallocated and placed in the thread pool when the container starts. Value is an integer. The default is 20. The minimum value you can set this to is 10.
max
--The maximum number of threads that OC4J can simultaneously execute. New threads are spawned if the maximum size is not reached and if there are no idle threads. Idle threads are used first before a new thread is spawned. Value is an integer. The default is 40.
queue
--The maximum number of requests that can be kept in the queue. Value is an integer. The default is 80.
keepAlive
--The number of milliseconds to keep a thread alive (idle) while waiting for a new request. This timeout designates how long an idle thread remains alive. If the timeout is reached, the thread is destroyed. The minimum time is a minute. Time is set in milliseconds. To never destroy threads, set this timeout to a negative one.
Value is a long. The default is 600000 milliseconds.
cx-min
--The minimum number of connection threads that OC4J can simultaneously execute. Value is an integer. The default is 20. The minimum value you can set this to is 10.
cx-max
--The maximum number of connection threads that OC4J can simultaneously execute. Value is an integer. The default is 40.
cx-queue
--The maximum number of connection requests that can be kept in the queue. Value is an integer. The default is 80.
cx-keepAlive
--The number of milliseconds to keep a connection thread alive (idle) while waiting for a new request. This timeout designates how long an idle thread remains alive. If the timeout is reached, the thread is destroyed. The minimum time is a minute. Time is set in milliseconds. To never destroy threads, set this timeout to a negative one.
Value is a long. The default is 600000 milliseconds.
debug
--If true, print the application server thread pool information at startup. The default is false.
<global-web-app-config>
Attributes:
<init-library>
Attributes:
path
-- The path in which the startup and shutdown classes are located. The path indicates the directory in which the class resides or the directory and JAR filename of the JAR where the class is archived. If more than one directory or JAR file exists, then supply an <init-library>
element for each directory and JAR filename.
<init-library path="../xxx">
<init-param>
Attributes:
<javacache-config>
Attributes:
path
--Specifies the path to the javacache.xml
file.
<javacache-config path="../../../javacache/admin/javacache.xml" />
<java-compiler>
You can specify an alternative compiler--either in or out of process--for your JSP and EJB compilation. The default compiler is an out of process javac
compiler found in the JDK bin
directory.
Attributes:
name
--Specify the name of the compiler to use. Valid compiler names are as follows:
These names are defined as follows:
in-process
--If true, the compiler is to run in process. If false, the compiler runs out of the process. Most compilers can execute both in and out of the process. The exceptions are as follows:
encoding
--Specify the type of character encoding for the source file, such as UTF-8, EUCJIS, or SJIS. Encoding is only supported by the javac
compiler. The default is determined by the language version of the JVM that is installed.
bindir
--Provide the absolute path to the compiler directory. You do not need to specify this attribute for javac
, modern
, or classic
as the JDK bin directory is searched for this compiler.
The syntax is specific to the operating system platform:
jikes
, which is in /usr/local/bin/jikes
, then specify the following:
name="jikes" bindir="/usr/local/bin"
jikes
, which is located in c:\jdk1.3.1\bin\jikes.exe
, specify the following:
name="jikes" bindir="c:\\jdk1.3.1\\bin"
extdirs
--Specifies extension directories that the compilation uses to compile against. The default is your JDK extension directories. Multiple directories can be specified, each separated by a colon. Each JAR
archive in the specified directories are searched for class files. You can specify certain directories to be searched by modifying the -Djava.ext.dirs
system property. The jikes
compiler requires that extension directories are specified in either this attribute or in the -Djava.ext.dirs
system property.
The following are four examples of how to define alternate compilers in this element:
<java-compiler name="jikes" bindir="C:\java\jikes\bin" in-process="false" /> <java-compiler name="ojc" bindir="C:\java\jdev\jdev\bin" in-process="false"/> <java-compiler name="classic" in-process="true" /> <java-compiler name="modern" in-process="true" />
<jms-config>
Attribute:
<log>
<file
>
Attribute:
path=".../log/server.log"
-- Specifies a relative or absolute path to a file where log events are stored.
<mail
>
An e-mail address where log events are forwarded. You must also specify a valid mail-session if you use this option.
Attribute:
<odl>
The ODL log entries are each written out in XML format in its respective log file. The log files have a maximum limit. When the limit is reached, the log files are overwritten.
When you enable ODL logging, each message goes into its respective log file, named log
N
.xml
, where N is a number starting at one. The first log message starts the log file, log1.xml
. When the log file size maximum is reached, the second log file is opened to continue the logging, log2.xml
. When the last logfile is full, the first log file, log1.xml
is erased and a new one is opened for the new messages. Thus, your log files are constantly rolling over and do not encroach on your disk space.
Attributes:
path
: Path and folder name of the log folder for this area. You can use an absolute path or a path relative to where the configuration XML file exists, which is normally in the j2ee/home/config
directory. This denotes where the log files will reside for the feature that the XML configuration file is concerned with. For example, modifying this element in the server.xml
file denotes where the server log files are written.
max-file-size
: The maximum size in KB of each individual log file.
max-directory-size
: The maximum size of the directory in KB. The default directory size is 10 MB.
New files are created within the directory, until the maximum directory size is reached. Each log file is equal to or less than the maximum specified in the attributes.
<max-http-connections>
Used to define the maximum number of concurrent connections any given Web site can accept at a single point in time. If text exists inside the tag, it is used as a redirect-URL when the limit is reached.
Attributes:
max-connections-queue-timeout="10"
-- When the maximum number of connections are reached, this is the number of seconds that can pass before the connections are dropped and a message is returned to the client stating that the server is either busy or connections will be redirected. The default is 10 seconds.
socket-backlog
-- The number of connections to queue up before denying connections at the socket level. The default is 30.
value
-- The maximum number of connections.
<rmi-config>
Attribute:
<sep-config>
The <sep-config>
element in this file specifies the pathname, normally internal-settings.xml
, for the server extension provider properties.
Attribute:
<sfsb-config>
Passivation for stateful session beans is automatically done, unless you set the enable-passivation
attribute for this element to false. For more information on stateful session bean passivation, see the Advanced chapter in the Oracle Application Server Containers for J2EE Enterprise JavaBeans Developer's Guide.
Attribute
enable-passivation
--Default is true, which means that stateful session bean passivation occurs. If you have a situation where your stateful session beans are not in a state to be passivated, set this attribute to false.
<shutdown-classes>
Shutdown classes can be defined by the user, and are executed after undeployment, but before the core services are stopped.
<shutdown-class>
Each startup class is defined within the <startup-class>
element.
Attributes:
<startup-classes>
Startup classes can be defined by the user, and will be executed after the core services (JMS, RMI) are started, but before applications are deployed. The shutdown classes are executed after undeployment, but before the core services are stopped.
<startup-class>
Each startup class is defined within the <startup-class>
element.
Attributes:
classname
--The classname of the user-defined startup class.
failure-is-fatal
--If true, if an exception is thrown, then OC4J logs the exception and exit. If false, OC4J logs the exception and then continues. Default is false.
<transaction-config
>
Transaction configuration for the server.
Attribute:
timeout="30000"
-- Specifies the maximum amount of time (in milliseconds) that a transaction can take to finish before it is rolled back due to a timeout. The default value is 30000. This timeout will be a default timeout for all transactions that are started in OC4J. You can change it by using the dynamic API--UserTransaction.setTransactionTimeout(milliseconds)
.
<web-site>
Attribute:
path
-- The path to a *web-site.xml
file that defines a Web site. For each Web site, you must specify a separate *web-site.xml
file. This example shows that a Web site is defined in the my-web-site.xml
file.
path=".../my-web-site.xml"
The top level element of the application.xml
file is the <application>
element.
Within the <application>
element, the following elements, which are listed alphabetically and not by DTD ordering, can be configured:
<alt-dd>path/to/dd</alt-dd>
The alt-dd
element specifies an optional URI to the post-assembly version of the deployment descriptor file for a particular J2EE module. The URI must specify the full pathname of the deployment descriptor file relative to the application's root directory. If alt-dd is not specified, the deployer must read the deployment descriptor from the default location and file name required by the respective component specification.
<connector>context</connector>
The connector
element specifies the URI of a resource adapter archive file, relative to the top level of the aplication package.
<context-root>thedir/</context-root>
The context-root
element specifies the context root of a web application.
<description>A description.</description>
The description
element provides a human readable description of the application. The description
element should include any information that the application assembler wants to provide the deployer.
<display-name>The name.</display-name>
The display-name
element specifies an application name. The application name is assigned to the application by the application assembler and is used to identify the application to the deployer at deployment time.
<ejb>pathToEJB.jar</ejb>
The ejb
element specifies the URI of a EJB JAR, relative to the top level of the application package.
<icon>
The icon
element contains a small-icon
and a large-icon
element which specify the location within the application for a small and large image used to represent the application in a GUI tool.
<java>pathToClient.jar</java>
The java
element specifies the URI of a Java application client module, relative to the top level of the application package.
<large-icon>path/to/icon.gif</large-icon>
The large-icon
element contains the location within the application of a file containing a large (32x32 pixel) icon image. The image must be either GIF or JPEG format and the filename must end with the extension of ".gif
" or ".jpg
".
<module>
The module
element represents a single J2EE module and contains an EJB, Java, or Web element, which indicates the module type and contains a path to the module file, and an optional alt-dd
element, which specifies an optional URI to the post-assembly version of the deployment descriptor. The application deployment descriptor must have one module element for each J2EE module in the application package.
<role-name>nameOfRole</role-name>
The name of the role.
<security-role>
The security-role
element contains the definition of a security role which is global to the application. The definition consists of a description of the security role, and the security role name. The descriptions at this level override those in the component level security role definitions and must be the descriptions tool display to the deployer.
<small-icon>path/to/icon.gif</small-icon>
The small-icon
element contains the location within the application of a file containing a small (16x16 pixel) icon image. The image must be either GIF or JPEG format and the filename must end with the extension of ".gif
" or ".jpg
".
<web>
The web
element contains the web-uri
and context-root
of a Web application module.
<web-uri>pathTo.war</web-uri>
The web-uri
element specifies the URI of a web application file, relative to the top level of the application package.
The top level element of the orion-application.xml
file is the <orion-application>
element.
Attributes:
autocreate-tables
- Whether or not to automatically create database tables for CMP beans in this application. The default is true.
autodelete-tables
- Whether or not to automatically delete old database tables for CMP beans when redeploying in this application. The default is false.
default-data-source
- The default data source to use if other than server default. This must point to a valid CMT data source for this application if specified.
deployment-version
- The version of OC4J that this JAR was deployed against, if it is not matching the current version then it will be redeployed. This is an internal server value; do not edit.
treat-zero-as-null
- Whether or not to treat read zero's as null's when they represent primary keys. The default is false.
Within the <orion-application>
element, the following elements, which are listed alphabetically and not by DTD ordering, can be configured:
<argument value="theValue" />
An argument used when invoking the client.
Attribute:
<arguments>
A list of arguments to used when invoking the application client if starting it in-process (auto-start="true").
<client-module auto-start="true|false" deployment-time="073fc2ab513bc3ce" path="myappclient.jar" user="theUser">
An application client module of the application. An application client is a GUI or console-based standalone client that interacts with the server.
Attributes:
auto-start
- Whether or not to auto-start the client (in-process) at server startup. The default is false.
deployment-time
- Last deploy time attribute. Internal to OC4J; do not edit.
path
- The path (relative to the enterprise archive or absolute) to the application-client.
user
- User to run the client as if run in-process (autostart="true"). Must be specified if auto-start is activated.
<commit-coordinator>
Configure the two-phase commit engine.
<commit-class class="com.evermind.server.OracleTwoPhaseCommitDriver" />
Attribute:
<connectors path="./oc4j-connectors.xml" />
Attribute:
path
- The name and path of the oc4j-connectors.xml
file. If no <connectors>
element is specified, then the default path is $OC4J_HOME/connectors/
rarname
./oc4j-connectors.xml
.
<data-sources path="./data-sources.xml" />
Attribute:
<description>A short description</description>
A short description of this component.
<ejb-module path="myEjbs.jar" remote="true|false" />
An EJB JAR module of the application.
Attributes:
path
- The path (relative to the enterprise archive or absolute) to the ejb-jar.
remote
- true
/false
value stating whether or not to activate the EJB instances on this node or to look them up remotely from another server (remote or inside a cluster). The default is false.
<file path="../log/server.log" />
A relative/absolute path to log events to.
Attribute:
<group name="theGroup" />
A group that this security-role-mapping implies. That is, all members of the specified group are included in this role.
Attribute:
<jazn provider="XML" location="./jazn-data.xml" />
Configure the OracleAS JAAS Provider to use the XML-based provider type.
Attributes:
location
- Path to file. For example: ./jazn-data.xml
This can be an absolute path, or a path relative to the jazn.xml
file, where the OracleAS JAAS Provider first looks for the jazn-data.xml
in the directory containing the jazn.xml
file. Optional if jazn.xml
file configured, otherwise Required
persistence
- Values can be NONE
(
Do not persist changes), ALL
(Persist changes after every modification), VM_EXIT - (Default- Persist changes when VM exits)
sample_subrealm
. Optional if only one realm is configured.
<jazn-web-app auth-method="SSO" runas-mode="false" doasprivileged-mode="true" />
The filter element of JAZNUserManager
.
Attributes:
auth-method
- Set auth-method to SSO (single sign-on). If you do not set this parameter, it defaults to null.
runas-mode
and doasprivileged-mode
settings are described in Table A-1. See the Oracle Application Server Containers for J2EE Security Guide for more information.
Table A-1 runas-mode and doasprivileged-mode Settings
<library path="../lib/" />
A relative/absolute path/URL to a directory or a JAR/ZIP to add as a library-path for this server. Directories are scanned for JARS/ZIP files to include at startup.
Attribute:
<log>
Logging settings.
<odl>
The ODL log entries are each written out in XML format in its respective log file. The log files have a maximum limit. When the limit is reached, the log files are overwritten.
When you enable ODL logging, each message goes into its respective log file, named log
N
.xml
, where N is a number starting at one. The first log message starts the log file, log1.xml
. When the log file size maximum is reached, the second log file is opened to continue the logging, log2.xml
. When the last logfile is full, the first log file, log1.xml
is erased and a new one is opened for the new messages. Thus, your log files are constantly rolling over and do not encroach on your disk space.
Attributes:
path
: Path and folder name of the log folder for this area. You can use an absolute path or a path relative to where the configuration XML file exists, which is normally in the j2ee/home/config
directory. This denotes where the log files will reside for the feature that the XML configuration file is concerned with. For example, modifying this element in the server.xml
file denotes where the server log files are written.
max-file-size
: The maximum size in KB of each individual log file.
max-directory-size
: The maximum size of the directory in KB. The default directory size is 10 MB.
New files are created within the directory, until the maximum directory size is reached. Each log file is equal to or less than the maximum specified in the attributes.
<mail address="my@mail.address" />
An e-mail address to log events to. A valid mail-session also needs to be specified if this option is used.
Attribute:
<mail-session location="mail/TheSession" smtp-host="smtp.server.com">
The session SMTP-server host (if using SMTP).
Attributes:
location
- The location in the namespace to store the session at.
smtp-host
- The session SMTP-server host (if using SMTP).
<namespace-access>
Namespace (naming context) security policy for RMI clients.
<namespace-resource root="the/path">
A resource with a specific security setting.
Attribute:
<password-manager>
Specifies the UserManager
that is used for the lookup of hidden passwords. If omitted, the current UserManager
is used for authentication and authorization. For example, you can use a OracleAS JAAS Provider LDAP UserManager
for the overall UserManager
, but use a OracleAS JAAS Provider XML UserManager
for checking hidding passwords.
To identify a UserManager
, provide a <jazn>
element definition within this element, as follows:
<password-manager> <jazn ...> </password-manager>
<persistence path="./persistence" />
A relative (to the application root) or absolute path to a directory where application state should be stored across restarts.
Attribute:
<principals path="principals.xml" />
Attribute:
<property name="theName" value="theValue" />
Contains a name/value pair initialization param.
Attributes:
<read-access>
The read-access policy.
<resource-provider>
Define a JMS resource provider. To add a custom <resource-provider>
, add the following to your orion-application.xml file:
<resource-provider class="providerClassName
" name="JNDI name
"> <description>description
</description> <property name="name
" value="value
" /> </resource-provider>
In place of the user-replaceable constructs (those in italics) in the preceding code, do the following:
providerClassName
of the class
attribute with the name of the resource-provider class.
JNDI name
of the name
attribute with a name by which to identify the resource provider. This name will be used in finding the resource provider in the application's JNDI as "java:comp/resource/name/
".
description
of the description
tag with a description of the specific resource provider.
name
and value
of the corresponding attributes with the same name in any property tags that the specific resource provider needs to be given as parameters.
<security-role-mapping impliesAll="true|false" name="theRole">
The runtime mapping (to groups and users) of a role. Maps to a security-role of the same name in the assembly descriptor.
Attributes:
impliesAll
- Whether or not this mapping implies all users. The default is false.
name
- The name of the role
<user name="theUser" />
A user that this security-role-mapping implies.
Attribute:
<user-manager class="com.name.of.TheUserManager" display-name="Friendly UserManager name">
Specifies an optional user-manager to use. For example, user-managers are com.evermind.sql.DataSourceUserManager
, com.evermind.ejb.EJBUserManager
, and so on. These are used to integrate existing systems and provide custom user-managers for Web applications.
Attributes:
class
- The fully qualified classname of the user-manager.
display-name
- A descriptive name for this UserManager
instance.
<web-module id="myWebApp" path="myWebApp.war" />
A Web application module of the application. Each Web application can be installed on any site and in any context on those sites (for instance http://www.myserver.com/myapp/
).
Attributes:
id
- The name used to reference this web-application when used in web-sites etc.
path
- The path (relative to the enterprise archive or absolute) to the web-application.
<write-access>
The write access policy.
The top level element of the application-client.xml
file is the <application-client>
element.
<application-client>
The application-client
element is the root element of an application client deployment descriptor. The application client deployment descriptor describes the EJB components and external resources referenced by the application client.
Within the <application-client>
element, the following elements, which are listed alphabetically and not by DTD ordering, can be configured:
<callback-handler>
The callback-handler
element names a class provided by the application. The class must have a no args constructor and must implement the javax.security.auth.callback.CallbackHandler
interface. The class will be instantiated by the application client container and used by the container to collect authentication information from the user.
<description>The description</description>
A short description.
<display-name>The name</display-name>
The display-name
element contains a short name that is intended to be displayed by tools.
<ejb-link>EmployeeRecord</ejb-link>
The ejb-link
element is used in the ejb-ref
element to specify that an EJB reference is linked to an enterprise bean in the encompassing J2EE Application package. The value of the ejb-link
element must be the ejb-name
of an enterprise bean in the same J2EE Application package.
<ejb-ref>
The ejb-ref
element is used for the declaration of a reference to an enterprise bean's home. The declaration consists of an optional description; the EJB reference name used in the code of the referencing application client; the expected type of the referenced enterprise bean; the expected home and remote interfaces of the referenced enterprise bean; and an optional ejb-link
information. The optional ejb-link element is used to specify the referenced enterprise bean.
<ejb-ref-name>ejb/Payroll</ejb-ref-name>
The ejb-ref-name
element contains the name of an EJB reference. The EJB reference is an entry in the enterprise bean's environment. It is recommended that name is prefixed with "ejb
/".
<ejb-ref-type>Entity/Session</ejb-ref-type>
The ejb-ref-type
element contains the expected type of the referenced enterprise bean. The ejb-ref-type
element must be one of the following: Entity Session
<env-entry>
The env-entry
element contains the declaration of an Enterprise JavaBean's environment entries. The declaration consists of an optional description, the name of the environment entry, and an optional value.
<env-entry-name>minAmount</env-entry-name>
The env-entry-name
element contains the name of an Enterprise JavaBean's environment entry.
<env-entry-type>java.lang.String</env-entry-type>
The env-entry-type
element contains the fully-qualified Java type of the environment entry value that is expected by the enterprise bean's code. The following are the legal values of env-entry-type
: java.lang.Boolean
, java.lang.String
, java.lang.Integer,
java.lang.Double
, java.lang.Byte
, java.lang.Short
, java.lang.Long
, and java.lang.Float
.
<env-entry-value>100.00</env-entry-value>
The env-entry-value
element contains the value of an Enterprise JavaBean's environment entry.
<home>com.aardvark.payroll.PayrollHome</home>
The home
element contains the fully-qualified name of the Enterprise JavaBean's home interface.
<icon>
The icon
element contains a small-icon
and large-icon
element which specify the URIs for a small and a large GIF or JPEG icon image used to represent the application client in a GUI tool.
<large-icon>lib/images/employee-service-icon32x32.jpg
</large-icon>
The large-icon
element contains the name of a file containing a large (32 x 32) icon image. The file name is a relative path within the application client JAR file. The image must be either in the JPEG or GIF format, and the file name must end with the suffix ".jpg
" or ".gif
" respectively. The icon can be used by tools.
<remote>com.wombat.empl.EmployeeService</remote>
The remote
element contains the fully-qualified name of the Enterprise JavaBean's remote interface.
<res-auth>Application/Container</res-auth>
The res-auth
element specifies whether the Enterprise JavaBean code signs on programmatically to the resource manager, or whether the Container will sign on to the resource manager on behalf of the bean. In the latter case, the Container uses information that is supplied by the Deployer. The value of this element must be one of the two following: Application
or Container
<resource-env-ref>
The resource-env-ref
element contains a declaration of an application's reference to an administered object associated with a resource in the application's environment. It consists of an optional descrioption, the resource environment reference name, and an indication of the resource environment reference type expected by the application code.
<resource-env-ref-name>
The resource-env-ref-name
element specifies the name of a resource environment entry name used in the application code.
<resource-env-ref-type>
The resource-env-ref-type
element specifies the type of a resource environment reference.
<resource-ref>
The resource-ref
element contains a declaration of Enterprise JavaBean's reference to an external resource. It consists of an optional description, the resource factory reference name, the indication of the resource factory type expected by the enterprise bean code, and the type of authentication (Bean
or Container
).
<res-ref-name>name</res-ref-name>
The res-ref-name
element specifies the name of a resource factory reference.
<res-sharing-scope>Shareable</res-sharing-scope>
The res-sharing-scope
element specifies whether connections obtained through the given resource manager connection factory reference can be shared. The value of this element, if specified, must be one of the following: Shareable
or Unshareable
. The default value is Shareable
.
<res-type>javax.sql.DataSource</res-type>
The res-type
element specifies the type of the data source. The type is specified by the Java interface (or class) expected to be implemented by the data source.
<small-icon>lib/images/employee-service-icon16x16.jpg
</small-icon>
The small-icon
element contains the name of a file containing a small (16 x 16) icon image. The file name is a relative path within the application client JAR file. The image must be either in the JPEG or GIF format, and the file name must end with the suffix ".jpg
" or ".gif
" respectively. The icon can be used by tools.
The top level element of the orion-application-client.xml
file is the <orion-application-client>
element.
<orion-application-client>
An orion-application-client.xml
file contains the deploy time information for a J2EE application client. It complements the application client assembly information found in application-client.xml
.
Within the <orion-application-client>
element, the following elements, which are listed alphabetically and not by DTD ordering, can be configured:
<context-attribute name="name" value="value" />
An attribute sent to the context. The only mandatory attribute in JNDI is the 'java.naming.factory.initial
,' which is the classname of the context factory implementation.
Attributes:
<ejb-ref-mapping location="ejb/Payroll" name="ejb/Payroll" />
The ejb-ref
element is used for the declaration of a reference to another enterprise bean's home. The ejb-ref-mapping
element ties this to a JNDI-location when deploying.
Attributes:
location
- The JNDI location to look up the EJB home from.
name
- The ejb-ref
name. Matches the name of an ejb-ref in application-client.xml
.
<env-entry-mapping name="theName">deploymentValue</env-entry-mapping>
Overrides the value of an env-entry
in the assembly descriptor. It is used to keep the EAR (assembly) clean from deployment-specific values. The body is the value.
Attributes:
<lookup-context location="foreign/resource/location">
The specification of an optional javax.naming.Context
implementation used for retrieving the resource. This is useful when hooking up with third party modules, such as a third party JMS server for instance. Either use the context implementation supplied by the resource vendor or if none exists write an implementation which in turn negotiates with the vendor software.
Attributes:
<resource-env-ref-mapping location="jdbc/TheDS" >
The resource-env-ref
element is used for the declaration of a reference to an external resource, such as a data source, JMS queue, mail session, or similar. The resource-env-ref-mapping
ties that element to a JNDI location during deployment.
Attributes:
<resource-ref-mapping location="jdbc/TheDS" name="jdbc/TheDSVar">
The resource-ref
element is used for the declaration of a reference to an external resource such as a data source, JMS queue, mail session or similar. The resource-ref-mapping
ties this to a JNDI-location when deploying.
Attributes:
location
- The JNDI location to look up the resource home from.
name
- The resource-ref
name. Matches the name of an resource-ref
in application-client.xml
.
The following example shows how to configure and deploy a J2EE application within OC4J. See "Deploying Applications" to learn how to modify the XML configuration files for the FAQ demo.
In this example, the myapp
application contains a Java client, an EJB assembled into a JAR file, servlets and JSPs assembled into a WAR file, and an EAR file that contains both the EJB JAR file and the Web application WAR file. The tree structure showing the location of all the XML configuration files, the Java class files, and the JSP files is shown in Figure A-1. Notice that you can separate all the configuration files into logical directories within the application directory.
The myapp/META-INF/application.xml
file lists the EJB JAR and Web application WAR file that is contained in the EAR file using the <module>
elements.
<?xml version="1.0"?> <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/j2ee/dtds/application_1_3.dtd"> <application> <display-name>myapp j2ee application</display-name> <description> A sample J2EE application that uses a Container Managed Entity Bean and JSPs for a client. </description> <module><ejb>myapp-ejb.jar</ejb>
</module> <module> <web><web-uri>myapp-web.war</web-uri>
<context-root>/myapp</context-root> </web> </module> </application>
The myapp/web/WEB-INF/web.xml
file contains the class definitions for EJBs, servlets, and JSPs that are executed within the Web site. The myapp
Web module specifies the following in its descriptor:
http://<host>:<port>/j2ee/myapp
)
<servlet-mapping>
element (/template
) off of the application root context
The Web server looks for the following:
WEB-INF/classes/<package>.<class>
.
<web-app name="<warfile.war>">
in the web-site.xml
file, which is packaged in the deployed corresponding application EAR file.
java
into .class
the first time it is used and caches it for subsequent use.
<web-app> <display-name>myapp web application</display-name> <description> Web module that contains an HTML welcome page, and 4 JSP's. </description> <welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list> <ejb-ref> <ejb-ref-name>TemplateBean</ejb-ref-name> <ejb-ref-type>Entity</ejb-ref-type> <home>TemplateHome</home> <remote>Template</remote> </ejb-ref> <servlet> <servlet-name>template</servlet-name> <servlet-class>TemplateServlet</servlet-class> <init-param> <param-name>length</param-name> <param-value>1</param-value> </init-param> </servlet> </web-app>
The ejb-jar.xml
file contains the definitions for a container-managed persistent EJB. The myapp
EJB deployment descriptor contains the following:
TemplateBean
, and columns are named according to fields in the ejb-jar.xml
descriptor and type mappings in j2ee/home/config/database-schemas/oracle.xml
.
data-source.xml
, by ejb-location
or by default-data-source
in orion-application.xml
.
<ejb-jar> <display-name>myapp</display-name> <description> An EJB app containing only one Container Managed Persistence
Entity Bean </description> <enterprise-beans> <entity> <description> template bean populates a generic template table. </description> <display-name>TemplateBean</display-name> <ejb-name>TemplateBean</ejb-name> <home>TemplateHome</home> <remote>Template</remote> <ejb-class>TemplateBean</ejb-class> <persistence-type>Container</persistence-type> <prim-key-class>java.lang.Integer</prim-key-class> <reentrant>False</reentrant> <cmp-field><field-name>empNo</field-name></cmp-field> <cmp-field><field-name>empName</field-name></cmp-field> <cmp-field><field-name>salary</field-name></cmp-field> <primkey-field>empNo</primkey-field> </entity> </enterprise-beans> <assembly-descriptor> <container-transaction> <method> <ejb-name>TemplateBean</ejb-name> <method-name>*</method-name> </method> <trans-attribute>NotSupported</trans-attribute> </container-transaction> <security-role> <description>Users</description> <role-name>users</role-name> </security-role> </assembly-descriptor> </ejb-jar>
When you deploy the application using the deployment wizard, this adds the location of the application EAR file to the server.xml
file. This causes the application to be started every time that OC4J is started. If you do not want the application to be started with OC4J, change the auto-start
variable to FALSE
.
<application name="myapp" path="../myapp/myapp.ear"
auto-start="true" />
where
name
variable is the name of the application.
path
indicates the directory and filename for the EAR file.
auto-start
variable indicates if this application should be automatically started each time OC4J is started.
The deployment wizard defines the root context for the Web application and binds the Web context and adds the following to the default-web-site.xml
file:
<web-app application="myapp" name="myapp-web" root="/myapp" />
name
variable is the name of the WAR file, without the .WAR
extension.
root
variable defines the root context for the application off of the Web site. For example, if you defined your Web site as "http://<host>:7777/j2ee"
, then to initiate the application, you would point your browser at "http://<host>:7777/j2ee/myapp"
.
The application client that accesses the myapp
application has a descriptor, which describes where to find the EJB stubs (home and remote interface) and its JNDI name.
The client XML configuration is contained in two files: application-client.xml
and orion-application-client.xml
.
The application-client.xml
file contains a reference for an EJB, as follows:
<application-client> <display-name>TemplateBean</display-name> <ejb-ref> <ejb-ref-name>TemplateBean</ejb-ref-name> <ejb-ref-type>Entity</ejb-ref-type> <home>mTemplateHome</home> <remote>Template</remote> </ejb-ref> </application-client>
The orion-application-client.xml
file maps the EJB reference logical name to the JNDI name for the EJB. For example, this file maps the <ejb-ref-name>
element, "TemplateBean,"
defined in the application-client.xml
, to the JNDI name, "myapp/myapp-ejb/TemplateBean
", as follows:
<orion-application-client> <ejb-ref-mapping name="TemplateBean" location="myapp/myapp-ejb/TemplateBean" /> </orion-application-client>
Set the JNDI properties for a regular client so it finds the initial JNDI context factory in one of the following manners:
javax.naming.InitialContext.
jndi.properties
file.
If you provide the JNDI properties in the jndi.properties
file, package the properties in myapp-client.jar
to ensure that it is in the CLASSPATH
.
jndi.properties: --------------- java.naming.factory.initial=com.evermind.server.ApplicationClientInitialCont extFactory java.naming.provider.url=
opmn:ormi://<opmnhost>:<oc4j_instance>:7777/j2ee/myapp java.naming.security.principal=admin java.naming.security.credentials=welcome
Package your client module in a JAR file with the descriptor META-INF/application-client.xml
.
Package the client in a runable JAR with a manifest that has the main class to run and required CLASSPATH
, as shown below. Check that the relative paths in this file are correct. Verify that you point to the relative location of the required OC4J class libraries.
manifest.mf ----------- Manifest-Version: 1.0 Main-Class: myapp.myapp-client.TemplateClient Name: "TemplateClient" Created-By: 1.2 (Sun Microsystems Inc.) Implementation-Vendor: "Oracle" Class-Path: ../../../j2ee/home/oc4J.jar ../../../j2ee/home/jndi.jar ../../../j2ee/home/ejb.jar ../myapp-ejb.jar
To execute the client, perform the following:
% java -jar myapp-client.jar TemplateClient.main(): start Enter integer value for col_1: 1 Enter string value for col_2: BuyME Enter float value for col_3: 99.9 Record added through bean
You can set both system properties and command-line options on the OC4J command-line before startup. If OC4J is running, you must restart the instance for these to take effect. All system properties are prefaced with a -D
. For example, -Dhttp.session.debug
. All command-line options are prefaced with a hyphen (-
). For example, -help
.
As described in "Configuring Server Properties" and shown in Figure A-2, the -D
system properties are entered on the Java Options line; the OC4J command-line options are entered on the OC4J Options line.
Command-Line Options | Description |
---|---|
|
Installs the server, activates the Admin account, and rewrites text files to match the OS linefeed, and so on. |
|
Supress standard output. |
|
Specifies a location for the |
|
Rewrites bad XML files (after prompting) as accurately as possible. Warning: If you have corrupt XML files, you may lose data when rewriting if they're badly misformed. Use this command with care. |
|
Specifies a file to route standard output. |
|
Specifies a file to route error output. |
|
Enables backup debugging of thread resources. Enable this only if you have problems that relates to threads getting stuck in critical sections of code. |
-verbosity |
Define an integer between 1 and 10 to set the verbosity level of the message output. Example: |
|
Prints the version and exits. |
|
Prints the help message. |
-D Option | Description |
---|---|
|
Sets the |
|
Sets the external directories to be searched for classes when compiling. |
java.io.tmpdir= |
Default is
The deployment wizard uses 20 MB in swap space of the temp directory for storing information during the deployment process. At completion, the deployment wizard cleans up the temp directory of its additional files. However, if the wizard is interrupted, it may not have the time or opportunity to clean up the temp directory. Thus, you must clean up any additional deployment files from this directory yourself. If you do not, this directory may fill up, which will disable any further deployment. If you receive an |
KeepIIOPCode= |
Default is false. If true, keeps the generated IIOP stub/tie code. |
|
If true, then while cloning an array list, a deep copy is performed. If false, a shallow copy is performed for the array list. Default: true |
dedicated.rmicontext= |
Default is false. This replaces the deprecated This parameter is for the client. You can also set this in the JNDI properties. |
|
For container-managed relationships in entity beans, you can designate if a third database table is used to manage the relationship. Set to false if you do not want a third association table. Default is true. See the "Entity Relationship Mapping" chapter in the Oracle Application Server Containers for J2EE Enterprise JavaBeans Developer's Guide for more information. |
DefineColumnType= |
When you change the value of this option and restart OC4J, it is only valid for applications deployed after the change. Any applications deployed before the change are not affected.
When true, the |
|
The |
oracle.dms.sensors= |
You can set the value for Oracle Application Server built-in performance metrics to the following: none (off), normal (medium amount of metrics), heavy (high number of metrics), or all (every possible metric). The default is normal.This parameter should be set on the OC4J server. The previous method for turning on these performance metrics, |
For more information about debugging properties, see "OC4J Debugging".
|
![]() Copyright © 2002, 2003 Oracle Corporation. All Rights Reserved. |
|