Sun Java logo     Previous      Contents      Index      Next     

Sun logo
Sun Java System Application Server Platform Edition 8 Developer's Guide 

Chapter 5
Deployment Descriptor Files

This chapter describes deployment descriptor files specific to Sun Java System Application Server in the following sections:


Sun Java System Application Server Descriptors

Sun Java System Application Server uses deployment descriptors in addition to the J2EE standard descriptors for configuring features specific to the Sun Java System Application Server. The sun-application.xml and sun-web.xml files are optional; all the others are required.

Each deployment descriptor (or XML) file has a corresponding schema (or DTD) file, which defines the elements, data, and attributes that the deployment descriptor file can contain. For example, the sun-application_1_4-0.dtd schema file defines the structure of the sun-application.xml file. All of the DTD files are located in the install_dir/lib/dtds directory.


Note

Do not edit the DTD files; their contents change only with new versions of Sun Java System Application Server.


For general information about DTD files and XML, see the XML specification at:

http://www.w3.org/TR/REC-xml

The following table lists the Sun Java System Application Server deployment descriptors and their DTD schema files.

Table 5-1  Sun Java System Application Server Descriptors 

Deployment Descriptor

DTD Schema File

Description

sun-application.xml

sun-application_1_4-0.dtd

Configures an entire J2EE application (EAR file).

sun-web.xml

sun-web-app_2_4-0.dtd

Configures a web application (WAR file).

sun-ejb-jar.xml

sun-ejb-jar_2_1-0.dtd

Configures an enterprise bean (EJB JAR file).

sun-cmp-mappings.xml

sun-cmp-mapping_1_1.dtd

Configures container-managed persistence for an enterprise bean.

sun-application-client.xml

sun-application-client_1_4-0.dtd

Configures an Application Client Container (ACC) client (JAR file).

sun-acc.xml

sun-application-client-container_1_0.dtd

Configures the Application Client Container.


Note

The Sun Java System Application Server deployment descriptors must be readable and writable by the file owners.

In each deployment descriptor file, subelements must be defined in the order in which they are listed under each Subelements heading unless otherwise noted.



The sun-application.xml File

This section describes the XML elements in the sun-application.xml file and provides an example file in the following sections:

sun-application

Defines Sun Java System Application Server specific configuration for an application. This is the root element; there can only be one sun-application element in a sun-application.xml file.

Subelements

The following table describes subelements for the sun-application element.

Table 5-2  sun-application Subelements 

Element

Required

Description

web

zero or more

Specifies the application’s web tier configuration.

pass-by-reference

zero or one

Determines whether EJB modules use pass-by-value or pass-by-reference semantics.

unique-id

zero or one

Contains the unique ID for the application.

security-role-mapping

zero or more

Maps a role in the corresponding J2EE XML file to a user or group.

realm

zero or one

Specifies an authentication realm.

web

Specifies the application’s web tier configuration.

Subelements

The following table describes subelements for the web element.

Table 5-3  web Subelements 

Element

Required

Description

web-uri

only one

Contains the web URI for the application.

context-root

only one

Contains the web context root for the application.

web-uri

Contains the web URI for the application. Must match the corresponding element in the application.xml file.

Subelements

none

context-root

Contains the web context root for the application. Overrides the corresponding element in the application.xml file.

If you are setting up load balancing, web module context roots must be unique within a cluster. See the Sun Java System Application Server Administration Guide for more information about load balancing.

Subelements

none

pass-by-reference

Specifies the passing method used by a servlet or enterprise bean calling a remote interface method in another bean that is co-located within the same process.

When a servlet or enterprise bean calls a remote interface method in another bean that is co-located within the same process, by default the Sun Java System Application Server makes copies of all the call parameters in order to preserve the pass-by-value semantics. This increases the call overhead and decreases performance.

However, if the calling method does not mutate the object being passed as a parameter, it is safe to pass the object itself without making a copy of it. To do this, set the pass-by-reference value to true.

The setting of this element in the sun-application.xml file applies to all EJB modules in the application. For an individually deployed EJB module, you can set the same element in the sun-ejb-jar.xml file. If you want to use pass-by-reference at both the bean and application level, the bean level takes precedence. For more information about the sun-ejb-jar.xml file, see The sun-ejb-jar.xml File.

Subelements

none

unique-id

Contains the unique ID for the application. This value is automatically updated each time the application is deployed or redeployed. Do not edit this value.

Subelements

none

security-role-mapping

Maps roles to users and groups. At least one principal or group name is required, but you do not need to have one of each.

Subelements

The following table describes subelements for the security-role-mapping element.

Table 5-4  security-role-mapping Subelements 

Element

Required

Description

role-name

only one

Contains the role-name in the security-role element of the application.xml file.

principal-name

one or more if no group-name, otherwise zero or more

Contains the principal (user) name.

group-name

one or more if no principal-name, otherwise zero or more

Contains the group name.

role-name

Contains the role-name in the security-role element of the application.xml file.

Subelements

none

principal-name

Contains the principal (user) name.

Subelements

none

group-name

Contains the group name.

Subelements

none

realm

Contains the name of the realm used to process all authentication requests associated with this application. If this element is not specified or does not match the name of a configured realm, the default realm is used. For more information about realms, see “Realm Configuration” on page 44.

Subelements

none

Sample sun-application.xml File

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE sun-application PUBLIC '-//Sun Microsystems, Inc.//DTD Application Server 8.0 J2EE Application 1.4//EN' 'http://www.sun.com/software/appserver/dtds/sun-application_1_4-0.dtd'>

<sun-application>

  <unique-id>67488732739338240</unique-id>

</sun-application>


The sun-web.xml File

This section describes the XML elements in the sun-web.xml file and provides an example file in the following sections:

General Elements

General elements are as follows:

sun-web-app

Defines Sun Java System Application Server specific configuration for a web module. This is the root element; there can only be one sun-web-app element in a sun-web.xml file.

Subelements

The following table describes subelements for the sun-web-app element.

Table 5-5  sun-web-app Subelements 

Element

Required

Description

context-root

zero or one

Contains the web context root for the web application.

security-role-mapping

zero or more

Maps roles to users or groups in the currently active realm.

servlet

zero or more

Specifies a principal name for a servlet, which is used for the run-as role defined in web.xml.

session-config

zero or one

Specifies session manager, session cookie, and other session-related information.

ejb-ref

zero or more

Maps the absolute JNDI name to the ejb-ref in the corresponding J2EE XML file.

resource-ref

zero or more

Maps the absolute JNDI name to the resource-ref in the corresponding J2EE XML file.

resource-env-ref

zero or more

Maps the absolute JNDI name to the resource-env-ref in the corresponding J2EE XML file.

service-ref

zero or more

Specifies runtime settings for a web service reference.

cache

zero or one

Configures caching for web application components.

class-loader

zero or one

Specifies classloader configuration information.

jsp-config

zero or one

Specifies JSP configuration information.

locale-charset-info

zero or one

Specifies internationalization settings.

property

zero or more

Specifies a property, which has a name and a value.

message-destination

zero or more

Specifies the name of a logical message destination.

webservice-description

zero or more

Specifies a name and optional publish location for a web service.

Attributes

none

Properties

The following table describes properties for the sun-web-app element.

Table 5-6  sun-web-app Properties 

Property

Default

Description

crossContextAllowed

true

If true, allows this web application to access the contexts of other web applications using the ServletContext.getContext()method.

tempdir

domain_dir/generated/j2ee-apps/app_name

or

domain_dir/generated/j2ee-modules/module_name

Specifies a temporary directory for use by this web module. This value is used to construct the value of the javax.servlet.context.tempdir context attribute. Compiled JSPs are also placed in this directory.

singleThreadedServletPoolSize

5

Specifies the maximum number of servlet instances allocated for each SingleThreadModel servlet in the web application.

property

Specifies a property, which has a name and a value. A property adds configuration information to its parent element that is one or both of the following:

For example, a manager-properties element can include property subelements:

<manager-properties>
  <property name="reapIntervalSeconds" value="20" />
</manager-properties>

Which properties a manager-properties element uses depends on the value of the parent session-manager element’s persistence-type attribute. For details, see the description of the session-manager element.

Subelements

The following table describes subelements for the property element.

Table 5-7  property Subelements 

Element

Required

Description

description

zero or one

Specifies an optional text description of a property.

Attributes

The following table describes attributes for the property element.

Table 5-8  property Attributes 

Attribute

Default

Description

name

none

Specifies the name of the property.

value

none

Specifies the value of the property.

description

Contains data that specifies a text description of the containing element.

Subelements

none

Attributes

none

context-root

Contains the web context root for the web application. Overrides the corresponding element in the web.xml file.

If you are setting up load balancing, web module context roots must be unique within a cluster. See the Sun Java System Application Server Administration Guide for more information about load balancing.

Subelements

none

Security Elements

Security elements are as follows:

security-role-mapping

Maps roles to users or groups in the currently active realm. See “Realm Configuration” on page 44 for how to define the currently active realm.

Subelements

The following table describes subelements for the security-role-mapping element.

Table 5-9  security-role-mapping Subelements 

Element

Required

Description

role-name

only one

Contains the role name.

principal-name

requires at least one principal-name or group-name

Contains a principal (user) name in the current realm.

group-name

requires at least one principal-name or group-name

Contains a group name in the current realm.

Attributes

none

servlet

Specifies a principal name for a servlet, which is used for the run-as role defined in web-xml.

Subelements

The following table describes subelements for the servlet element.

Table 5-10  servlet Subelements 

Element

Required

Description

servlet-name

only one

Contains the name of a servlet, which is matched to a servlet-name in web.xml.

principal-name

zero or one

Contains a principal (user) name in the current realm.

webservice-endpoint

zero or more

Specifies information about a web service endpoint.

Attributes

none

servlet-name

Contains data that specifies the name of a servlet, which is matched to a servlet-name in web.xml. This name must be present in web.xml.

Subelements

none

Attributes

none

role-name

Contains data that specifies the role-name in the security-role element of the web.xml file.

Subelements

none

Attributes

none

principal-name

Contains data that specifies a principal (user) name in the current realm.

Subelements

none

Attributes

none

group-name

Contains data that specifies a group name in the current realm.

Subelements

none

Attributes

none

Session Elements

Session elements are as follows:

session-config

Specifies session configuration information. Overrides the web container settings for an individual web application.

Subelements

The following table describes subelements for the session-config element.

Table 5-11  session-config Subelements 

Element

Required

Description

session-manager

zero or one

Specifies session manager configuration information.

session-properties

zero or one

Specifies session properties.

cookie-properties

zero or one

Specifies session cookie properties.

Attributes

none

session-manager

Specifies session manager information.

Subelements

The following table describes subelements for the session-manager element.

Table 5-12  session-manager Subelements 

Element

Required

Description

manager-properties

zero or one

Specifies session manager properties.

store-properties

zero or one

Specifies session persistence (storage) properties.

Attributes

The following table describes attributes for the session-manager element.

Table 5-13  session-manager Attributes 

Attribute

Default

Description

persistence-type

memory

(optional) Specifies the session persistence mechanism. Allowed values are memory and file.

The ha and custom values are not implemented and should not be used.

manager-properties

Specifies session manager properties.

Subelements

The following table describes subelements for the manager-properties element.

Table 5-14  manager-properties Subelements 

Element

Required

Description

property

zero or more

Specifies a property, which has a name and a value.

Attributes

none

Properties

The following table describes properties for the manager-properties element.

Table 5-15  manager-properties Properties 

Property

Default

Description

reapIntervalSeconds

60

Specifies the number of seconds between checks for expired sessions.

If the persistence-type attribute of the session-manager element is file, sessions are passivated if maxSessions has been exceeded.

You should set this value lower than the frequency at which session data changes to prevent data inconsistency. For example, this value should be as low as possible (1 second) for a hit counter servlet on a frequently accessed website, or you could lose the last few hits each time you restart the server.

maxSessions

-1

Specifies the maximum number of sessions that can be in cache, or -1 for no limit. After this, an attempt to create a new session causes an IllegalStateException to be thrown.

If the persistence-type attribute of the session-manager element is file, the session manager passivates sessions to the persistent store when this maximum is reached.

sessionFilename

none; state is not preserved across restarts

Specifies the absolute or relative path to the directory in which the session state is preserved between application restarts, if preserving the state is possible. A relative path is relative to the temporary directory for this web application.

Applicable only if the persistence-type attribute of the session-manager element is memory.

store-properties

Specifies session persistence (storage) properties.

Subelements

The following table describes subelements for the store-properties element.

Table 5-16  store-properties Subelements 

Element

Required

Description

property

zero or more

Specifies a property, which has a name and a value.

Attributes

none

Properties

The following table describes properties for the store-properties element.

Table 5-17  store-properties Properties 

Property

Default

Description

directory

domain_dir/generated/jsp/j2ee-apps/appname/appname_war

Specifies the absolute or relative pathname of the directory into which individual session files are written. A relative path is relative to the temporary work directory for this web application.

Applicable only if the persistence-type attribute of the session-manager element is file.

