![]() |
JavaTM 2 SDK, Enterprise Edition
|
config
directory. You may edit these files with a text editor. This document describes the configuration parameters that you may edit in the properties files. In most cases, you won't have to make any changes to the properties files. However, if you wish to use a database driver other than Cloudscape, you'll need to follow the instructions in the next section.
config/default.properties
file. No further changes by you are necessary. By default, Cloudscape databases will be created in the cloudscape
directory.If your enterprise beans use the JDBC API to access a database other than Cloudscape, then you must configure the JDBC drivers according to the instructions in the sections that follow. (If you aren't sure if this release supports your JDBC driver, see the Supported Databases and JDBC Drivers section of the Release Notes.)
$J2EE_HOME/lib/system
directory. (Files in this directory have the java.security.AllPermission
, needed because a driver may perform privileged operations.) Be sure to include the classpath to these .jar files in the J2EE_CLASSPATH environment variable. bin/userconfig.sh
, and on Windows it is in bin\userconfig.bat
.Note: You should remove the driver .jar files from the CLASSPATH environment variable.
If your driver does not support XA datasources, you must follow the instructions in the section, Drivers Without XA Datasource Support.
If your driver supports XA datasources, to take advantage of XA's features you must follow the instructions in the section, Drivers with XA Datasource Support.
If your driver supports XA datasources and you follow the instructions in the section, Drivers Without XA Datasource Support, the driver will work but cannot take advantage of XA's features.
jdbc.drivers
and jdbc.datasources
property names by editing the config/default.properties
file. You must also include the classpath of the JDBC driver in the J2EE_CLASSPATH environment variable. jdbc.drivers
property value is a list of JDBC driver class names separated by colons. The syntax follows:Here is an example:jdbc.drivers=<classname>:<classname>: . . .
jdbc.drivers=oracle.jdbc.driver.OracleDriver:testutil.MyDriver
jdbc.datasources
property value links the JNDI name of a DataSource with the URL of a database. Typically, the JNDI name is the logical name of a database. The URL specifies the actual location of a database. Neither the JNDI name nor the URL are hardcoded in the source code of an enterprise bean. To determine the format of the URL, please check the documentation provided by the vendor of the JDBC driver.
The syntax of jdbc.datasources
follows:
.jdbc.datasources=<jndi_datasource>|<url>|<jndi_datasource>|<url>. . .
The pipe character (|) serves two purposes. First, it separates the <jndi_datasource>
and <url>
elements that form a pair. Second, it delimits each pair of <jndi_datasource>
and <url>
elements.
The <jndi_datasource>
element has the following syntax:
Thejdbc/<jndi_name>
jdbc
keyword is followed by a forward slash. The <jndi_name>
is the name of the DataSource that is entered in the JNDI directory.jdbc.datasources=jdbc/Oracle|jdbc:oracle:thin@rtc:1521:acct|jdbc/MyDB|jdbc:test
You must also include the classpath of the JDBC driver in the J2EE_CLASSPATH environment variable.jdbc20.datasources xadatasource.<n>.jndiname xadatasource.<n>.classname xadatasource.<n>.dbuser xadatasource.<n>.dbpassword xadatasource.<n>.prop.<property-name>
jdbc20.datasources
property value links the JNDI name used to locate the DataSource (the parameter of the lookup
method) with the JNDI name of the XA DataSource.
The syntax of jdbc20.datasources
follows:
jdbc20.datasources=<jndi_datasource>|<jndi_XA_datasource>|<jndi_datasource>|<jndi_XA_datasource>. . .
The pipe character (|) serves two purposes. First, it separates the <jndi_datasource>
and <jndi_XA_datasource>
elements that form a pair. Second, it delimits each pair of <jndi_datasource>
and <jndi_XA_datasource>
elements.
The <jndi_datasource> and <jndi_XA_datasource>
elements have the same syntax:
Thejdbc/<jndi_name>
jdbc
keyword is followed by a forward slash. The <jndi_name>
is the name of the DataSource that is entered in the JNDI directory.jdbc20.datasources=jdbc/Merant|jdbc/XAMerant|jdbc/Finch|jdbc/XAFinch
xadatasource.<n>.jndiname
property specifies the JNDI name of the XA DataSource. It has the following syntax:Thexadatasource.<n>.jndiname=jdbc/<jndi_XA_datasource>
<n>
integer links each group of xadatasource
properties. For the first driver <n>
should be 0, for the next it should be 1, then 2, and so forth. The <jndi_XA_datasource>
element matches that specified by the jdbc20.datasources property.
The xadatasource.<n>.classname
property specifies the class name of the XA DataSource
.
The xadatasource.<n>.dbuser
and xadatasource.<n>.dbpassword
properties specify the database user and password used to sign on to the database to perform recovery. Usually, this database user will have the database administrator privilege. (For more information on recoveries, see the section, The distributed.transaction.recovery Property.)
The xadatasource.<n>.prop.<property_name>
specifies the value associated with a particular property name. The actual property names may vary with the JDBC driver.
xadatasource.0.jndiname=jdbc/XAMerant xadatasource.0.classname=com.merant.sequelink.jdbcx.datasource.SequeLinkDataSource xadatasource.0.prop.url=jdbc:sequelink://mypc:5000/[Oracle]
config/default.properties
file.
The value of this property may be either true
or false
. When J2EE is first installed, the value is false
:
distributed.transaction.recovery=false
transaction.timeout
property. For example, you would set the timeout value to 5 seconds as follows:With this setting, if the transaction has not completed within 5 seconds, the J2EE transaction manager rolls it back.transaction.timeout=5
When J2EE is first installed, the timeout value is set to 0:
If the value is 0, the transaction will not time out.transaction.timeout=0
Only enterprise beans with container-managed transactions are affected by the transaction.timeout
property. For enterprise beans with bean-managed, JTA transactions, you invoke the setTransactionTimeout
method of the UserTransaction
interface. You also invoke the setTransactionTimeout
method for other components, such as servlets and JSP pages, that demarcate transaction with the UserTransaction
interface.
config
directory. The following table lists the ports and their corresponding properties files.logs
directory. To change the default directory, edit the value of the log.directory
property of the config/default.properties
file:You can also change the names of several log files by editing thelog.directory=logs
default.properties
file. For example, you can change the name of the output.log
file by modifying the value of the log.output
property.
The log files generated depend on whether you launch j2ee
in the single or multiple VM (virtual machine) mode.
j2ee
runs in a single virtual machine. In this mode, the log files reside in the directory specified by this syntax:The$J2EE_HOME/<logs>/<host>/ejb
<logs>
element is the directory specified by the log.directory
entry in the default.properties
file. The default value is logs
. The <host>
element is the name of the computer.The following log files are generated:
Thesystem.out system.err event.log output.log error.log audit.log
system.out
and system.err
files contain the output generated by enterprise beans that write to System.out
and System.err
. If you run j2ee
with the verbose
option, this output is written to stdout
and stderr
; the system.out
and system.err
log files are not created. The audit.log
file is generated only if the audit
property of the config/auth.properties
file equals true
.j2ee
with the multiVM
option, the EJB and HTTP services run as separate servers in their own VMs. Each deployed application also runs in its own VM. The log files generated are the same as those listed in the previous section, but they reside in different directories.web.properties
file:access.log=access.log error.log=error.log
guest
and the password for this user is guest123
. You can modify the name of the unauthenticated user and password by modifying the following entries in the auth.properties
file:default.principal.name=guest default.principal.password=guest123
<user-home>/.keystore
file. (Where <user-home>
is the value returned by System.getProperty("user.home")
.)
The .keystore
file is typically protected by a password. By default, this password is changeit
. You can modify the password by editing the keystore.password
entry in the web.properties
file.
anyone.role.name
entry in the auth.properties
file.config/default.properties
file:The value must be a positive integer. If you decrease the value of this property then passivation will occur more often.passivation.threshold.memory=128000000
documentroot
entry of the web.properties
file. This entry is always relative to the J2EE_HOME environment variable. Here is the default entry in web.properties
:documentroot=public_html/
Copyright © 2000 Sun Microsystems, Inc. All rights reserved.