JBoss installation and use

xiaoxiao2021-03-14  189

1. Installation 1.1, software installation first to install JDK (only installed JRE is not working, because the JSP page needs to be compiled), the latest official version is JDK1.4.2. Then extract the JBoss's compressed package to a directory, the directory name is generally "JBoss_ version number", JBoss's latest official version is JBoss4.0.0 (released on September 20, 2004). The following configuration is for JBoss3.2.5.1.2, the environment variable required for the environment variable has java_home and jboss_home. Environment variable Java_home is set to the installation path of JDK, and jboss_home is set to the path after JBoss decompression. The setting method is as follows: You can right-click on my computer, select "Properties" -> Select "Advanced" tab -> Click the Environment Variable button -> Click the "New" button of the system variable, then in the dialog box Enter the "Variable Name" for "java_home", the variable value is the JDK installation path, and finally determined. The same method adds JBoss_home. 1.3, running directly in the jboss / bin directory, the startup time is inefficient from 20 seconds to 1 minute, depending on the CPU speed and memory size. 1.4. Termination of JBoss is best not to close the console window when running JBoss, and directly shut down the console can cause an exception when JBoss will start next time. The way to close JBOSS is another open, perform a console window, execute the shutdown.bat batch file under the jboss / bin directory, but bring a parameter "-s", pay attention to the uppercase letters. For convenience, you can also create a shortcut. 1.5, the JBoss is installed for Windows2000 system service is not very convenient to start JBoss from the console. Although the debugging program can see a lot of information from the console, but sometimes JBOSS is automatically run as system service. This requires downloading a gadget Javaservice.exe to download: http://www.alexandriasc.com/software/javaservice/index.html I have downloaded the tool. 2. The deployment of the WAR file supports the heat deployment, that is, the WAR file is not required to restart JBoss (Tomcat does not support this feature) after the WAR file is deployed to the server. The deployment of the WAR file is very simple, copy the WAR file directly to the JBoss / Server / Default / Deploy directory. 2. The deployment of the WAR file supports the heat deployment, that is, the WAR file is not required to restart JBoss (Tomcat does not support this feature) after the WAR file is deployed to the server. The deployment of the WAR file is very simple, copy the WAR file directly to the JBoss / Server / Default / Deploy directory. 3, JBoss directory structure bin directory: Create a directory contains various script files and related files, have used Run.bat and Shutdown.bat two batch files. Client directory: Store configuration information and JAR files that may be used by Java client applications or external Web containers. DCS Directory: Save the XML files and DTD files referenced in JBoss (here also provide examples of how to write configuration files in JBoss). In this directory, there is a JCA configuration file that configures the data source for a database such as MySQL, Oracle, SQL Server, Postgres, etc.).

LIB Directory: The JAR file required to run the JBoss microennote here is stored. Do not store any of your own JAR files in this directory. Server directory: Each subdirectory here corresponds to a server configuration. This configuration is determined by the parameter "-c " when running the script file. There are three configuration examples in the Server directory, namely all, default, and minimal, each configuration installed service is different. Where default is the default configuration. Minimal Directory: Only the least service required to start JBoss, such as log service, JNDI, and URL deployment scanner (discovers new deployment), does not include web containers, EJBs, and JMS. All Directory: Start all services, including RMI / IIOP, cluster services, and Web service deployers (the default configuration will not be loaded). When starting JBOSS, if run.bat does not bring any parameters, the configuration used is the configuration in the Server / Default directory. If you want to start JBoss in other directories, you can use the following parameters: run -c all the command will start JBoss in the all-directory configuration information. You can also create a new directory in the Server directory, write the configuration files yourself. The following is an example of a DEFAULT directory, which describes the directory structure of the server configuration. Conf directory: This directory has a JBoss-Service.xml file that specifies the core service, or you can put files configured by other service. Data Directory: This directory is where JBoss built-in database Hypersonic storage data is also places where JBossMQ (The JBoss IMPLEmentation Of JMS) stores related information. Deploy directory: This is where the J2EE application (JAR, WAR and EAR files) is deployed, just copy the corresponding file to this directory. This directory is also used to heat deployment services and JCA resource adapters. Some services have been deployed to this directory, such as JMX-Console, you can get JBOSS will be accessed. JBoss will scan the deploy directory periodically when there is any component changes, and JBOSS will redeploy the program. LIB Directory: Store the JAR file required for the server configuration, for example, you can put the JDBC driver in this directory. Log Directory: Store log information. JBOSS uses Jakarta log4j package storage logs, you can also use this information directly in the program. TMP Directory: Temporary files generated during deployment during deployment. Work Directory: The work directory when Tomcat compiles the JSP file. Directory DATA, LOG, TMP and WORK do not exist after JBoss installation, automatically established when JBoss is running. 4, JBoss and database connections Here, the database connection is configured in JBoss to configure the data source through the XML file, and access the database through the name in the program. The database connection configuration after jboss3.2.3 is relatively simple, and writing the configuration file with the appropriate example in JBoss, the configuration files have the appropriate examples, the configuration files are in directory jboss_home / docs / example / jca, such as the configuration of the MySQL database The file is mysql-ds.xml. This configuration file can be modified as long as the specific situation of the database is modified. After the modification is complete, copy the configuration file to the JBoss_Home / Server / Default directory.

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

New Post(0)