session-properties

Specifies session properties.

Subelements

The following table describes subelements for the session-properties element.

Table 5-18  session-properties Subelements 

Element

Required

Description

property

zero or more

Specifies a property, which has a name and a value.

Attributes

none

Properties

The following table describes properties for the session-properties element.

Table 5-19  session-properties Properties 

Property

Default

Description

timeoutSeconds

600

Specifies the default maximum inactive interval (in seconds) for all sessions created in this web module. If set to 0 or less, sessions in this web module never expire.

If a session-timeout element is specified in the web.xml file, the session-timeout value overrides any timeoutSeconds value. If neither session-timeout nor timeoutSeconds is specified, the timeoutSeconds default is used.

Note that the session-timeout element in web.xml is specified in minutes, not seconds.

enableCookies

true

Uses cookies for session tracking if set to true.

enableURLRewriting

true

Enables URL rewriting. This provides session tracking via URL rewriting when the browser does not accept cookies. You must also use an encodeURL or encodeRedirectURL call in the servlet or JSP.

idLengthBytes

16

Specifies the number of bytes in this web module’s session ID.

cookie-properties

Specifies session cookie properties.

Subelements

The following table describes subelements for the cookie-properties element.

Table 5-20  cookie-properties Subelements 

Element

Required

Description

property

zero or more

Specifies a property, which has a name and a value.

Attributes

none

Properties

The following table describes properties for the cookie-properties element.

Table 5-21  cookie-properties Properties 

Property

Default

Description

cookiePath

Context path at which the web module is installed.

Specifies the pathname that is set when the cookie is created. The browser sends the cookie if the pathname for the request contains this pathname. If set to / (slash), the browser sends cookies to all URLs served by the Sun Java System Application Server. You can set the path to a narrower mapping to limit the request URLs to which the browser sends cookies.

cookieMaxAgeSeconds

-1

Specifies the expiration time (in seconds) after which the browser expires the cookie.

cookieDomain

(unset)

Specifies the domain for which the cookie is valid.

cookieComment

Sun Java System Application Server Session Tracking Cookie

Specifies the comment that identifies the session tracking cookie in the cookie file. Applications can provide a more specific comment for the cookie.

Reference Elements

Reference elements are as follows:

resource-env-ref

Maps the res-ref-name in the corresponding J2EE web.xml file resource-env-ref entry to the absolute jndi-name of a resource.

Subelements

The following table describes subelements for the resource-env-ref element.

Table 5-22   resource-env-ref Subelements 

Element

Required

Description

resource-env-ref-name

only one

Specifies the res-ref-name in the corresponding J2EE web.xml file resource-env-ref entry.

jndi-name

only one

Specifies the absolute jndi-name of a resource.

Attributes

none

resource-env-ref-name

Contains data that specifies the res-ref-name in the corresponding J2EE web.xml file resource-env-ref entry.

Subelements

none

Attributes

none

resource-ref

Maps the res-ref-name in the corresponding J2EE web.xml file resource-ref entry to the absolute jndi-name of a resource.

Subelements

The following table describes subelements for the resource-ref element.

Table 5-23  resource-ref Subelements 

Element

Required

Description

res-ref-name

only one

Specifies the res-ref-name in the corresponding J2EE web.xml file resource-ref entry.

jndi-name

only one

Specifies the absolute jndi-name of a resource.

default-resource-principal

zero or one

Specifies the default principal (user) for the resource.

Attributes

none

res-ref-name

Contains data that specifies the res-ref-name in the corresponding J2EE web.xml file resource-ref entry.

Subelements

none

Attributes

none

default-resource-principal

Specifies the default principal (user) for the resource.

If this element is used in conjunction with a JMS Connection Factory resource, the name and password subelements must be valid entries in the Sun Java™ System Message Queue broker user repository. See the “Security Management” chapter in the Sun Java System Message Queue Administrator’s Guide for details.

Subelements

The following table describes subelements for the default-resource-principal element.

Table 5-24  default-resource-principal Subelements 

Element

Required

Description

name

only one

Contains the name of the principal.

password

only one

Contains the password for the principal.

Attributes

none

name

Contains data that specifies the name of the principal.

Subelements

none

Attributes

none

password

Contains data that specifies the password for the principal.

Subelements

none

Attributes

none

ejb-ref

Maps the ejb-ref-name in the corresponding J2EE web.xml file ejb-ref entry to the absolute jndi-name of a resource.

Subelements

The following table describes subelements for the ejb-ref element.

Table 5-25   ejb-ref Subelements 

Element

Required

Description

ejb-ref-name

only one

Specifies the ejb-ref-name in the corresponding J2EE web.xml file ejb-ref entry.

jndi-name

only one

Specifies the absolute jndi-name of a resource.

Attributes

none

ejb-ref-name

Contains data that specifies the ejb-ref-name in the corresponding J2EE web.xml file ejb-ref entry.

Subelements

none

Attributes

none

message-destination

Specifies the name of a logical message-destination defined within an application. The message-destination-name matches the corresponding message-destination-name in the web.xml file.

Subelements

The following table describes subelements for the message-destination element.

Table 5-26  message-destination subelements  

Element

Required

Description

message-destination-name

only one

Specifies the name of a logical message destination defined within the corresponding web.xml file.

jndi-name

only one

Specifies the jndi-name of the associated entity.

Attributes

none

message-destination-name

Contains data that specifies the name of a logical message destination defined within the corresponding web.xml file.

Subelements

none

Attributes

none

jndi-name

Contains data that specifies the absolute jndi-name of a URL resource or a resource in the domain.xml file.

Subelements

none

Attributes

none

Caching Elements

For details about response caching as it pertains to servlets and JSP caching, see “Caching Servlet Results” on page 268 and “JSP Caching” on page 276.

Caching elements are as follows:

cache

Configures caching for web application components.

Subelements

The following table describes subelements for the cache element.

Table 5-27  cache Subelements 

Element

Required

Description

cache-helper

zero or more

Specifies a custom class that implements the CacheHelper interface.

default-helper

zero or one

Allows you to change the properties of the default, built-in cache-helper class.

property

zero or more

Specifies a cache property, which has a name and a value.

cache-mapping

zero or more

Maps a URL pattern or a servlet name to its cacheability constraints.

Attributes

The following table describes attributes for the cache element.

Table 5-28  cache Attributes 

Attribute

Default

Description

max-entries

4096

(optional) Specifies the maximum number of entries the cache can contain. Must be a positive integer.

timeout-in-seconds

30

(optional) Specifies the maximum amount of time in seconds that an entry can remain in the cache after it is created or refreshed. Can be overridden by a timeout element.

enabled

false

(optional) Determines whether servlet and JSP caching is enabled.

Properties

The following table describes properties for the cache element.

Table 5-29  cache Properties 

Property

Default

Description

cacheClassName

com.sun.appserv.web.cache.LruCache

Specifies the fully qualified name of the class that implements the cache functionality. The cacheClassName Values table below lists possible values.

MultiLRUSegmentSize

4096

Specifies the number of entries in a segment of the cache table that should have its own LRU (least recently used) list. Applicable only if cacheClassName is set to com.sun.appserv.web.cache.MultiLruCache.

MaxSize

unlimited; Long.MAX_VALUE

Specifies an upper bound on the cache memory size in bytes (KB or MB units). Example values are 32 KB or 2 MB. Applicable only if cacheClassName is set to com.sun.appserv.web.cache.BoundedMultiLruCache.

Cache Class Names

The following table lists possible values of the cacheClassName property.

Table 5-30  cacheClassName Values 

Value

Description

com.sun.appserv.web.cache.LruCache

A bounded cache with an LRU (least recently used) cache replacement policy.

com.sun.appserv.web.cache.BaseCache

An unbounded cache suitable if the maximum number of entries is known.

com.sun.appserv.web.cache.MultiLruCache

A cache suitable for a large number of entries (>4096). Uses the MultiLRUSegmentSize property.

com.sun.appserv.web.cache.BoundedMultiLruCache

A cache suitable for limiting the cache size by memory rather than number of entries. Uses the MaxSize property.

cache-helper

Specifies a class that implements the CacheHelper interface. For details, see “CacheHelper Interface” on page 271.

Subelements

The following table describes subelements for the cache-helper element.

Table 5-31  cache-helper Subelements 

Element

Required

Description

property

zero or more

Specifies a property, which has a name and a value.

Attributes

The following table describes attributes for the cache-helper element.

Table 5-32  cache-helper Attributes 

Attribute

Default

Description

name

default

Specifies a unique name for the helper class, which is referenced in the cache-mapping element.

class-name

none

Specifies the fully qualified class name of the cache helper, which must implement the com.sun.appserv.web.CacheHelper interface.

default-helper

Allows you to change the properties of the built-in default cache-helper class.

Subelements

The following table describes subelements for the default-helper element.

Table 5-33  default-helper Subelements 

Element

Required

Description

property

zero or more

Specifies a property, which has a name and a value.

Attributes

none

Properties

The following table describes properties for the default-helper element.

Table 5-34  default-helper Properties 

Property

Default

Description

cacheKeyGeneratorAttrName

Uses the built-in default cache-helper key generation, which concatenates the servlet path with key-field values, if any.

The caching engine looks in the ServletContext for an attribute with a name equal to the value specified for this property to determine whether a customized CacheKeyGenerator implementation is used. An application may provide a customized key generator rather than using the default helper. See “CacheKeyGenerator Interface” on page 273.

cache-mapping

Maps a URL pattern or a servlet name to its cacheability constraints.

Subelements

The following table describes subelements for the cache-mapping element.

Table 5-35  cache-mapping Subelements 

Element

Required

Description

servlet-name

requires one servlet-name or url-pattern

Contains the name of a servlet.

url-pattern

requires one servlet-name or url-pattern

Contains a servlet URL pattern for which caching is enabled.

cache-helper-ref

required if timeout, refresh-field, http-method, key-field, and constraint-field are not used

Contains the name of the cache-helper used by the parent cache-mapping element.

timeout

zero or one if cache-helper-ref is not used

Contains the cache-mapping specific maximum amount of time in seconds that an entry can remain in the cache after it is created or refreshed.

refresh-field

zero or one if cache-helper-ref is not used

Specifies a field that gives the application component a programmatic way to refresh a cached entry.

http-method

zero or more if cache-helper-ref is not used

Contains an HTTP method that is eligible for caching.

key-field

zero or more if cache-helper-ref is not used

Specifies a component of the key used to look up and extract cache entries.

constraint-field

zero or more if cache-helper-ref is not used

Specifies a cacheability constraint for the given url-pattern or servlet-name.

Attributes

none

url-pattern

Contains data that specifies a servlet URL pattern for which caching is enabled. See the Servlet 2.3 specification section SRV. 11.2 for applicable patterns.

Subelements

none

Attributes

none

cache-helper-ref

Contains data that specifies the name of the cache-helper used by the parent cache-mapping element.

Subelements

none

Attributes

none

timeout

Contains data that specifies the cache-mapping specific maximum amount of time in seconds that an entry can remain in the cache after it is created or refreshed. If not specified, the default is the value of the timeout attribute of the cache element.

Subelements

none

Attributes

The following table describes attributes for the timeout element.

Table 5-36  timeout Attributes 

Attribute

Default

Description

name

none

Specifies the timeout input parameter, whose value is interpreted in seconds. The field’s type must be java.lang.Long or java.lang.Integer.

scope

request.attribute

(optional) Specifies the scope from which the input parameter is to be retrieved. Allowed values are context.attribute, request.header, request.parameter, request.cookie, request.attribute, and session.attribute.

refresh-field

Specifies a field that gives the application component a programmatic way to refresh a cached entry.

Subelements

none

Attributes

The following table describes attributes for the refresh-field element.

Table 5-37  refresh-field Attributes 

Attribute

Default

Description

name

none

Specifies the input parameter name.

scope

request.parameter

(optional) Specifies the scope from which the input parameter is to be retrieved. Allowed values are context.attribute, request.header, request.parameter, request.cookie, session.id, and session.attribute.

http-method

Contains data that specifies an HTTP method that is eligible for caching. The default is GET.

Subelements

none

Attributes

none

key-field

Specifies a component of the key used to look up and extract cache entries. The web container looks for the named parameter, or field, in the specified scope.

If this element is not present, the web container uses the Servlet Path (the path section that corresponds to the servlet mapping that activated the current request). See the Servlet 2.3 specification, section SRV 4.4, for details on the Servlet Path.

Subelements

none

Attributes

The following table describes attributes for the key-field element.

Table 5-38  key-field Attributes 

Attribute

Default

Description

name

none

Specifies the input parameter name.

scope

request.parameter

(optional) Specifies the scope from which the input parameter is to be retrieved. Allowed values are context.attribute, request.header, request.parameter, request.cookie, session.id, and session.attribute.

constraint-field

Specifies a cacheability constraint for the given url-pattern or servlet-name.

All constraint-field constraints must pass for a response to be cached. If there are value constraints, at least one of them must pass.

Subelements

