Hello jboss (reproduced)

xiaoxiao2021-03-06  22

This section is selected from O'Reilly's "JBoss EJB Workbook", and now provides free download of English.

http://www.oreilly.com/catalog/entjbeans3/workbooks/ejbwjboss.files.zip

This is my reading notes, because time and levels are limited, there will be some mistakes, please don't finish correct.

You can contact me through email, kitta4587 @ 163.com.

This article will try to guide you to install a fully runable JBoss server through some necessary steps, and

Solve some other information about JBoss.

If you need more detailed information about JBoss configuration, you can access JBoss's Web site.

Http://www.jboss.org, where you can find a rich online document.

About JBoss

JBoss is the result of the world's developers work together, a application server based on J2EE-based open source. Not

There are more than one million copies from 12 months. JBoss is the first J2EE application server.

JBoss fully implements J2EE's service stack:

* EJB (Enterprise JavaBeans)

* JMS (Java Message Service)

* JTS / JTA (Java Transaction Service / Java Transaction API)

* Servlet and JSP (JavaServer Pages)

* JNDI (Java Naming and Directory Interface)

It also provides some advanced features, such as clusters, JMX, Web Service.

It also integrates IIOP (Internet Inter-ORB Protocol).

Because JBoss code follows the LGPL license, you can use it for free in any commercial app without paying the fee.

LGPL - GNU Lesser General Public License,

reference

http://www.gnu.org/copyleft/LESSER.txt.

Install JBoss application server

First, make sure you have installed J2SE JDK 1.3 or higher, and the correct configuration is performed.

This is found, you need to configure the following environment variables:

* Java_home

* ClassPath

* Path

Then go to JBoss's Web site (

Http://www.jboss.org Download the binary version of JBoss.

You will find that all current binary versions are divided into zip and tar.gz format files.

ZIP is suitable for Windows systems, while tar.gz is suitable for UNIX classes, choosing your best to your version.

Unzip your downloaded files to a directory (you choose), under Windows, you can use Winzip, etc.

Tools, under UNIX, you can use the following command:

$ Gunzip jboss-3.2.0.tar.gz

$ TAR XF JBOOS-3.2.0.tar

Set the JBoss_Home environment variable to install the directory for your JBoss.

Then go to the jboss_home / bin directory, run "Start Script":

UNIX:

$ ./Run.sh

Windows:

C: /jboss-3.2.0/bin> run.bat

Example, JBoss binary version is 3.2.2, and the J2SDK version is 1.4.1:

Windows 2K system:

J2SDK installed in C: / J2SDK, JBoss installed in C: / JBoss, the settings of environment variables are as follows:

Java_Home = C: / J2SDK

ClassPath =% classpath%;% java_home% / lib / *. Jar;% java_home% / jre / lib / *. Jar

JBoss_Home = C: / JBoss

Path =% PATH%;% java_home% / bin;% jboss_home% / bin

Under UNIX system:

J2SDK installed in / OPT / J2SDK, JBoss installed in / opt / jboss, the settings of environment variables are as follows:

Java_Home = / OPT / J2SDK

ClassPath = $ ClassPath: $ java_home / lib / *. Jar: $ java_home / jRE / lib / *. Jar

JBoss_Home = / OPT / JBOSS

PATH = $ PATH: $ java_home / bin: $ jboss_home / bin

Explore the directory structure of JBoss

Install JBoss creates the following directory structure:

Table 1.1 JBoss catalog

[PRE] ----------------------------------------------- -------------------------------

Directory description

-------------------------------------------------- ----------------------------

BIN started and closes JBoss scripts

Client client with Java libraries required to communicate with JBOSS (JARS)

DOCS configuration sample file (database configuration, etc.)

DOC / DTD DTD of various XML files used in JBoss.

LIB Some JARs, JBOSS is loaded and shared by all JBoss configurations.

