Today's work is mainly to install JBoss. He summarizes the experience of the JBoss Application Server after introducing JBoss Application Server after introducing JBoss Application Server.
Why choose JBOSS to make a application server?
JBoss is a name of the J2EE application server suite that meets the standard open source. The latest version is 3.0. JAS kit comprising JBossServer EJB v2.0 Container and server, JBossMQ JMS 1.0 implemetation, JBossNS JNDI implemetation, JBossCMP advanced O / R mapper and JDBC data object storage implemetation and JAAS-based JBossSX security frameeork. All JBoss applications are 100% pure Java applications. JBoss 3.0 includes the latest micro JMX kernel, complete HTTP Server (Jetty or Tomcat), JCA, EJB2.0, is a complete, richly based on J2EE-based application server. JBoss3.0 follows EJB1.1 specification and some EJB2.0 specification. In this regard, it is similar to Sun's 'J2SDK Enterprise Edition' (J2EE), but the JBoss server core is only supported by EJB servers. The JBoss kernel does not include a web packet container that supports Severlet / JSP, although it bundles Tomcat or Jetty. The minimum kernel needs to refer to the minimum memory and disk space required by JBoss. JBOSS can run on a machine that is more than 64mram, requires little disk space (including source code). Sun's J2EE requires a minimum of 128mram, 31M disk space. Due to the requirement of smaller memory, JBoss starts 10 times faster than Sun J2EE and comes with a database server (Hypersonic SQL Server), and the database server starts automatically when JBoss starts (Sun's J2EE also has a Cloudscape SQL Server, However, Cloudscape SQL Server must be started separately from Sun's J2EE). One of the perfect features of JBoss is that it supports "hot" deployment. This means that deploying a bean is that the JAR file is as simple as the deployment directory. If you are in the case where Bean has deployed, JBOSS automatically uninstall the bean, and then deploy the new version of Bean. JBoss is based on LGPL distribution, that is, it is completely free. (Compiled from: http://www.jboos.org)
Install JAS3.0
First install JAS under Windows, after the installation is successful, then port the JAS to the Linux server. · Install JDK1.3, before installing JAS, you must install JDK on the JAS server. · Download JAS3.0 installer first go to the JBoss site to download JAS3.0 installer, file name jboss-3.0.0_tomcat-4.0.31.zip download address 1: http://www.jboss.org/downloads.jsp Download address 2: http://sourceforge.net/projects/jboss/ · After the installation is released, use the compression tool WinRAR, release jboss-3.0.0_tomcat-4.0.31.zip to C: /, release, C: The JBOSS-3.0.0_tomcat-4.0.3 directory appears, which is the main directory of JAS. • There is a bin directory in the primary directory of JAS JAS, which is JAS's running entry, run.bat is the JAS's Windows version running program, Ruh.sh is JAS's UNIX version (including Linux, Solaris and other operating system) running programs . Double-click the run.bat file and pop up the run window. Image 1 Just starting the window of JAS
Image 2 JAS window in operation
After the JAS is running, the 8080 port is occupied by Tomcat's servlet engine, and the 8082 port is occupied by JBoss agent management. The 8080 port occupied by Tomcat can be modified, and will be introduced below. JAS directory and description agreement: In the following, I will explain and describe some of JAS. The main directory of JAS is $ {jboss.home} · JAS BIN directory name is bin, described as $ {jboss.bin}, which is used to store JAS launcher and runtime package, starting under Windows JAS The program is run.bat, and the starter of JAS under UNIX is run.sh. · JAS's Client directory name is a client, which is described as $ {jboss.client}, which is used to store some of the packages used by JAS. · J2EE Application The directory name is described as $ {jboss.configuration}, JAS in the default state is default, can specify the name by adding parameter "-c" when running the launcher. E.g:
Run.bat -c j2eeoa
· JAS library directory describes $ {jboss.home} / server / $ {jboss.configuration} / lib, JAS automatically loads all library files in this directory (extension JAR compressed file) . · The JAS deployment directory is described as $ {jboss.home} / server / $ {jboss.configuration} / deploy, this directory stores J2EE Application, EJB, and some configuration files, such as mysql-service.xml, mail-service.xml, Tomcat4-Service.xml, JMS-Service.xml, etc. · JAS configuration directory describes $ {jboss.home} / server / $ {jboss.configuration} / conf, this directory stores JAS configuration files such as JBoss-Service.xml, Log4j.xml, Standardjaws.xml, StandardJboss. XML, StandardJbosscmp-jdbc.xml, etc. · JAS log directory is described as $ {jboss.home} / server / $ {jboss.configuration} / log, JAS is named server.log in the default. You can specify the log file name by modifying log4j.xml, as shown below: "Org.jboss.logging.Appender.DailyRollingFileAppender"> ... appender> Picture 3 Modify log4j.xml Specify log file · JAS Tomcat directory is described as $ {jboss.home} / catalina, which is used to provide a servlet / JSP engine. · Here is a simple JBoss directory structure diagram: / | --bin | --Client | - Server | - $ {jboss.configuration} | --CONF | - Deploy | --LOG ... ... Let JBoss and comrainable Tomcat run JAS3.0 with a Tomcat web packet container, but Tomcat is not started separately, and must be run in JAS. The Tomcat can be run separately by the following configuration. · Modify the tomcat4-service.xml file under JAS, set the Tomcat's HTTP port to 9090, below is part of Tomcat4-Service.xml: "org.apache.catalina.connector.http.httpConnector" Port = "9090" MINPROCESSORS = "3" maxprocessors = "10" Enablelookups = "True" Acceptcount = "10" debug = "0" connectionTIMEOUT = "60000" /> Image 4 Modify Tomcat's HTTP port · Copy $ {jboss.home} / lib directory two JAR file jaxp.jar, crimson.jar to $ {jboss.home} / catalina / common / lib directory. · Start Tomcat and JBoss separately. Enter Startup.bat in $ {jboss.home} / catalina / bin directory. Tomcat runs, it takes up 8080 port. Enter run.bat in $ {jboss.home} / bin directory, JBOSS is also running, and its HTTP engine takes up 9090 port. This JAS is already available, below to configure the JAS connection database. Connect to the database Note: The database required by the project is a MySQL database, so you must connect the JAS and MySQL database servers. Download MySQL JDBC driver Use the JDBC connection mysql to use the org.gjt.mm.mysql.driver driver, first download MySQL's JDBC driver, press the following address MM.MYSQL-2.0.13-you Must-unjar-me.jar downloads. Download address: http://sourceforge.net/projects/mmmmySQL/ Release driver The driver above the downloaded driver includes mm.mysql-2.0.13-bin.jar, open source and a license, use WinRAR to release the compressed file Where mm.mysql-2.0.13-bin.jar is the MySQL JDBC driver, 2.0.13 in the driver file name is the version number of the driver. Configuring drivers • Method 1: (Recommended this method) Copy mm.mysql-2.0.13-bin.jar to JAS library directory is $ {jboss.home} / server / $ {jboss.configuration} / lib · Method 2: Add JBoss_CLASSPATH in the system variable, the value of mm.mysql-2.0.13-bin.jar: for example: Under the Windows operating system SET JBOSS_CLASSPATH = C: /J2EE/JDBC /MM.MYSQL-2.0.13/mm.mysql-2.0.13-bin.jar Image 5 Setting System Variable JBoss_ClassPath Under UNIX operating system SetENV JBOSS_CLASSPATH /USR / LOCAL/JDBC /MM.MYSQL-2.0.13-bin.jar Under the Linux operating system JBoss_ClassPath = / usr / local / jdbc / mm.mysql-2.0.13-bin.jar Export jboss_classpath Install MySQL Services $ {JBoss.home} / DOCS / Examples / JCA directory stores database map mapping service profiles provided by JAS, including Oracle, DB2, Informix, MSSQL, MySQL, Hypersonic SQL, Postgres SQL and other expectations. Copy the mysql-service.xml file to $ {jboss.home} / server / $ {jboss.configuration} / deploy directory. Configure mysql-service.xml to modify the following items in MySQL-Service.xml, and other items must be changed depending on the situation. · JNDINAME · ConnectionURL · Driverclass · Username · Password JDBC: mysql: //192.168.0.6/myproject config-protety> TYPE = "java.lang.string"> Org.gjt.mm.mysql.driver config-property> TYPE = "java.lang.string"> test config-property> TYPE = "java.lang.string"> test config-property> Properties> attribute> JBoss.jca: Service = rarDeployment, Name = jboss localtransaction jdbc wrapper depende> mbean> depende> Source code: Download now, all preparations are done, now just run JAS, see if the JAS connected to the MySQL database is matched. If JAS runs properly in Windows, just put JAS to the Linux server. Run JAS on the Linux server to start with run.sh.