The following table describes subelements for the constraint-field element.

Table 5-39  constraint-field Subelements 

Element

Required

Description

value

zero or more

Contains a value to be matched to the input parameter value.

Attributes

The following table describes attributes for the constraint-field element.

Table 5-40  constraint-field Attributes 

Attribute

Default

Description

name

none

Specifies the input parameter name.

scope

request.parameter

(optional) Specifies the scope from which the input parameter is to be retrieved. Allowed values are context.attribute, request.header, request.parameter, request.cookie, request.attribute, and session.attribute.

cache-on-match

true

(optional) If true, caches the response if matching succeeds. Overrides the same attribute in a value subelement.

cache-on-match-failure

false

(optional) If true, caches the response if matching fails. Overrides the same attribute in a value subelement.

value

Contains data that specifies a value to be matched to the input parameter value. The matching is case sensitive. For example:

<value match-expr="in-range">1-60</value>

Subelements

none

Attributes

The following table describes attributes for the value element.

Table 5-41  value Attributes 

Attribute

Default

Description

match-expr

equals

(optional) Specifies the type of comparison performed with the value. Allowed values are equals, not-equals, greater, lesser, and in-range.

If match-expr is greater or lesser, the value must be a number. If match-expr is in-range, the value must be of the form n1-n2, where n1 and n2 are numbers.

cache-on-match

true

(optional) If true, caches the response if matching succeeds.

cache-on-match-failure

false

(optional) If true, caches the response if matching fails.

Classloader Elements

Classloader elements are as follows:

class-loader

Configures the classloader for the web module.

Subelements

none

Attributes

The following table describes attributes for the class-loader element.

Table 5-42  class-loader Attributes 

Attribute

Default

Description

extra-class-path

null

(optional) Specifies additional classpath settings for this web module.

delegate

true

(optional) If true, the web module follows the standard classloader delegation model and delegates to its parent classloader first before looking in the local classloader. You must set this to true for a web application that accesses EJB components or that acts as a web service client or endpoint.

If false, the web module follows the delegation model specified in the Servlet specification and looks in its classloader before looking in the parent classloader. It’s safe to set this to false only for a web module that does not interact with any other modules.


Note

If the delegate element is set to false, the classloader delegation behavior complies with the Servlet 2.3 specification, section 9.7.2. If set to its default value of true, classes and resources residing in container-wide library JAR files are loaded in preference to classes and resources packaged within the WAR file.

Portable programs that use this element should not be packaged with any classes or interfaces that are a part of the J2EE specification. The behavior of a program that includes such classes or interfaces in its WAR file is undefined.


JSP Elements

JSP elements are as follows:

jsp-config

Specifies JSP configuration information.

Subelements

The following table describes subelements for the jsp-config element.

Table 5-43  jsp-config Subelements 

Element

Required

Description

property

zero or more

Specifies a property.

Attributes

none

Properties

The default property values are tuned for development of JSP pages at the cost of performance. To maximize performance, set jsp-config properties to these non-default values:

The following table describes properties for the jsp-config element.

Table 5-44  jsp-config Properties 

Property

Default

Description

ieClassId

clsid:8AD9C840-044E-11D1-B3E9-00805F499D93

Specifies the Java plug-in COM class ID for Internet Explorer. Used by the <jsp:plugin> tags.

javaEncoding

UTF8

Specifies the encoding for the generated Java servlet. This encoding is passed to the Java compiler used to compile the servlet as well. By default, the web container tries to use UTF8. If that fails, it tries to use the javaEncoding value.

For encodings you can use, see:

http://java.sun.com/j2se/1.4/docs/guide/intl/encoding.doc.html

classdebuginfo

true

Specifies whether the generated Java servlets should be compiled with the debug option set (-g for javac).

keepgenerated

true

If set to true, keeps the generated Java files. If false, deletes the Java files.

mappedfile

true

If set to true, generates static content with one print statement per input line, to ease debugging.

scratchdir

The default work directory for the web application

Specifies the working directory created for storing all the generated code.

checkInterval

300

Specifies the time in seconds between checks to see if a JSP page needs to be recompiled. Applicable if development is false and reloading is true, which enables background recompiles.

compiler

javac

Specifies the compiler Ant uses to compile JSP pages. See the Ant documentation for more information:

http://computing.ee.ethz.ch/sepp/ant-1.5.4-ke/manual/index.html

classpath

created dynamically based on the current web application

Specifies the classpath to use when compiling generated servlets.

development

true

If set to true, checks JSP pages for modification on every access.

enablePooling

true

If set to true, tag handler pooling is enabled.

fork

true

Specifies that Ant forks compiles of JSP pages so that a separate JVM is used for JSP page compiles from the one in which Tomcat is running.

trimSpaces

false

If set to true, trims white spaces in template text between actions or directives.

reloading

true

If set to true, checks for modified JSP pages.

suppressSmap

false

If set to true, generation of SMAP information for JSR 45 debugging is suppressed.

dumpSmap

false

If set to true, dumps SMAP information for JSR 45 debugging to a file. Set to false if suppressSmap is true.

genStrAsCharArray

false

If set to true, generates text strings as char arrays, which improves performance in some cases.

errorOnUseBeanInvalidClassAttribute

false

If set to true, issues an error when the value of the class attribute in a useBean action is not a valid bean class.

xpoweredBy

true

If set to true, the X-Powered-By response header is added by the generated servlet.

Internationalization Elements

Internationalization elements are as follows:

locale-charset-info

Specifies information about the application’s internationalization settings.

Subelements

The following table describes subelements for the locale-charset-info element.

Table 5-45  locale-charset-info Subelements 

Element

Required

Description

locale-charset-map

one or more

Maps a locale and an agent to a character encoding. Provided for backward compatibility. Used only for request processing, and only if no parameter-encoding is defined.

parameter-encoding

zero or one

Determines the default request character encoding and how the web container decodes parameters from forms according to a hidden field value.

Attributes

The following table describes attributes for the locale-charset-info element.

Table 5-46  locale-charset-info Attributes 

Attribute

Default

Description

default-locale

none

Although a value is required, the value is ignored. Use the default-charset attribute of the parameter-encoding element.

locale-charset-map

Maps locales and agents to character encodings. Provided for backward compatibility. Used only for request processing. Used only if the character encoding is not specified in the request and cannot be derived from the optional parameter-encoding element.

For encodings you can use, see:

http://java.sun.com/j2se/1.4/docs/guide/intl/encoding.doc.html

Subelements

The following table describes subelements for the locale-charset-map element.

Table 5-47  locale-charset-map Subelements 

Element

Required

Description

description

zero or one

Specifies an optional text description of a mapping.

Attributes

The following table describes attributes for the locale-charset-map element.

Table 5-48  locale-charset-map Attributes 

Attribute

Default

Description

locale

none

Specifies the locale name.

agent

none

(optional) Specifies the type of client that interacts with the application server. For a given locale, different agents may have different preferred character encodings. The value of this attribute must exactly match the value of the user-agent HTTP request header sent by the client. See the Example agent Attribute Values table for more information.

charset

none

Specifies the character encoding to which the locale maps.

Example Agents

The following table specifies example agent attribute values.

Table 5-49  Example agent Attribute Values 

Agent

user-agent Header and agent Attribute Value

Internet Explorer 5.00 for Windows 2000

Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)

Netscape 4.7.7 for Windows 2000

Mozilla/4.77 [en] (Windows NT 5.0; U)

Netscape 4.7 for Solaris

Mozilla/4.7 [en] (X11; u; Sun OS 5.6 sun4u)

parameter-encoding

Specifies the default request character encoding and how the web container decodes parameters from forms according to a hidden field value.

For encodings you can use, see:

http://java.sun.com/j2se/1.4/docs/guide/intl/encoding.doc.html

Subelements

none

Attributes

The following table describes attributes for the parameter-encoding element.

Table 5-50  parameter-encoding Attributes 

Attribute

Default

Description

form-hint-field

none

(optional) The name of the hidden field in the form that specifies the character encoding the web container uses for request.getParameter and request.getReader calls when the charset is not set in the request’s content-type header.

default-charset

ISO-8859-1

(optional) The default request character encoding.

Sample sun-web.xml File

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE sun-web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Application Server 8.0 Servlet 2.4//EN' 'http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-0.dtd'>

<sun-web-app>

  <session-config>

    <session-manager/>

  </session-config>

  <resource-ref>

    <res-ref-name>mail/Session</res-ref-name>

    <jndi-name>mail/Session</jndi-name>

  </resource-ref>

  <jsp-config/>

</sun-web-app>


The sun-ejb-jar.xml File

This section describes the XML elements in the sun-ejb-jar.xml file and provides an example file in the following sections:

General Elements

General elements are as follows:

description

Contains data that specifies a text description of the containing element.

Subelements

none

ejb

Defines runtime properties for a single enterprise bean within the application. The subelements listed below apply to particular enterprise beans as follows:

Subelements

The following table describes subelements for the ejb element.

Table 5-51  ejb Subelements 

Subelement

Required

Description

ejb-name

only one

Matches the ejb-name in the corresponding ejb-jar.xml file.

jndi-name

zero or more

Specifies the absolute jndi-name.

ejb-ref

zero or more

Maps the absolute JNDI name to the ejb-ref element in the corresponding J2EE XML file.

resource-ref

zero or more

Maps the absolute JNDI name to the resource-ref in the corresponding J2EE XML file.

resource-env-ref

zero or more

Maps the absolute JNDI name to the resource-env-ref in the corresponding J2EE XML file.

service-ref

zero or more

Specifies runtime settings for a web service reference.

pass-by-reference

zero or one

Specifies the passing method used by an enterprise bean calling a remote interface method in another bean that is co-located within the same process.

cmp

zero or one

Specifies runtime information for a container-managed persistence (CMP) EntityBean object for EJB1.1 and EJB2.1 beans.

principal

zero or one

Specifies the principal (user) name in an enterprise bean that has the run-as role specified.

mdb-connection-factory

zero or one

Specifies the connection factory associated with a message-driven bean.

jms-durable-subscription-name

zero or one

Contains data that specifies the durable subscription associated with a message-driven bean.

jms-max-messages-load

zero or one

Specifies the maximum number of messages to load into a Java Message Service session at one time for a message-driven bean to serve. The default is 1.

ior-security-config

zero or one

Specifies the security information for the IOR.

is-read-only-bean

zero or one

Specifies that this bean is read-only (BMP only).

refresh-period-in-seconds

zero or one

Specifies the rate at which a read-only-bean must be refreshed from the data source.

commit-option

zero or one

Contains data that has valid values of B or C. Default value is B.

cmt-timeout-in-seconds

zero or one

Contains data that overrides the Transaction Timeout setting of the Transaction Service for an individual bean.

use-thread-pool-id

zero or one

This element is not implemented.

gen-classes

zero or one

Specifies all the generated class names for a bean.

bean-pool

zero or one bean-pool

Specifies the bean pool properties. Used for stateless session beans, entity beans, and message-driven bean pools.

bean-cache

zero or one bean-pool

Specifies the bean cache properties. Used only for stateful session beans and entity beans

mdb-resource-adapter

zero or one

Specifies runtime configuration information for a message-driven bean.

webservice-endpoint

zero or more

Specifies information about a web service endpoint.

Example

<ejb>
  <ejb-name>CustomerEJB</ejb-name>
  <jndi-name>customer</jndi-name>
  <resource-ref>
    <res-ref-name>jdbc/SimpleBank</res-ref-name>
    <jndi-name>jdbc/PointBase</jndi-name>
  </resource-ref>
  <is-read-only-bean>false</is-read-only-bean>
  <commit-option>B</commit-option>
  <bean-pool>
    <steady-pool-size>10</steady-pool-size>
    <resize-quantity>10</resize-quantity>
    <max-pool-size>100</max-pool-size>             
    <pool-idle-timeout-in-seconds>600</pool-idle-timeout-in-seconds>
  </bean-pool>
  <bean-cache>
    <max-cache-size>100</max-cache-size>
    <resize-quantity>10</resize-quantity>
    <removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
    <victim-selection-policy>LRU</victim-selection-policy>
  </bean-cache>
</ejb>

ejb-name

Matches the ejb-name in the corresponding ejb-jar.xml file. The name must be unique among the names of the enterprise beans in the same EJB JAR file.

There is no architected relationship between the ejb-name in the deployment descriptor and the JNDI name that the deployer assigns to the EJB component’s home.

Subelements

none

Example

<ejb-name>EmployeeService</ejb-name>

enterprise-beans

Specifies all the runtime properties for an EJB JAR file in the application.

Subelements

The following table describes subelements for the enterprise-beans element.

Table 5-52  enterprise-beans Subelements 

Subelement

Required

Description

name

zero or one

Specifies the name string.

unique-id

zero or one

Specifies a unique system identifier. This data is automatically generated and updated at deployment/redeployment. Developers should not specify or edit this value.

ejb

zero or more

Defines runtime properties for a single enterprise bean within the application.

pm-descriptors

zero or one