(Don't put your stay here)

Server Various JBoss configurations. Each configuration must be placed in different subdirectors. Subdirectory

The name indicates the name of the configuration.

JBoss contains 3 default configurations: Minimial, Default, and ALL.

Server / All JBoss fully configured, launching all services, including clusters and iiop.

The default configuration of Server / Default JBoss.

Use when you specify a configuration name in the JBoss command to specify.

Server / Default / conf. profile. The next section will learn more about its content.

Server / Default / Data JBoss database file. For example, embedded databases, or JBossmq.

The hot deployment catalog of Server / Default / Deploy JBoss. Any file or directory placed here will be automatically automatically

deploy. EJB, WAR, EAR, and even service.

Some Server / Default / Lib Some JARs, JBOSs load them when starting a specific configuration.

(All and minimial configuration also include this and the following two directories.)

Server / Default / Log JBoss log file.

Temporary files for Server / Default / TMP JBoss.

-------------------------------------------------- ---------------------------- [/ pre]

If you want to define your own configuration, you must first create a new subdirectory containing the appropriate file in the Server directory.

You can use the -c parameter when starting: Windows: Windows:

C: /jboss-3.2.0/bin> run.bat -c config-name

Unix

$ ./Run.sh -c config-name

JBoss configuration file

Just like the last section, JBoss's server directory can contain any number of directory, each representing a different JBoss configuration. The server / config-name / conf directory contains the JBoss configuration file. Table 1.2 These different files are given: Table 1.2, JBoss configuration file [pre] -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------- File Description ------------------------------------------------ ------------------------------ JACORB.PROPERTIES JBOSS IIOP Configuration JBossmq-State.xml JBossmq (JMS Implementation) User Configuration JBoss -service.xml The definition of the JBoss service running time (Class Loader, JNDi, Deployer et al. log4j.xml log4j Configuration Login-Config.xml JBoss Security Configuration (JBOSSSX) Standardjaws.xml JBoss's legacy CMP 1.1 engine default Configuration. Contains mapping information for jdbc-to-sql of various databases, default CMP settings, log configurations, etc. Standardjbosscmp-JDBC.XML is the same as Standardjaws.xml except for the JBoss's CMP 2.0 engine, --------------------------- -------------------------------------------------- - [/ pre]

Deployment in jboss

The deployment process in JBoss is very simple and straightforward. In each configuration, JBoss constantly scans changes in a special directory: $ jboss_home / server / config-name / deploy This directory is generally called "deployment directory". You can copy the following files to this directory: * Any JAR library (where the class will be added to the JBoss ClassPath) * EJB JAR * WAR (Web Application Archive) * EAR (Enterprise Application Archive) * Contains JBoss MBean The defined XML file * A directory that contains EJB JAR, WAR or EAR, and ends with .jar, .war or. Pear. To re-deploy any of the above files (JAR, WAR, EAR, XML, etc.), you can overwrite the new version of the file. JBoss discovers changes based on the time of comparison files, writes in previous files, and then deploy new files. To re-deploy a directory, update his modification, such as Touch.

Quickly browse JBoss's internal structure

From version 3.0, JBoss has been built around some very powerful concepts, allowing users to customize and adjust their servers without being limited to J2EE. Flexibility allows JBOSS to be available in different environments, ranging from embedded systems to a very large server cluster. The following sections will briefly introduce some of these concepts. Micron core architecture

JBoss is based on a microelectronuclear design, that is, the component can insert it at runtime to extend its behavior. This design is ideal for J2EE platforms, an essentially service-based platform. This platform contains persistent, transactions, security, name, messages, logs, etc. services. Other Application Server is generally like a single-chip integrated circuit, they always contain all J2EE platform services. JBoss uses a completely different way: Each service image is hotly deployed on a very simple kernel, called JBoss Server SPINE. In addition, users are encouraged to implement their own services that run on JBoss. Therefore, JBoss application servers are not limited to J2EE applications, and he is frequently used to build any applications that require powerful and reliable basis. Therefore, the core of JBoss is also considered to be WebOS. Figure 1.1 JBoss Server SPINE and some hot deployment services [pre] JMS User Service a EJB Container (jbossmq) | | | | | --------------------- ---------------------------- | | | | ----------- -------------------------------------- | | | JNDI JNDI | (JBossns) (JBossns Servlet / JSP [/ pre] JBoss Server Spine The SUN-based JMX (Java Managerment Extensions) specification, with standard way to manage any deployed components. In JMX habits, a deployed service in JBoss is called a MBean (a managed bean). More information about JMX specification can be found at Sun's Web Site: http://java.sun.com/products/javaManagement

Hot deployment

Since 2.0 release, JBoss is known as the first J2EE-based application server that supports thermal deployment and re-departers, and many application servers need to be restarted to update an application. Thanks to the microconuclear architecture and revolutionary Java class loader, JBoss 3.0 and subsequent release versions further push this logic. Not only can you thermally deploy and redeploy your application, but they can be hot to deploy any services and track the dependence between service rooms. These features make JBoss can be used in a very harsh environment, such as a telecommunications system.

Network boot

JBoss can guide yourself and your app anywhere in the network, as long as you specify a simple URL for JBoss Server Spine. This allows you to manage all configurations of a JBoss node cluster from a central web server. This gives a deep impression that the deployment of the new server is very simple. JBoss's bootstrap code is only about 50K, which is suitable for many embedded systems. Separate caller

JBoss completely separated the processor of the protocol, and the call received from the target service will eventually serve the request. Therefore, when a new processor (called a JBoss caller) is deployed to JBoss, you can automatically reach all existing service and applications through this new call transmitter. JBoss 3.2 currently supports the following types of caller: * RMI * RMI Over HTTP * IIOP * JMS * SOAP * HA-RMI (Clustering Over RMI)

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

New Post(0)