J2EE Configuration Guide

zhaozj2021-02-17  75

J2EE Configuration Guide 1. Introduction This article describes the configuration of the J2EE environment, all the files involved in the J2EE installation directory, these files are text files, you can have any text editor to edit them. Usually, you have not changed these files. But if you use the database driver is not Cloudscape, you need to follow the contents of this chapter. 2, JDBC drive default J2EE installation After supporting the Cloudscape database (a demo database provided by Sun), if your EJB is not connected to the Cloudscape database, then you need to configure it. (If you can't determine this version of J2EE support you use the JDBC driver, please see related information to 1111.) 3, the driven location You must put the driver file (.jar file) Copy to $ J2EE_HOME / lib / system directory. And to ensure that the file is included in the environment variable of J2EE_CLASSPATH. 4, J2EE_CLASSPATH Environment Variable J2EE Server The connection database is driven through the JDBC. Locate the location of the driver file (.jar file) via J2EE_CLASSPATH. You can set this variable on the command line before starting J2EE. But we recommend you set the J2EE_CLASSPATH variable in the script. Editing User Profiles is a step in the process of installation. In UNIX, the user profile is bin / userconfig.bat in /bin/userconfig.sh, down / userconfig.bat: You should also remove the driver file (.jar file) in the ClassPath environment variable. 5. JDBC 1.0 Drivers To configure JDBC.DRIVERS and JDBC.DataSources for the JDBC.DRIVERS and JDBC.DataSources for the JDBC 1.0 drive, edit the config / default.properties file. Again it is that the driver file must be included in the J2EE_CLASSPATH environment variable. The value of the jdbc.drivers attribute jdbc.drivers attribute is a series of colon-split JDBC drivers. The format is as follows: jdbc.driver = ::... Name, one is the URL of the database. Typical case is: JNDI name is the logical name of the database, and RUL specifies the actual location of the database. JNDI names and URL are specified during EJB coding. RUL's format, please refer to the documentation of the JDBC driver provider. The syntax of JDBC.DataSources is as follows: jdbc.datasources = |||... | Symbol has two functions. First, it separates a few JNDI_DATASOURCE; second, it separates JNDI_DataSource> and elements in each JNDI_DataSource. The syntax of JNDI_DataSource element is as follows: JDBC / starting with JDBC keyword, JNDI_NAME is the DataSouce name specified in the JNDI directory .

For example: jdbc.datasources = JDBC / ORACLE | JDBC: Oracle: Thin @ RTC: 1521: ACCT | JDBC / MYDB | JDBC: TEST 6, support JTA JDBC2.0 driver configures JTA's JDBC2.0 driver, you need to set up The value of the following attributes: jdbc20.datasources XADataSource..jndiname xadatasource..classname XADataSource..dbuser xadatasource..dbpassword Xadatasource..prop. You must also include JDBC driver files in the J2EE_CLASSPATH environment variable. JDBC20.DataSources Properties JDBC20.DataSource value and JNDI name connection, used to locate the location of DataSouce (it is the parameter of the Lookup method). The syntax of jdbc20.datasource is as follows: jdbc20.datasources = ||| The role is two, first, separated from JNDI_DataSource and and makes a pair, second, separated each pair JNDI_DataSource>, element. And JNDI_XA_DATASOURCE has the same syntax: the JDBC / JDBC keypower begins. JNDI_NAME is a DataSource name, which points to the JNDI directory. For example: jdbc20.datasources = jdbc / merant | jdbc / xamerant | jdbc / finch | jdbc / xafinch xadatasource attribute XADataSource..jndiname property Specifies the JNDI name of XA DataSource. The syntax is as follows: XADataSource..jndiname = JDBC / N represents each set of Xadatasource. The first JDBC2.0 driver N is 0, the next one is 1, 2, etc. JNDI_XA_DATASOURCE Elements Corresponds to the value specified by JDBC20.DataSources. The xadatasource..dbuser and xadatasource..dbpassword specify the database user and password. Usually the user has administrator's permissions (more information, see 2222 the distribute.transaction.recovery). XADataSource..prop. Specify the value associated with a specific property value. The actual value may be a JDBC driver. For example: xadatasource.0.jndiname = jdbc / XAMerant xadatasource.0.classname = com.merant.sequelink.jdbcx.datasource.SequeLinkDataSource xadatasource.0.prop.url = jdbc: sequelink: // mypc: 5000 / [Oracle] 7 And you can edit the config / default.properties file to control the transaction and timeout settings. Distributed.Transaction.Recovery Property This property controls whether distributed is happening. If these things can occur, the following conditions must be met: the range of things in cross-library operations. The J2EE program passed the JDBC2.0 JTA driver access database When the fault occurs, the components of the things can be submitted or rolled in accordance with the two-way submission protocol. When the thing occurs, the server will be submitted or rolled after the server is restarted.

Distributed.Transaction.Recovery's value is True or False. J2EE is installed after the default is false. Distributed.Transaction.Recovery = false Transaction.time Property In the EJB of applying Container-Managed, you can control the timeout interval by setting the value of Transaction.Timeout. For example: Transaction.timeout = 5 After setting, if things are not completed in 5 seconds, the J2EE Life Manager will roll back. When J2EE is installed for the first time, the value of timeout is 0 when the value is not timeout. Only EJBs using Container-Managed managers are affected by Timeout. As for in Bean-Managed and JTA Transactions, you can reference the setTransactionTimeout method for useertransaction. At the same time, you can also quote the setTransactionTimeout method in other sets: such as servlets and JSP. 8, port J2EE requires TCP / IP ports. Modify the corresponding file in the config directory to modify the port number. The following table is the port number and the corresponding file. EJB 9191 ejb.properties http.port = 9191 HTTP 8000 web.properties port = 8000 HTTPS 7000 web.properties https.port = 7000 Naming and Directory 1050 orb.properties port = 1050 9191 port for providing a client to download the required stub class 8000 The HTTP service 7000 is provided with HTTPS service 1050 port 9 based on ORB-based JNDI name service, and log file J2EE Server has several log files. Defaults these files in the logs directory. Edit the log.directory property in the config / default.properties file can change the default directory. Log.directory = Logs, you can also edit the name of the default.properties file to change the log file. For example: You can modify the value of the log.output property to modify the name of the Output.log file. In general, the log file is determined to start J2EE mode. (SINGLE or MULTIPLE VM (Virtual Machine) mode) SINGLE VM log file The default case is Single VM mode. In this case, the log file is located in $ J2EE_HOME /// EJB logs is specified in the Default.properties property. The Host element is a computer name. Generate the following files. System.out system.err Event.log output.log error.log system.out and system.err files include the output of System.out and System.ERR in EJB. If you run the J2EE-Verbose number, the output is written to stdout and stderr (standard error. Output). System.out and system.err log files are not built. Audit.lo is created when only the audit property value is TRUE in the config / auth.properties file. Multiple VM log If you start Server, EJB and HTTP services in J2EE -Mutivm start on your own virtual machine. Each DEPPLOY application is also running in your own virtual machine.

转载请注明原文地址:https://www.9cbs.com/read-31116.html

New Post(0)