Specifies one or more persistence manager descriptors, but only one of them must be in use at any given time. If none are specified, the Sun CMP persistence manager is used.

cmp-resource

zero or one

Specifies the database to be used for storing container-managed persistence (CMP) beans in an EJB JAR file.

message-destination

zero or more

Specifies the name of a logical message destination.

webservice-description

zero or more

Specifies a name and optional publish location for a web service.

Example

<enterprise-beans>
  <ejb>
    <ejb-name>CustomerEJB</ejb-name>
    <jndi-name>customer</jndi-name>
    <resource-ref>
      <res-ref-name>jdbc/SimpleBank</res-ref-name>
      <jndi-name>jdbc/PointBase</jndi-name>
    </resource-ref>
    <is-read-only-bean>false</is-read-only-bean>
    <commit-option>B</commit-option>
    <bean-pool>
      <steady-pool-size>10</steady-pool-size>
      <resize-quantity>10</resize-quantity>
      <max-pool-size>100</max-pool-size>
      <pool-idle-timeout-in-seconds>600</pool-idle-timeout-in-seconds>
    </bean-pool>
    <bean-cache>
      <max-cache-size>100</max-cache-size>
      <resize-quantity>10</resize-quantity>
      <removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
      <victim-selection-policy>LRU</victim-selection-policy>
    </bean-cache>
  </ejb>
</enterprise-beans>

is-read-only-bean

Specifies that this bean is a read-only bean (BMP only).

Subelements

none

Example

<is-read-only-bean>false</is-read-only-bean>

name

Contains data that specifies the name of the entity.

Subelements

none

property

Specifies the name and value of a property.

Subelements

The following table describes subelements for the property element.

Table 5-53  property subelements  

Element

Required

Description

name

only one

Specifies the name of the entity.

value

only one

Specifies the value of the entity.

refresh-period-in-seconds

Specifies the rate at which a read-only-bean must be refreshed from the data source. If the value is less than or equal to zero, the bean is never refreshed; if the value is greater than zero, the bean instances are refreshed at specified intervals. This rate is just a hint to the container. Default is 0 (no refresh).

Subelements

none

sun-ejb-jar

Defines the Sun Java System Application Server-specific configuration for an EJB JAR file in the application. This is the root element; there can only be one sun-ejb-jar element in an sun-ejb-jar.xml file.

Refer to Sample sun-web.xml File for example of this file.

Subelements

The following table describes subelements for the sun-ejb-jar element.

Table 5-54  sun-ejb-jar Subelements 

Subelement

Required

Description

security-role-mapping

zero or more

Maps a role in the corresponding J2EE XML file to a user or group.

enterprise-beans

only one

Describes all the runtime properties for an EJB JAR file in the application.

unique-id

Specifies a unique system identifier. This data is automatically generated and updated at deployment/redeployment. Developers should not specify or edit this value.

Subelements

none

value

Contains data that specifies the value of the entity.

Subelements

none

Role Mapping Elements

The role mapping element maps a role, as specified in the EJB JAR role-name entries, to a environment-specific user or group. If it maps to a user, it must be a concrete user which exists in the current realm who can log into the server using the current authentication method. If it maps to a group, the realm must support groups and it must be a concrete group which exists in the current realm. To be useful, there must be at least one user in that realm who belongs to that group.

Role mapping elements are as follows:

group-name

Specifies the group name.

Subelements

none

principal

Defines a node that specifies a user name on the platform.

Subelements

The following table describes subelements for the principal element.

Table 5-55  principal Subelements 

Subelement

Required

Description

name

only one

Specifies the name of the user.

principal-name

Specifies the principal (user) name in an enterprise bean that has the run-as role specified.

Subelements

none

role-name

Specifies the role-name in the security-role element of the ejb-jar.xml file.

Subelements

none

Example

<role-name>employee</role-name>

security-role-mapping

Maps roles to users and groups.

Subelements

The following table describes subelements for the security-role-mapping element.

Table 5-56  security-role-mapping Subelements 

Subelement

Required

Description

role-name

only one

Specifies the role-name from the ejb-jar.xml file being mapped.

principal-name

requires at least one principal-name or group-name

Specifies the principal (user) name in a bean that has the run-as role specified.

group-name

requires at least one principal-name or group-name

Specifies the group name.

server-name

Specifies the name of the server where the application is being deployed.

Subelements

none

Reference Elements

Reference elements are as follows:

ejb-ref

Maps the absolute jndi-name name to the ejb-ref element in the corresponding J2EE XML file, ejb-jar.xml. The ejb-ref element is used for the declaration of a reference to an EJB’s home. Applies to session beans or entity beans.

Subelements

The following table describes subelements for the ejb-ref element.

Table 5-57   ejb-ref Subelements 

Subelement

Required

Description

ejb-ref-name

only one

Specifies the ejb-ref-name in the corresponding J2EE EJB JAR file ejb-ref entry.

jndi-name

only one

Specifies the absolute jndi-name.

ejb-ref-name

Specifies the ejb-ref-name in the corresponding J2EE XML file ejb-ref entry. The name must be unique within the enterprise bean, and should be prefixed with ejb/.

Subelements

none

Example

<ejb-ref-name>ejb/Payroll</ejb-ref-name>

jndi-name

Specifies the absolute jndi-name.

For entity beans and session beans, this value specifies the global JNDI name of the EJBHome object. It is only needed if the entity or session bean exposes a remote view.

For JMS message-driven beans, this is the JNDI name of the JMS resource from which the message-driven bean should consume JMS messages. This information can alternatively be specified within the activation-config subelement of the mdb-resource-adapter element. For more information about JMS resources, see Chapter 14, “Using the Java Message Service.”

Subelements

none

Example

<jndi-name>ejb/OrderEJB</jndi-name>

pass-by-reference

Specifies the passing method used by a servlet or enterprise bean calling a remote interface method in another bean that is co-located within the same process.

When a servlet or enterprise bean calls a remote interface method in another bean that is co-located within the same process, by default the Sun Java System Application Server makes copies of all the call parameters in order to preserve the pass-by-value semantics. This increases the call overhead and decreases performance.

However, if the calling method does not mutate the object being passed as a parameter, it is safe to pass the object itself without making a copy of it. To do this, set the pass-by-reference value to true.

To apply pass-by-reference semantics to an entire J2EE application containing multiple EJB modules, you can set the same element in the sun-application.xml file. If you want to use pass-by-reference at both the bean and application level, the bean level takes precedence. For information about the sun-application.xml file, see The sun-application.xml File.

Subelements

none

res-ref-name

Specifies the res-ref-name in the corresponding J2EE ejb-jar.xml file resource-ref entry. The res-ref-name element specifies the name of a resource manager connection factory reference. The name must be unique within an enterprise bean.

Subelements

none

Example

<res-ref-name>jdbc/SimpleBank</res-ref-name>

resource-env-ref

Maps the resource-env-ref-name in the corresponding J2EE ejb-jar.xml file resource-env-ref entry to an absolute jndi-name in the resources element in the domain.xml file. The resource-env-ref element contains a declaration of an enterprise bean's reference to an administered object associated with a resource in the bean's environment.

Used in entity, message-driven, and session beans.

Subelements

The following table describes subelements for the resource-env-ref element.

Table 5-58   resource-env-ref Subelements 

Subelement

Required

Description

resource-env-ref-name

only one

Specifies the resource-env-ref-name in the corresponding J2EE ejb-jar.xml file resource-env-ref entry.

jndi-name

only one

Specifies the absolute jndi-name.

Example

<resource-env-ref>      
  <resource-env-ref-name>
  jms/StockQueueName
  </resource-env-ref-name>
  <jndi-name>jms/StockQueue</jndi-name>
</resource-env-ref>

resource-env-ref-name

Specifies the resource-ref-name in the corresponding J2EE ejb-jar.xml file resource-env-ref entry. The resource-env-ref-name element specifies the name of a resource environment reference; its value is the environment entry name used in the EJB code. The name must be unique within an enterprise bean.

Subelements

none

Example

<resource-env-ref-name>jms/StockQueue</resource-env-ref-name>

resource-ref

Maps the res-ref-name in the corresponding J2EE ejb-jar.xml file resource-ref entry to the absolute jndi-name in the resources element in the domain.xml file. The resource-ref element contains a declaration of an EJB’s reference to an external resource. Used in entity, message-driven, and session beans.


Note

Connections acquired from JMS connection factories are not shareable in the current release of the Sun Java System Application Server. The res-sharing-scope element in the ejb-jar.xml file resource-ref element is ignored for JMS connection factories.

When resource-ref specifies a JMS connection factory for the Sun Java System Message Queue, the default-resource-principal (name/password) must exist in the Sun Java System Message Queue user repository. Refer to the Security Management chapter in the Sun Java System Message Queue Administrator's Guide for information on how to manage the Sun Java System Message Queue user repository.


Subelements

The following table describes subelements for the resource-ref element.

Table 5-59  resource-ref Subelements 

Subelement

Required

Description

res-ref-name

only one

Specifies the res-ref-name in the corresponding J2EE ejb-jar.xml file resource-ref entry.

jndi-name

only one

Specifies the absolute jndi-name.

default-resource-principal

zero or one

Specifies the default sign-on (name/password) to the resource manager.

Example

<resource-ref>
  <res-ref-name>jdbc/EmployeeDBName</res-ref-name>
  <jndi-name>jdbc/EmployeeDB</jndi-name>
</resource-ref>

message-destination

Specifies the name of a logical message-destination defined within an application. The message-destination-name matches the corresponding message-destination-name in the ejb-jar.xml file.

Subelements

The following table describes subelements for the message-destination element.

Table 5-60  message-destination subelements  

Element

Required

Description

message-destination-name

only one

Specifies the name of a logical message destination defined within the corresponding ejb-jar.xml file.

jndi-name

only one

Specifies the jndi-name of the associated entity.

message-destination-name

Contains data that specifies the name of a logical message destination defined within the corresponding ejb-jar.xml file.

Subelements

none

Messaging Elements

This section contains the following elements associated with messaging:

activation-config

Specifies an activation configuration, which includes the runtime configuration properties of the message-driven bean in its operational environment. For example, this may include information about the name of a physical JMS destination. Matches and overrides the activation-config element in the ejb-jar.xml file.

Subelements

The following table describes subelements for the activation-config element.

Table 5-61  activation-config subelements  

Element

Required

Description

description

zero or one

Specifies a text description of the activation configuration.

activation-config-property

one or more

Specifies an activation configuration property.

activation-config-property

Specifies the name and value of an activation configuration property.

Subelements

The following table describes subelements for the activation-config-property element.

Table 5-62  activation-config-property subelements  

Element

Required

Description

activation-config-property-name

only one

Specifies the name of an activation configuration property.

activation-config-property-value

only one

Specifies the value of an activation configuration property.

activation-config-property-name

Contains data that specifies the name of an activation configuration property.

Subelements

none

activation-config-property-value

Contains data that specifies the value of an activation configuration property.

Subelements

none

jms-durable-subscription-name

Specifies the durable subscription associated with a message-driven bean class. Only applies to the Java Message Service Topic Destination type, and only when the message-driven bean deployment descriptor subscription durability is Durable.

Subelements

none

jms-max-messages-load

Specifies the maximum number of messages to load into a Java Message Service session at one time for a message-driven bean to serve. The default is 1.

Subelements

none

mdb-connection-factory

Specifies the connection factory associated with a message-driven bean. Queue or Topic type must be consistent with the Java Message Service Destination type associated with the message-driven bean class.

Subelements

The following table describes subelements for the mdb-connection-factory element.

Table 5-63   mdb-connection-factory Subelements 

Subelement

Required

Description

jndi-name

only one

Specifies the absolute jndi-name.

default-resource-principal

zero or one

Specifies the default sign-on (name/password) to the resource manager.

mdb-resource-adapter

Specifies runtime configuration information for a message-driven bean.

Subelements

The following table describes subelements for the mdb-resource-adapter element.

Table 5-64  mdb-resource-adapter subelements  

Element

Required

Description

resource-adapter-mid

zero or one

Specifies a resource adapter module ID.

activation-config

one or more

Specifies an activation configuration.

resource-adapter-mid

Contains data that specifies the module ID of the resource adapter that is responsible for delivering messages to the message-driven bean.

Subelements

none

Security Elements

This section describes the elements that are associated with authentication, authorization, and general security. The following elements are included:

as-context

Specifies the authentication mechanism that will be used to authenticate the client. If specified, it will be USERNAME_PASSWORD.

Subelements

The following table describes subelements for the as-context element.

Table 5-65   as-context Subelements 

Subelement

Required

Description

auth-method

only one

Specifies the authentication method. The only supported value is USERNAME_PASSWORD.

realm

only one

Specifies the realm in which the user is authenticated.

required

only one

Specifies if the authentication method specified is required to be used for client authentication. If so, the EstablishTrustInClient bit will be set in the target_requires field of as-context. The value is true or false.

auth-method

Specifies the authentication method. The only supported value is USERNAME_PASSWORD.

Subelements

none

caller-propagation

Specifies if the target will accept propagated caller identities. The values are NONE, SUPPORTED, or REQUIRED.

Subelements

none

confidentiality

Specifies if the target supports privacy-protected messages. The values are NONE, SUPPORTED, or REQUIRED.

Subelements

none

default-resource-principal

Specifies the default sign-on (name/password) to the resource manager.

Subelements

The following table describes subelements for the default-resource-principal element.

Table 5-66   default-resource-principal Subelements 

Subelement

Required

Description

name

only one

Specifies the default resource principal name used to sign on to a resource manager.

password

only one

Specifies password of the default resource principal.

establish-trust-in-client

Specifies if the target is capable of authenticating a client. The values are NONE, SUPPORTED, or REQUIRED.

Subelements

none

establish-trust-in-target

Specifies if the target is capable of authenticating to a client. The values are NONE, SUPPORTED, or REQUIRED.

Subelements

none

integrity

Specifies if the target supports integrity-protected messages. The values are NONE, SUPPORTED, or REQUIRED.

Subelements

none

ior-security-config

Specifies the security information for the input-output redirection (IOR).

Subelements

The following table describes subelements for the ior-security-config element.

Table 5-67   ior-security-config Subelements 

Subelement

Required

Description

transport-config

zero or one

Specifies the security information for transport.

as-context

zero or one

Describes the authentication mechanism that will be used to authenticate the client. If specified, it will be USERNAME_PASSWORD.

sas-context

zero or one

Describes the sas-context fields.

name

Specifies the name of an entity.

Subelements

none

password

Specifies the password that security needs to complete authentication.

Subelements

none

realm

Specifies the realm in which the user is authenticated.

Subelements

none

required

Specifies if the authentication method specified is required to be used for client authentication. If so, the EstablishTrustInClient bit will be set in the target_requires field of as-context. The value is either true or false.

Subelements

none

sas-context

Describes the sas-context fields.

Subelements

The following table describes subelements for the sas-context element.

Table 5-68   sas-context Subelements 

Subelement

Required

Description

caller-propagation

only one

Specifies if the target will accept propagated caller identities. The values are NONE, SUPPORTED, or REQUIRED.

transport-config

Specifies the security transport information.

Subelements

The following table describes subelements for the transport-config element.

Table 5-69   transport-config Subelements 

Subelement

Required

Description

integrity

only one

Specifies if the target supports integrity-protected messages. The values are NONE, SUPPORTED, or REQUIRED.

confidentiality

only one

Specifies if the target supports privacy-protected messages. The values are NONE, SUPPORTED, or REQUIRED.

establish-trust-in-target

only one

Specifies if the target is capable of authenticating to a client. The values are NONE, SUPPORTED, or REQUIRED.

establish-trust-in-client

only one

Specifies if the target is capable of authenticating a client. The values are NONE, SUPPORTED, or REQUIRED.

Persistence Elements

This section describes the elements associated with container-managed persistence (CMP), the persistence manager, and the persistence vendor. For information on using these elements, refer to Chapter 8, "Using Container-Managed Persistence for Entity Beans."

The following elements are included:

cmp

Describes runtime information for a CMP entity bean object for EJB1.1 and EJB2.1 beans.

Subelements

The following table describes subelements for the cmp element.

Table 5-70   cmp Subelements 

Subelement

Required

Description

mapping-properties

zero or one

This element is not implemented.

is-one-one-cmp

zero or one

This element is not implemented.

one-one-finders

zero or one

Describes the finders for CMP 1.1 beans.

cmp-resource

Specifies the database to be used for storing CMP beans. For more information about this element, see Configuring the Resource Manager.

Subelements

The following table describes subelements for the cmp-resource element.

Table 5-71   cmp-resource Subelements 

Subelement

Required

Description

jndi-name

only one

Specifies the absolute jndi-name.

default-resource-principal

zero or one

Specifies the default runtime bindings of a resource reference.

property

zero or more

Specifies a property name and value.

create-tables-at-deploy

zero or one

If true, specifies that database tables are created for beans that are automatically mapped by the EJB container.

drop-tables-at-undeploy

zero or one

If true, specifies that database tables that were automatically created when the bean(s) were last deployed are dropped when the bean(s) are undeployed.

database-vendor-name

zero or one

Specifies the name of the database vendor for which tables can be created.

schema-generator-properties

zero or one

Specifies field-specific type mappings and allows you to set the use-unique-table-names property.

create-tables-at-deploy

Contains data that specifies whether database tables are created for beans that are automatically mapped by the EJB container. If true, creates tables in the database. If false, does not create tables.

This element can be overridden during deployment. See Table 8-2.

Subelements

none

database-vendor-name

Contains data that specifies the name of the database vendor for which tables can be created. Allowed values are db2, mssql, oracle, pointbase, and sybase, case-insensitive.

If no value is specified, a connection is made to the resource specified by the jndi-name subelement of the cmp-resource element, and the database vendor name is read. If the connection cannot be established, or if the value is not recognized, SQL-92 compliance is presumed.

This element can be overridden during deployment. See Table 8-2.

Subelements

none

drop-tables-at-undeploy

Contains data that specifies whether database tables that were automatically created when the bean(s) were last deployed are dropped when the bean(s) are undeployed. If true, drops tables from the database. If false, does not drop tables.

This element can be overridden during deployment. See Table 8-2.

Subelements

none

finder

Describes the finders for CMP 1.1 with a method name and query.

Subelements

The following table describes subelements for the finder element.

Table 5-72   finder Subelements 

Subelement

Required

Description

method-name

only one

Specifies the method name for the finder.

query-params

zero or one

Specifies the query parameters for the CMP 1.1 finder.

query-filter

zero or one

Specifies the query filter for the CMP 1.1 finder.

query-variables

zero or one

Specifies variables in query expression for the CMP 1.1 finder.

query-ordering

zero or one

Specifies the query ordering for the CMP 1.1 finder.

is-one-one-cmp

This element is not implemented.

Subelements

none

mapping-properties

This element is not implemented.

Subelements

none

method-name

Specifies the method name for the finder. The method-name element contains a name of an EJB method.

Examples

<method-name>findTeammates</method-name>

<method-name>*</method-name>

Subelements

none

one-one-finders

Describes the finders for CMP 1.1 beans.

Subelements

The following table describes subelements for the one-one-finders element.

Table 5-73   one-one-finders Subelements 

Subelement

Required

Description

finder

one or more

Describes the finders for CMP 1.1 with a method name and query.

pm-class-generator

Specifies which vendor-specific concrete class generator is to be used. This is the name of the class specific to the vendor.

Subelements

none

pm-config

Specifies the vendor-specific configuration file to be used.

Subelements

none

pm-descriptor

Describes the properties of the persistence manager associated with an entity bean.

Subelements

The following table describes subelements for the pm-descriptor element.

Table 5-74  pm-descriptor Subelements 

Subelement

Required

Description

pm-identifier

only one

Specifies the vendor who provided the persistence manager implementation. For example, this could be Sun Java System Application Server CMP or a third-party vendor.

pm-version

only one

Specifies which version of the persistence manager vendor product is to be used.

pm-config

zero or one

Specifies the vendor-specific configuration file to be used.

pm-class-generator

zero or one

Specifies which vendor-specific concrete class generator is to be used. This is the name of the class specific to the vendor.

pm-mapping-factory

zero or one

Specifies which vendor-specific mapping factory is to be used. This is the name of the class specific to the vendor.

pm-descriptors

Specifies one or more persistence manager descriptors, but only one of them must be in use at any given time. If none are specified, the Sun CMP persistence manager is used.

Subelements

The following table describes subelements for the pm-descriptors element.

Table 5-75  pm-descriptors Subelements 

Subelement

Required

Description

pm-descriptor

one or more

Describes the properties of the persistence manager associated with an entity bean.

pm-inuse

only one

Specifies whether this particular persistence manager must be used or not.

pm-identifier

Specifies the vendor who provided the persistence manager implementation. For example, this could be Sun Java System Application Server CMP or a third-party vendor.

Subelements

none

pm-inuse

Specifies whether this particular persistence manager must be used or not.

Subelements

The following table describes subelements for the pm-inuse element.

Table 5-76  pm-insue Subelements 

Subelement

Required

Description

pm-identifier

only one

Contains data that specifies the vendor who provided the persistence manager implementation. For example, this could be Sun Java System Application Server CMP or a third-party vendor.

pm-version

only one

Contains data that specifies which version of the persistence manager vendor product is to be used.

pm-mapping-factory

Specifies which vendor-specific mapping factory is to be used. This is the name of the class specific to the vendor.

Subelements

none

pm-version

Specifies which version of the persistence manager vendor product is to be used.

Subelements

none

query-filter

Specifies the query filter for the CMP 1.1 finder.

Subelements

none

query-ordering

Specifies the query ordering for the CMP 1.1 finder.

Subelements

none

query-params

Specifies the query parameters for the CMP 1.1 finder.

Subelements

none

query-variables

Specifies variables in query expression for the CMP 1.1 finder.

Subelements

none

schema-generator-properties

Specifies field-specific type mappings in property subelements.

Also allows you to set the use-unique-table-names property. If true, this property specifies that generated table names are unique within each application server domain. The default is false. This property can be overridden during deployment. See Table 8-2.

Subelements

The following table describes subelements for the schema-generator-properties element.

Table 5-77   schema-generator-properties Subelements 

Subelement

Required

Description

property

zero or more

Specifies a property name and value.

Example

<schema-generator-properties>
  <property>
    <name>
      Employee.firstName.jdbc-type
    </name>
    <value>char</value>
  </property>
  <property>
    <name>
      Employee.firstName.jdbc-maximum-length
    </name>
    <value>25</value>
  </property>
  <property>
    <name>
      use-unique-table-names
    </name>
    <value>true</value>
  </property>
</schema-generator-properties>

Pooling and Caching Elements

This section describes the elements associated with cache, timeout, and the EJB pool. These elements are used to control memory usage and performance tuning. For more information, refer to the Sun Java System Application Server Performance Tuning Guide.

The following elements are discussed:

bean-cache

Specifies the entity bean cache properties. Used for entity beans and stateful session beans.

Subelements

The following table describes subelements for the bean-cache element.

Table 5-78   bean-cache Subelements 

Subelement

Required

Description

max-cache-size

zero or one

Specifies the maximum number of beans allowable in cache.

is-cache-overflow-allowed

zero or one

Deprecated.

cache-idle-timeout-in-seconds

zero or one

Specifies the maximum time that a stateful session bean or entity bean is allowed to be idle in cache before being passivated. Default value is 10 minutes (600 seconds).

removal-timeout-in-seconds

zero or one

Specifies the amount of time a bean remains before being removed. If removal-timeout-in-seconds is less than idle-timeout, the bean is removed without being passivated.

resize-quantity

zero or one

Specifies the number of beans to be created if the pool is empty (subject to the max-pool-size limit). Values are from 0 to MAX_INTEGER.

victim-selection-policy

zero or one

Specifies the algorithm that must be used by the container to pick victims. Applies only to stateful session beans.

Example

<bean-cache>
  <max-cache-size>100</max-cache-size>
  <cache-resize-quantity>10</cache-resize-quantity>
  <removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
  <victim-selection-policy>LRU</victim-selection-policy>
    <cache-idle-timeout-in-seconds>
    600
    </cache-idle-timeout-in-seconds>
  <removal-timeout-in-seconds>5400</removal-timeout-in-seconds>
</bean-cache>

bean-pool

Specifies the pool properties of stateless session beans, entity beans, and message-driven bean.

Subelements

The following table describes subelements for the bean-pool element.

Table 5-79   bean-pool Subelements 

Subelement

Required

Description

steady-pool-size

zero or one

Specifies the initial and minimum number of beans maintained in the pool. Default is 32.

resize-quantity

zero or one

Specifies the number of beans to be created if the pool is empty (subject to the max-pool-size limit). Values are from 0 to MAX_INTEGER.

max-pool-size

zero or one

Specifies the maximum number of beans in the pool. Values are from 0 to MAX_INTEGER. Default is to domain.xml or 60.

max-wait-time-in-millis

zero or one

Deprecated.

pool-idle-timeout-in-seconds

zero or one

Specifies the maximum time that a bean is allowed to be idle in the pool. After this time, the bean is removed. This is a hint to the server. Default time is 600 seconds (10 minutes).

Example

<bean-pool>
  <steady-pool-size>10</steady-pool-size>
  <resize-quantity>10</resize-quantity>
  <max-pool-size>100</max-pool-size>
  <pool-idle-timeout-in-seconds>600</pool-idle-timeout-in-seconds>
</bean-pool>

cache-idle-timeout-in-seconds

Specifies the maximum time that a bean can remain idle in the cache. After this amount of time, the container can passivate this bean. A value of 0 specifies that beans may never become candidates for passivation. Default is 600.

Applies to stateful session beans and entity beans.

Subelements

none

cmt-timeout-in-seconds

Contains data that overrides the Transaction Timeout setting of the Transaction Service for an individual bean. The default value, 0, specifies that the default Transaction Service timeout is used. If positive, this value is used for all methods in the bean that start a new container-managed transaction. This value is not used if the bean joins a client transaction.

Subelements

none

commit-option

Specifies the commit option that will be used on transaction completion. Valid values for the Sun Java System Application Server are B or C. Default value is B.


Note

Commit option A is not supported for the Sun Java System Application Server 8 release.


Applies to entity beans.

Subelements

none

Example

<commit-option>B</commit-option>

is-cache-overflow-allowed

This element is deprecated and should not be used.

max-cache-size

Specifies the maximum number of beans allowable in cache. A value of zero indicates an unbounded cache. In reality, there is no hard limit. The max-cache-size limit is just a hint to the cache implementation. Default is 512.

Applies to stateful session beans and entity beans.

Subelements

none

Example

<max-cache-size>100</max-cache-size>

max-pool-size

Specifies the maximum number of bean instances in the pool. Values are from 0 (1 for message-driven bean) to MAX_INTEGER. A value of 0 means the pool is unbounded. Default is 64.

Applies to all beans.

Subelements

none

Example

<max-pool-size>100</max-pool-size>

max-wait-time-in-millis

This element is deprecated and should not be used.

pool-idle-timeout-in-seconds

Specifies the maximum time, in seconds, that a bean instance is allowed to remain idle in the pool. When this timeout expires, the bean instance in a pool becomes a candidate for passivation or deletion. This is a hint to the server. A value of 0 specifies that idle beans can remain in the pool indefinitely. Default value is 600.

Applies to stateless session beans, entity beans, and message-driven beans.


Note

For a stateless session bean or a message-driven bean, the bean can be removed (garbage collected) when the timeout expires.


Subelements

none

Example

<pool-idle-timeout-in-seconds>600</pool-idle-timeout-in-seconds>

removal-timeout-in-seconds

Specifies the amount of time a bean instance can remain idle in the container before it is removed (timeout). A value of 0 specifies that the container does not remove inactive beans automatically. The default value is 5400.

If removal-timeout-in-seconds is less than or equal to cache-idle-timeout-in-seconds, beans are removed immediately without being passivated.

Applies to stateful session beans.

For related information, see cache-idle-timeout-in-seconds.

Subelements

none

Example

<removal-timeout-in-seconds>3600</removal-timeout-in-seconds>

resize-quantity

Specifies the number of bean instances to be:

Values are from 0 to MAX_INTEGER. The pool is not resized below the steady-pool-size. Default is 16.

Applies to stateless session beans, entity beans, and message-driven beans.

For EJB pools, the default value can be the value of the ejb-container element pool-resize-quantity in the domain.xml file. Default is 16.

For EJB caches, the default value can be the value of the ejb-container element cache-resize-quantity in the domain.xml file. Default is 32.

For message-driven beans, the default can be the value of the mdb-container pool-resize-quantity element in the domain.xml file. Default is 2.

Subelements

none

Example

<resize-quantity>10</resize-quantity>

steady-pool-size

Specifies the initial and minimum number of bean instances that should be maintained in the pool. Default is 32. Applies to stateless session beans and message-driven beans.

Subelements

none

Example

<steady-pool-size>10</steady-pool-size>

victim-selection-policy

Specifies how stateful session beans are selected for passivation. Possible values are First In, First Out (FIFO), Least Recently Used (LRU), Not Recently Used (NRU). The default value is NRU, which is actually pseudo-LRU.


Note

The user cannot plug in his own victim selection algorithm.


The victims are generally passivated into a backup store (typically a file system or database). This store is cleaned during startup, and also by a periodic background process that removes idle entries as specified by removal-timeout-in-seconds. The backup store is monitored by a background thread (or sweeper thread) to remove unwanted entries.

Applies to stateful session beans.

Subelements

none

Example

<victim-selection-policy>LRU</victim-selection-policy>

Class Elements

This section describes the elements associated with classes. The following elements are included:

gen-classes

Specifies all the generated class names for a bean.


Note

This is automatically generated by the server at deployment/redeployment time. It should not be specified by the developer or changed after deployment.


Subelements

The following table describes subelements for the gen-class element.

Table 5-80   gen-classes Subelements 

Subelement

Required

Description

remote-impl

zero or one

Specifies the fully-qualified class name of the generated EJBObject impl class.

local-impl

zero or one

Specifies the fully-qualified class name of the generated EJBLocalObject impl class.

remote-home-impl

zero or one

Specifies the fully-qualified class name of the generated EJBHome impl class.

local-home-impl

zero or one

Specifies the fully-qualified class name of the generated EJBLocalHome impl class.

local-home-impl

Specifies the fully-qualified class name of the generated EJBLocalHome impl class.


Note

This is automatically generated by the server at deployment/redeployment time. It should not be specified by the developer or changed after deployment.


Subelements

none

local-impl

Specifies the fully-qualified class name of the generated EJBLocalObject impl class.


Note

This is automatically generated by the server at deployment/redeployment time. It should not be specified by the developer or changed after deployment.


Subelements

none

remote-home-impl

Specifies the fully-qualified class name of the generated EJBHome impl class.


Note

This is automatically generated by the server at deployment/redeployment time. It should not be specified by the developer or changed after deployment.


Subelements

none

remote-impl

Specifies the fully-qualified class name of the generated EJBObject impl class.


Note

This is automatically generated by the server at deployment/redeployment time. It should not be specified by the developer or changed after deployment.


Subelements

none

Sample sun-ejb-jar.xml File

For information on these elements, refer to The sun-ejb-jar.xml File.

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE sun-ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Application Server 8.0 EJB 2.1//EN' 'http://www.sun.com/software/appserver/dtds/sun-ejb-jar_2_1-0.dtd'>

<sun-ejb-jar>
  <display-name>First Module</display-name>
  <enterprise-beans>
    <ejb>
      <ejb-name>CustomerEJB</ejb-name>
      <jndi-name>customer</jndi-name>
      <bean-pool>
        <steady-pool-size>10</steady-pool-size>
        <resize-quantity>10</resize-quantity>
        <max-pool-size>100</max-pool-size>
        <pool-idle-timeout-in-seconds>600</pool-idle-timeout-in-seconds>
      </bean-pool>
      <bean-cache>
        <max-cache-size>100</max-cache-size>
        <resize-quantity>10</resize-quantity>
        <removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
        <victim-selection-policy>LRU</victim-selection-policy>
      </bean-cache>
    </ejb>
    <cmp-resource>
      <jndi-name>jdbc/PointBase</jndi-name>
      <create-tables-at-deploy>true</create-tables-at-deploy>
      <drop-tables-at-undeploy>true</drop-tables-at-undeploy>
    </cmp-resource>
  </enterprise-beans>
</sun-ejb-jar>


The sun-cmp-mappings.xml File

This section describes the XML elements in the sun-cmp-mappings.xml file and provides database schema and XML file examples in the following sections:

Persistence Elements provides information on persistence-related elements in the sun-ejb-jar.xml file.

check-all-at-commit

This element is not implemented. Do not use.

Subelements

none

check-modified-at-commit

Checks concurrent modification of fields in modified beans at commit time.

Subelements

none

cmp-field-mapping

The cmp-field-mapping element associates a field with one or more columns that it maps to. The column can be from a bean’s primary table or any defined secondary table. If a field is mapped to multiple columns, the column listed first in this element is used as a source for getting the value from the database. The columns are updated in the order they appear. There is one cmp-field-mapping element for each cmp-field element defined in the ejb-jar.xml file.

Subelements

The following table describes subelements for the cmp-field-mapping element.

Table 5-81  cmp-field-mapping Subelements 

Subelement

Required

Description

field-name

only one

Specifies the Java identifier of a field. This identifier must match the value of the field-name subelement of the cmp-field that is being mapped.

column-name

one or more

Specifies the name of a column from the primary table, or the qualified table name (TABLE.COLUMN) of a column from a secondary or related table.

read-only

zero or one

Specifies that a field is read-only.

fetched-with

zero or one

Specifies the fetch group for this CMP field’s mapping.

cmr-field-mapping

A container-managed relationship field has a name and one or more column pairs that define the relationship. There is one cmr-field-mapping element for each cmr-field element in the ejb-jar.xml file. A relationship can also participate in a fetch group.

Subelements

The following table describes subelements for the cmr-field-mapping element.

Table 5-82  cmr-field-mapping Subelements 

Subelement

Required

Description

cmr-field-name

only one

Specifies the Java identifier of a field. Must match the value of the cmr-field-name subelement of the cmr-field that is being mapped.

column-pair

one or more

Specifies the pair of columns that determine the relationship between two database tables.

fetched-with

zero or one

Specifies the fetch group for this CMR field’s relationship.

cmr-field-name

Specifies the Java identifier of a field. Must match the value of the cmr-field-name subelement of the cmr-field element in the ejb-jar.xml file.

Subelements

none

column-name

Specifies the name of a column from the primary table, or the qualified table name (TABLE.COLUMN) of a column from a secondary or related table.

Subelements

none

column-pair

Specifies the pair of columns that determine the relationship between two database tables. Each column-pair must contain exactly two column-name subelements, which specify the column’s names. The first column-name element names the table that this bean is mapped to, and the second column-name names the column in the related table.

Subelements

The following table describes subelements for the column-pair element.

Table 5-83  column-pair Subelements 

Subelement

Required

Description

column-name

two

Specifies the name of a column from the primary table, or the qualified table name (TABLE.COLUMN) of a column from a secondary or related table.

consistency

Specifies container behavior in guaranteeing transactional consistency of the data in the bean.

Subelements

The following table describes subelements for the consistency element.

Table 5-84  consistency Subelements 

Subelement

Required

Description

check-all-at-commit

exactly one of these elements is required

This element is not implemented. Do not use.

check-modified-at-commit

Checks concurrent modification of fields in modified beans at commit time.

lock-when-loaded

Obtains an exclusive lock when the data is loaded.

lock-when-modified

This element is not implemented. Do not use.

none

No consistency checking occurs.

ejb-name

Specifies the ejb-name of the entity bean in the ejb-jar.xml file to which the container-managed persistence (CMP) beans corresponds.

Subelements

none

entity-mapping

Specifies the mapping a bean to database columns.

Subelements

The following table describes subelements for the entity-mapping element.

Table 5-85  entity-mapping Subelements 

Subelement

Required

Description

ejb-name

only one

Specifies the name of the entity bean in the ejb-jar.xml file to which the CMP bean corresponds.

table-name

only one

Specifies the name of a database table. The table must be present in the database schema file.

cmp-field-mapping

one or more

Associates a field with one or more columns that it maps to.

cmr-field-mapping

zero or more

A container-managed relationship field has a name and one or more column pairs that define the relationship.

secondary-table

zero or more

Describes the relationship between a bean’s primary and secondary table.

consistency

zero or one

Specifies container behavior in guaranteeing transactional consistency of the data in the bean.

fetched-with

Specifies the fetch group configuration for fields and relationships. The fetched-with element has different default values based on its parent element.

Subelements

The following table describes subelements for the fetched-with element.

Table 5-86  fetched-with Subelements 

Subelement

Required

Description

level

exactly one of these elements is required

Specifies the name of a hierarchical fetch group.

named-group

Specifies the name of an independent fetch group.

none

Specifies that this field or relationship is fetched by itself.

field-name

Specifies the Java identifier of a field. This identifier must match the value of the field-name subelement of the cmp-field element in the ejb-jar.xml file.

Subelements

none

level

Specifies the name of a hierarchical fetch group. The name must be an integer. Fields and relationships that belong to a hierarchical fetch group of equal (or lesser) value are fetched at the same time. The value of level must be greater than zero. Only one is allowed.

Subelements

none

lock-when-loaded

Places a database update lock on the rows corresponding to the bean whenever the bean is loaded. How the lock is placed is database-dependent. The lock is released when the transaction finishes (commit or rollback). While the lock is placed, other database users have read access to the bean.

Subelements

none

lock-when-modified

This element is not implemented. Do not use.

Subelements

none

named-group

Specifies the name of an independent fetch group. All the fields and relationships that are part of a named group are fetched at the same time. A field can only belong to one fetch group, regardless of what type of fetch group is used. One is allowed.

Subelements

none

none

Specifies that this field or relationship is fetched by itself, with no other fields or relationships.

Subelements

none

read-only

Specifies that a field is read-only.

Subelements

none

schema

Specifies the file that contains a description of the database schema to which the beans in this sun-cmp-mappings.xml file are mapped. If this element is empty, the database schema file is automatically generated at deployment time. Otherwise, the schema element should name a .dbschema file with a pathname relative to the directory containing the sun-cmp-mappings.xml file, but without the .dbschema extension. For example:

<schema/> <!-- use automatic schema generation -->

<schema>CompanySchema</schema> <!-- use "CompanySchema.dbschema" -->

See Capturing the Database Schema Automatically.

Subelements

none

secondary-table

Specifies a bean’s secondary table(s).

Subelements

The following table describes subelements for the secondary-table element.

Table 5-87  secondary table Subelements 

Subelement

Required

Description

table-name

only one

Specifies the name of a database table.

column-pair

one or more

Specifies the pair of columns that determine the relationship between two database tables.

sun-cmp-mapping

Specifies beans mapped to a particular database schema.


Note

A bean cannot be related to a bean that maps to a different database schema, even if the beans are deployed in the same EJB JAR file.


Subelements

The following table describes subelements for the sun-cmp-mapping element.

Table 5-88  sun-cmp-mapping Subelements 

Subelement

Required

Description

schema

only one

Specifies the file that contains a description of the database schema.

entity-mapping

one or more

Specifies the mapping of a bean to database columns.

sun-cmp-mappings

Specifies the set of sun-cmp-mapping elements for all the beans that are mapped in an EJB JAR collection.

Subelements

The following table describes subelements for the sun-cmp-mappings element.

Table 5-89  sun-cmp-mappings Subelements 

Subelement

Required

Description

sun-cmp-mapping

one or more

Specifies beans mapped to a particular database schema.

table-name

Specifies the name of a database table. The table must be present in the database schema file. See Capturing the Database Schema Automatically.

Subelements

none

Sample Database Schema Definition

create table TEAMEJB (
  TEAMID varchar2(256) not null,
  NAME varchar2(120) null,
  CITY char(30) not null,
  LEAGUEEJB_LEAGUEID varchar2(256) null,
  constraint PK_TEAMEJB primary key (TEAMID)
)

create table PLAYEREJB (
  POSITION varchar2(15) null,
  PLAYERID varchar2(256) not null,
  NAME char(64) null,
  SALARY number(10, 2) not null,
  constraint PK_PLAYEREJB primary key (PLAYERID)
)

create table LEAGUEEJB (
  LEAGUEID varchar2(256) not null,
  NAME varchar2(256) null,
  SPORT varchar2(256) null,
  constraint PK_LEAGUEEJB primary key (LEAGUEID)
)

create table PLAYEREJBTEAMEJB (
  PLAYEREJB_PLAYERID varchar2(256) null,
  TEAMEJB_TEAMID varchar2(256) null
)

alter table TEAMEJB
  add constraint FK_LEAGUE foreign key (LEAGUEEJB_LEAGUEID)
  references LEAGUEEJB (LEAGUEID)

alter table PLAYEREJBTEAMEJB
  add constraint FK_TEAMS foreign key (PLAYEREJB_PLAYERID)
  references PLAYEREJB (PLAYERID)

alter table PLAYEREJBTEAMEJB
  add constraint FK_PLAYERS foreign key (TEAMEJB_TEAMID)
  references TEAMEJB (TEAMID)

Sample sun-cmp-mappings.xml File

The following mapping would be in a deployable EJB JAR file’s META-INF/sun-cmp-mappings.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<sun-cmp-mappings>
  <sun-cmp-mapping>
    <schema>Roster</schema>
    <entity-mapping>
      <ejb-name>TeamEJB</ejb-name>
      <table-name>TEAMEJB</table-name>
      <cmp-field-mapping>
        <field-name>teamId</field-name>
        <column-name>TEAMEJB.TEAMID</column-name>
      </cmp-field-mapping>
      <cmp-field-mapping>
        <field-name>name</field-name>
        <column-name>TEAMEJB.NAME9</column-name>
      </cmp-field-mapping>
      <cmp-field-mapping>
        <field-name>city</field-name>
        <column-name>TEAMEJB.CITY</column-name>
      </cmp-field-mapping>
      <cmr-field-mapping>
        <cmr-field-name>league</cmr-field-name>
        <column-pair>
          <column-name>TEAMEJB.LEAGUEEJB_LEAGUEID</column-name>
          <column-name>LEAGUEEJB.LEAGUEID</column-name>
        </column-pair>
        <fetched-with>
          <none/>
        </fetched-with>
      </cmr-field-mapping>
      <cmr-field-mapping>
        <cmr-field-name>players</cmr-field-name>
        <column-pair>
          <column-name>TEAMEJB.TEAMID</column-name>
          <column-name>PLAYEREJBTEAMEJB.TEAMEJB_TEAMID</column-name>
        </column-pair>
        <column-pair>
          <column-name>PLAYEREJBTEAMEJB.PLAYEREJB_PLAYERID</column-name>
          <column-name>PLAYEREJB.PLAYERID</column-name>
        </column-pair>
        <fetched-with>
          <none/>
        </fetched-with>
      </cmr-field-mapping>
    </entity-mapping>
    <entity-mapping>
      <ejb-name>PlayerEJB</ejb-name>
      <table-name>PLAYEREJB</table-name>
      <cmp-field-mapping>
        <field-name>position</field-name>
        <column-name>PLAYEREJB.POSITION9</column-name>
      </cmp-field-mapping>
      <cmp-field-mapping>
        <field-name>playerId</field-name>
        <column-name>PLAYEREJB.PLAYERID</column-name>
      </cmp-field-mapping>
      <cmp-field-mapping>
        <field-name>name</field-name>
        <column-name>PLAYEREJB.NAME9</column-name>
      </cmp-field-mapping>
      <cmp-field-mapping>
        <field-name>salary</field-name>
        <column-name>PLAYEREJB.SALARY</column-name>
      </cmp-field-mapping>
      <cmr-field-mapping>
        <cmr-field-name>teams</cmr-field-name>
        <column-pair>
          <column-name>PLAYEREJB.PLAYERID</column-name>
          <column-name>PLAYEREJBTEAMEJB.PLAYEREJB_PLAYERID</column-name>
        </column-pair>
        <column-pair>
          <column-name>PLAYEREJBTEAMEJB.TEAMEJB_TEAMID</column-name>
          <column-name>TEAMEJB.TEAMID</column-name>
        </column-pair>
        <fetched-with>
          <none/>
        </fetched-with>
      </cmr-field-mapping>
    </entity-mapping>
    <entity-mapping>
      <ejb-name>LeagueEJB</ejb-name>
      <table-name>LEAGUEEJB</table-name>
      <cmp-field-mapping>
        <field-name>leagueId</field-name>
        <column-name>LEAGUEEJB.LEAGUEID</column-name>
      </cmp-field-mapping>
      <cmp-field-mapping>
        <field-name>name</field-name>
        <column-name>LEAGUEEJB.NAME9</column-name>
      </cmp-field-mapping>
      <cmp-field-mapping>
        <field-name>sport</field-name>
        <column-name>LEAGUEEJB.SPORT</column-name>
      </cmp-field-mapping>
      <cmr-field-mapping>
        <cmr-field-name>teams</cmr-field-name>
        <column-pair>
          <column-name>LEAGUEEJB.LEAGUEID</column-name>
          <column-name>TEAMEJB.LEAGUEEJB_LEAGUEID</column-name>
        </column-pair>
        <fetched-with>
          <none/>
        </fetched-with>
      </cmr-field-mapping>
    </entity-mapping>
  </sun-cmp-mapping>
</sun-cmp-mappings>


The sun-application-client.xml file

This section describes the XML elements in the sun-application-client.xml file in the following sections:

sun-application-client

This is the root element describing all the runtime bindings of a single application client.

Subelements

The following table describes subelements for the sun-application-client element.

Table 5-90  sun-application-client subelements  

Element

Required

Description

ejb-ref

zero or more

Maps the absolute JNDI name to the ejb-ref in the corresponding J2EE XML file.

resource-ref

zero or more

Maps the absolute JNDI name to the resource-ref in the corresponding J2EE XML file.

resource-env-ref

zero or more

Maps the absolute JNDI name to the resource-env-ref in the corresponding J2EE XML file.

service-ref

zero or more

Specifies runtime settings for a web service reference.

message-destination

zero or more

Specifies the name of a logical message destination.

resource-ref

Maps the absolute JNDI name to the resource-ref element in the corresponding J2EE XML file.

Subelements

The following table describes subelements for the resource-ref element.

Table 5-91  resource-ref subelements  

Element

Required

Description

res-ref-name

only one

Specifies the res-ref-name in the corresponding J2EE application-client.xml file.

jndi-name

only one

Specifies the absolute jndi name of a resource.

default-resource-principal

zero or more

Specifies the default principal (user) that the container uses to access a resource.

res-ref-name

Specifies the res-ref-name in the corresponding J2EE application-client.xml file resource-ref entry.

Subelements

none

default-resource-principal

Specifies the default principal (user) that the container uses to access a resource.

If this element is used in conjunction with a JMS Connection Factory resource, the name and password subelements must be valid entries in Sun Java System Message Queue’s broker user repository. See the “Security Management” chapter in the Sun Java System Message Queue Administrator’s Guide for details.

Subelements

The following table describes subelements for the default-resource-principal element.

Table 5-92  default-resource-principal subelements  

Element

Required

Description

name

only one

Specifies the name of the principal.

password

only one

Specifies the password for the principal.

name

Contains data that specifies the name of the entity.

Subelements

none

password

Contains data that specifies the password for the principal.

Subelements

none

ejb-ref

Maps the ejb-ref-name in the corresponding J2EE application-client.xml file ejb-ref entry to the absolute jndi-name of a bean.

Subelements

The following table describes subelements for the ejb-ref element.

Table 5-93  ejb-ref subelements  

Element

Required

Description

ejb-ref-name

only one

Specifies the name of a ejb reference in the corresponding J2EE application-client.xml file.

jndi-name

only one

Specifies the absolute JNDI name of a bean.

ejb-ref-name

Contains data that specifies the ejb-ref-name in the corresponding J2EE application-client.xml file ejb-ref entry. This element locates the name of the EJB reference in the application.

Subelements

none

resource-env-ref

Specifies the name of a resource env reference.

Subelements

The following table describes subelements for the resource-env-ref element.

Table 5-94  resource-env-ref subelements  

Element

Required

Description

resource-env-ref-name

only one

Specifies the res-ref-name in the corresponding J2EE application-client.xml file resource-env-ref entry.

default-resource-principal

only one

Specifies the default principal (user) that the container uses to access a resource.

jndi-name

only one

Specifies the jndi-name of the associated entity.

resource-env-ref-name

Contains data that specifies the res-ref-name in the corresponding J2EE application-client.xml file resource-env-ref entry.

Subelements

none

message-destination

Specifies the name of a logical message-destination defined within an application. The message-destination-name matches the corresponding message-destination-name in the application-client.xml file.

Subelements

The following table describes subelements for the message-destination element.

Table 5-95  message-destination subelements  

Element

Required

Description

message-destination-name

only one

Specifies the name of a logical message destination defined within the corresponding application-client.xml file.

jndi-name

only one

Specifies the jndi-name of the associated entity.

message-destination-name

Contains data that specifies the name of a logical message destination defined within the corresponding application-client.xml file.

Subelements

none

jndi-name

Contains data that specifies the absolute jndi-name of a URL resource or a resource in the application-client.xml file.

Subelements

none


The sun-acc.xml File

This section describes the XML elements in the sun-acc.xml file:

client-container

Defines Sun Java System Application Server specific configuration for the ACC. This is the root element; there can only be one client-container element in a sun-acc.xml file.

Subelements

The following table describes subelements for the client-container element.

Table 5-96  client-container subelements  

Element

Required

Description

target-server

only one

Specifies the IIOP listener configuration of the target server.

auth-realm

zero or one

Specifies the optional configuration for JAAS authentication realm.

client-credential

zero or one

Specifies the default client credential that will be sent to the server.

log-service

zero or one

Specifies the default log file and the severity level of the message.

property

zero or more

Specifies a property which has a name and a value.

Attributes

The following table describes attributes for the client-container element.

Table 5-97  client-container attributes  

Attribute

Default

Description

send-password

true

If true, specifies that client authentication credentials should be sent to the server. Without authentication credentials, all access to protected EJB components results in exceptions.

target-server

Defines the IIOP listener configuration of the target server.

Subelements

The following table describes subelements for the target-server element.

Table 5-98  target-server subelements  

Element

Required

Description

description

zero or one

Specifies the description of the target server.

security

zero or one

Specifies the security configuration for the IIOP/SSL communication with the target server.

Attributes

The following table describes attributes for the target-server element.

Table 5-99  target-server attributes  

Attribute

Default

Description

name

none

Specifies the name of the application server instance accessed by the client container.

address

none

Specifies the host name or IP address (resolvable by DNS) of the server this client should attach to.

port

none

Specifies the naming service port number (orb.port in domain.xml) of the server this client should attach to.

For a new server instance, you need to assign a port number other than 3700. You can change the port number in the Administration Console. See the Sun Java System Application Server Administration Guide for more information.

description

Contains data that specifies a text description of the containing element.

Subelement

none

Attributes

none

client-credential

Default client credentials that are sent to the server. If this element is present, the credentials are automatically sent to the server, without prompting the user for the user name and password on the client side.

Subelements

The following table describes subelements for the client-credential element.

Table 5-100  client-credential subelement 

Element

Required

Description

property

zero or more

Specifies a property, which has a name and a value.

Attributes

The following table describes attributes for the client-credential element.

Table 5-101  client-credential attributes  

Attribute

Default

Description

user-name

none

The user name used to authenticate the Application client container.

password

none

The password used to authenticate the Application client container.

realm

the default realm for the domain

(optional) The realm (specified by name) where credentials are to be resolved.

log-service

Specifies configuration settings for the log file.

Subelements

The following table describes subelements for the log-service element.

Table 5-102  log-service subelement  

Element

Required

Description

property

zero or more

Specifies a property, which has a name and a value.

Attributes

The following table describes attributes for the log-service element.

Table 5-103  log-service attributes  

Attribute

Default

Description

log-file

your_ACC_dir/logs/client.log

(optional) Specifies the file where the application client container logging information is stored.

level

SEVERE

(optional) Sets the base level of severity. Messages at or above this setting get logged to the log file.

security

Defines SSL security configuration for IIOP/SSL communication with the target server.

Subelements

The following table describes subelements for the security element.

Table 5-104  security subelement  

Element

Required

Description

ssl

only one

Specifies the SSL processing parameters.

cert-db

only one

Specifies the location and authentication to read the certification database.

Attributes

none

ssl

Defines SSL processing parameters.

Subelements

none

Attributes

The following table describes attributes for the SSL element.

Table 5-105  ssl attributes

Attribute

Default

Description

cert-nickname

none

(optional) The nickname of the server certificate in the certificate database or the PKCS#11 token.In the certificate, the name format is tokenname:nickname. Including the tokenname: part of the name in this attribute is optional.

ssl2-enabled

false

(optional) Determines whether SSL2 is enabled.

ssl2-ciphers

none

(optional) A space-separated list of the SSL2 ciphers used with the prefix + to enable or - to disable. For example, +rc4. Allowed values are rc4, rc4export, rc2, rc2export, idea, des, desede3.

ssl3-enabled

true

(optional) Determines whether SSL3 is enabled.

ssl3-tls-ciphers

none

(optional) A space-separated list of the SSL3 ciphers used, with the prefix + to enable or - to disable, for example +rsa_des_sha. Allowed SSL3 values are rsa_rc4_128_md5, , rsa_des_sha, rsa_rc4_40_md5, rsa_rc2_40_md5, rsa_null_md5. Allowed TLS values are rsa_des_56_sha, rsa_rc4_56_sha.

tls-enabled

true

(optional) Determines whether TLS is enabled.

tls-rollback-enabled

true

(optional) Determines whether TLS rollback is enabled.TLS rollback should be enabled for MicroSoft Internet Explorer 5.0 and 5.5.

If both SSL2 and SSL3 are enabled, the server tries SSL3 encryption first. If that fails, the server tries SSL2 encryption. If both SSL2 and SSL3 are enabled for a virtual server, the server tries SSL3 encryption first. If that fails, the server tries SSL2 encryption.

cert-db

Location and password to read the certificate database. Sun Java System Application Server provides utilities with which a certificate database can be created. certutil, distributed as part of NSS can also be used to create certificate database.

Subelement

none

Attributes

The following table describes attributes for the cert-db element.

Table 5-106  cert-db attributes  

Attribute

Default

Description

path

none

Specifies the absolute path of the certificate database (cert7.db).

password

none

Specifies the password to access the certificate database.

auth-realm

JAAS is available on the ACC. Defines the optional configuration for JAAS authentication realm.

Authentication realms require provider-specific properties, which vary depending on what a particular implementation needs.

For more information about how to define realms, see “Realm Configuration” on page 44.

Here is an example of the default file realm:

<auth-realm name="file" classname="com.sun.enterprise.security.auth.realm.file.FileRealm">
  <property name="file" value="
domain_dir/config/keyfile"/>
  <property name="jaas-context" value="fileRealm"/>
</auth-realm>

Which properties an auth-realm element uses depends on the value of the auth-realm element’s name attribute. The file realm uses file and jaas-context properties. Other realms use different properties.

Subelements

The following table describes subelements for the auth-realm element.

Table 5-107  auth-realm subelement  

Element

Required

Description

property

zero or more

Specifies a property, which has a name and a value.

Attributes

The following table describes attributes for the auth-realm element.

Table 5-108  auth-realm attributes  

Attribute

Default

Description

name

none

Defines the name of this realm.

classname

none

Defines the Java class which implements this realm.

property

Specifies a property, which has a name and a value.

Subelement

none

Attributes

The following table describes attributes for the property element.

Table 5-109  property attributes  

Attribute

Default

Description

name

none

Specifies the name of the property.

value

none

Specifies the value of the property.


Web Service Elements

The optional web service elements described here apply to the sun-web.xml and sun-ejb-jar.xml files. The service-ref element and its subelements also apply to the sun-application-client.xml file. Web service elements are as follows:

webservice-description

Specifies a name and optional publish location for a web service.

Subelements

The following table describes subelements for the webservice-description element.

Table 5-110  webservice-description subelements  

Element

Required

Description

webservice-description-name

only one

Specifies a unique name for the web service within a web or EJB module.

wsdl-publish-location

zero or one

Specifies the URL of a directory to which a web service’s WSDL should be published during deployment.

webservice-description-name

Contains data that specifies a unique name for the web service within a web or EJB module.

Subelements

none

wsdl-publish-location

Specifies the URL of a directory to which a web service’s WSDL should be published during deployment. Any required files are published to this directory, preserving their location relative to the module-specific WSDL directory (META-INF/wsdl or WEB-INF/wsdl). For example, suppose you have an ejb.jar file whose webservices.xml file’s wsdl-file element contains the following reference:

META-INF/wsdl/a/Foo.wsdl

Suppose your sun-ejb-jar file contains the following element:

<wsdl-publish-location>file:/home/user1/publish</wsdl-publish-location>

The final WSDL is stored in /home/user1/publish/a/Foo.wsdl.

Subelements

none

service-ref

Specifies runtime settings for a web service reference. Runtime information is only needed in the following cases:

Subelements

The following table describes subelements for the service-ref element.

Table 5-111  service-ref subelements  

Element

Required

Description

service-ref-name

only one

Specifies the web service reference name relative to java:comp/env.

port-info

zero or more

Specifies information for a port within a web service reference.

call-property

zero or more

Specifies JAX-RPC property values that should be set on a javax.xml.rpc.Call object before it is returned to the web service client.

wsdl-override

zero or one

Specifies a valid URL pointing to a final WSDL document.

service-impl-class

zero or one

Specifies the name of the generated service implementation class.

service-qname

zero or one

Specifies the WSDL service element that is being referred to.

service-ref-name

Contains data that specifies the web service reference name relative to java:comp/env.

Subelements

none

port-info

Specifies information for a port within a web service reference.

Either a service-endpoint-interface or a wsdl-port or both should be specified. If both are specified, wsdl-port specifies the port that the container should choose for container-managed port selection.

The same wsdl-port value must not appear in more than one port-info element within the same service-ref.

If a service-endpoint-interface is using container-managed port selection, its value must not appear in more than one port-info element within the same service-ref.

Subelements

The following table describes subelements for the port-info element.

Table 5-112  port-info subelements  

Element

Required

Description

service-endpoint-interface

zero or one

Specifies the web service reference name relative to java:comp/env.

wsdl-port

zero or one

Specifies the WSDL port.

stub-property

zero or more

Specifies JAX-RPC property values that should be set on a javax.xml.rpc.Stub object before it is returned to the web service client.

call-property

zero or more

Specifies JAX-RPC property values that should be set on a javax.xml.rpc.Call object before it is returned to the web service client.

service-endpoint-interface

Contains data that specifies the web service reference name relative to java:comp/env.

Subelements

none

wsdl-port

Specifies the WSDL port.

Subelements

The following table describes subelements for the wsdl-port element.

Table 5-113  wsdl-port subelements  

Element

Required

Description

namespaceURI

only one

Specifies the namespace URI.

localpart

only one

Specifies the local part of a QNAME.

namespaceURI

Contains data that specifies the namespace URI.

Subelements

none

localpart

Contains data that specifies the local part of a QNAME.

Subelements

none

stub-property

Specifies JAX-RPC property values that should be set on a javax.xml.rpc.Stub object before it is returned to the web service client. The property names can be any properties supported by the JAX-RPC Stub implementation.

Subelements

The following table describes subelements for the stub-property element.

Table 5-114  stub-property subelements  

Element

Required

Description

name

only one

Specifies the name of the entity.

value

only one

Specifies the value of the entity.

Example

<service-ref>
  <service-ref-name>service/FooProxy</service-ref-name>
  <port-info>
    <service-endpoint-interface>a.FooPort</service-endpoint-interface>
    <wsdl-port>
      <namespaceURI>urn:Foo</namespaceURI>
      <localpart>FooPort</localpart>
    </wsdl-port>
    <stub-property>
      <name>javax.xml.rpc.service.endpoint.address</name>
      <value>http://localhost:8080/a/Foo</value>
    </stub-property>
  </port-info>
</service-ref>

call-property

Specifies JAX-RPC property values that should be set on a javax.xml.rpc.Call object before it is returned to the web service client. The property names can be any properties supported by the JAX-RPC Call implementation.

Subelements

The following table describes subelements for the call-property element.

Table 5-115  call-property subelements  

Element

Required

Description

name

only one

Specifies the name of the entity.

value

only one

Specifies the value of the entity.

name

Contains data that specifies the name of the entity.

Subelements

none

value

Contains data that specifies the value of the entity.

Subelements

none

wsdl-override

Contains data that specifies a valid URL pointing to a final WSDL document. If not specified, the WSDL document associated with the service-ref in the standard J2EE deployment descriptor is used.

Subelements

none

Example

// available via HTTP
<wsdl-override>http://localhost:8000/myservice/myport?WSDL</wsdl-override>

// in a file
<wsdl-override>file:/home/user1/myfinalwsdl.wsdl</wsdl-override>

service-impl-class

Contains data that specifies the name of the generated service implementation class.

Subelements

none

service-qname

Specifies the WSDL service element that is being referred to.

Subelements

The following table describes subelements for the service-qname element.

Table 5-116  service-qname subelements  

Element

Required

Description

namespaceURI

only one

Specifies the namespace URI.

localpart

only one

Specifies the local part of a QNAME.

webservice-endpoint

Specifies information about a web service endpoint.

Subelements

The following table describes subelements for the webservice-endpoint element.

Table 5-117  webservice-endpoint subelements  

Element

Required

Description

port-component-name

only one

Specifies a unique name for a port component within a web or EJB module.

endpoint-address-uri

zero or one

Specifies the automatically generated endpoint address.

login-config

zero or one

Specifies the authentication configuration for an EJB web service endpoint.

transport-guarantee

zero or one

Specifies that the communication between client and server should be NONE, INTEGRAL, or CONFIDENTIAL.

service-qname

zero or one

Specifies the WSDL service element that is being referred to.

tie-class

zero or one

Specifies the automatically generated name of a tie implementation class for a port component.

servlet-impl-class

zero or one

Specifies the automatically generated name of the generated servlet implementation class.

port-component-name

Contains data that specifies a unique name for a port component within a web or EJB module.

Subelements

none

endpoint-address-uri

Contains data that specifies the relative path combined with the web server root to form the fully qualified endpoint address for a web service endpoint. This is a required element for EJB endpoints and an optional element for servlet endpoints.

For servlet endpoints, this value is relative to the web application context root. For EJB endpoints, the URI is relative to root of the web server (the first portion of the URI is a context root). The context root portion should not conflict with the context root of any web application deployed to the same web server.

In all cases, this value must be a fixed pattern (no ‘*’ allowed).

If the web service endpoint is a servlet that implements only a single endpoint and has only one url-pattern, it is not necessary to set this value, because the web container can derive it from the web.xml file.

Subelements

none

Example

If the web server is listening at http://localhost:8080, the following endpoint-address-uri:

<endpoint-address-uri>StockQuoteService/StockQuotePort</endpoint-address-uri>

results in the following target endpoint address:

http://localhost:8080/StockQuoteService/StockQuotePort

login-config

Specifies the authentication configuration for an EJB web service endpoint. Not needed for servlet web service endpoints. A servlet’s security configuration is contained in the web.xml file.

Subelements

The following table describes subelements for the login-config element.

Table 5-118  login-config subelements  

Element

Required

Description

auth-method

only one

Specifies the authentication mechanism.

auth-method

Contains data that specifies the authentication mechanism for the web service endpoint. As a prerequisite to gaining access to any web resources protected by an authorization constraint, a user must have authenticated using the configured mechanism.

Subelements

none

transport-guarantee

Contains data specifying that the communication between client and server should be NONE, INTEGRAL, or CONFIDENTIAL.

In most cases, a value of INTEGRAL or CONFIDENTIAL indicates that the use of SSL is required.

Subelements

none

tie-class

Contains data that specifies the automatically generated name of a tie implementation class for a port component.

Subelements

none

servlet-impl-class

Contains data that specifies the automatically generated name of the servlet implementation class.

Subelements

none



Previous      Contents      Index      Next     


Copyright 2004 Sun Microsystems, Inc. All rights reserved.