JBoss3 learning notes

zhaozj2021-02-16  53

table of Contents

One. Operating environment. Prepare work three. Install four. Configuration instance XPETSTORE

1. Create JBoss "XPetStore" service 2. Configure JMS 3. Configure JDBC 4. Configure JavaMail 5. Start JBoss 6. Specify the XPetStore application server 7. Specify database 8. Build Source code 9. Publish application 10. Initialize Database 11. Run application 12. Accidental error exclude five. Conclude

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

One. Operating environment operating system: Windows 2000

Application Server: JBoss3.x

Database: mysql4.x

Virtual machine: Sun JDK1.4.x

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

two. Prepare work 1. Install the JDK1.4.x version, set the java_home variable, and add "{% java_home} / bin" to the PATH.

2. Please download JBoss3.x. The main station address http://www.jboss.org/.

3. Please download and install MySQL4.x. The main station address http://www.mysql.org/.

4. Please download XpetStore3.x. Home address http://xpetstore.sourceForge.net/.

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

three. Installation 1. Download the file to download the file. This article assumes that the path is decompressed to C: /Work/JBOSS-3.2.2RC2.

2. Set the JBoss_Home variable. Perform a command window to run the run.bat command under the bin directory. Please note that there is no abnormality in the background.

3. After about half a minute, please visit http: // localhost: 8080 / jmx-console /. If the page is successfully displayed, the installation is successful.

4. Make a command window, run the shutdown.bat -s command under the bin directory to stop JBoss.

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

four. Configure instance xpetStore1. Create a JBoss "XPetStore" service to create a new directory xpetstore in JBoss_Home / Server /, copy the contents of JBoss_Home / Server / Default under XpetStore.

2. Configure JMSCREATE JBOSS_HOME / Server / XPetStore / Deploy / JMS / JBOSSMQ-DESTINATIONS-XPETSTORE-Service.xml to create JMS Queues Queue / Order and Queue / Mail.

THIS XML File Should Look Like this:

Queue / Order Jboss.mq:Service=DestinationManager Queue / Mail Jboss.mq:Service=DestinationManager 3. Configure JDBCPY The JDBC Driver to JBoss_Home / Server / XPetStore / lib.

Create JBoss_Home / Server / XpetStore / Deploy / MySQL-DS.XML. (Do Not Change The HSQLDB-DS.XML, Keep It.) Edit MySQL-DS.XML TO CREATE The Datasource Java: / XPetStoreds.

JBoss_Home / Server / XpetStore / Depoy / MySQL-DS.XML SHOULD LOOK LIKE THIS:

XpetStoreds JDBC: MySQL: // localhost / xpetstore com.mysql.jdbc.driver thisway Thatway 5 HSQLDBREALM 4. Configure JavaMailCreate The Mail-Ssetion Java /: Mail.

Make Sure That Jboss_Home / Server / XpetStore / Deploy / Mail-Service.xml Look Like this:

Mail your-user-name your-password 5. Start JBossCD JBOSS_HOME / BIN Run.BAT -C XPetStore 6. Specify the XPetStore application server Download and Unzip the xpetstore3.1.x file.

Edit the file XPETSTORE_HOME / conf / as / appserver.properties and set the property app.server = jboss. You may want to review XPETSTORE_HOME / conf / as / jboss.properties to make sure that all the properties are properly set.

7. Specify database edit the file xpetstore_home / conf / db / database.properties and set the property db.name = mysql.

Edit the file xpetstore_home / conf / db / mysql.properties to configure the database.You Must Set The Following Properties:

DB.Driver db.url db.user db.password db.classpath ps: don't change the Hibernate Properties.

8. Build Source CD XPETSTORE_HOME / XPETSTORE-Servlet, Run Build.bat:

Build.Bat this Command WILL:

Generate Java Code in XpetStore_Home / XpetStore-Servlet / Build / Java

Generate the deployment descriptors at xpetstore_home / xpetstore- servlet / build / meta-inf and xpetstore_home / xpetstore- servlet / build / web-inf

Compile the source code and build .jar, .war and .ear files at xpetstore_home / dist

After testing, in fact such build is not sufficient, an error occurred during the release of the release. But considering that the official document is said, and these is indeed the correct step. The reason why can't run, it is entirely "accident" problem. Therefore, we temporarily skip, and then make the steps completely.

9. Release BUILD.BAT Deploy 10. Initialization Database Build.Bat DB 11. Run Apply http: // localhost: 8080 / xpetstore-servlet / 12. Unexpected Error Exclude the first build process will thrown XpetStore-Servlet / Build / Meta-INF Not Found error. At this point, Meta-INF folder can be created manually. Run Build again.

The error will throw an error when released: Exception Processing Tld At Resource Path /meta-inf/taglib.tld. At this point, you can manually copy the Taglib.TLD in XpetStore_Home / lib / main / com.opensymphony.module.Webwork / Webword.jar / Meta-INF to the XpetStore_Home / XpetStore-Servlet / Web / Meta-Inf directory. (Meta-INF is hand-established). Edit XpetStore_Home / XpetStore-Servlet / Build.xml, add the following statement in the "WAR" column to copy Taglib.TLD into the WAR. Run Build again.

An error will also be put forward, mainly because Hibernate getConnection cannot pass JBoss security verification. At this point, you want to modify jboss_home / server / xpetstore / conf / login_config.xml and jboss_home / serve / xpetstore / deploy / mydql_ds.xml.

Let's speak Login_Config.xml first. Refer to the HSQLDBREALM segment, add the following code.

JBoss.jca: service = localtxcm, name = XpetStoreds to mysql_ds.xml. Modify the security-domain value.

MySQLDBREALM

Note 1: Modify Login-config.xml to restart JBoss to take effect; do not have to modify mysql.xml.

Note 2: The jboss will be restarted multiple times during the debugging. If the XPetStore has not been successfully released, please delete the XpetStore release file under the deploy directory before restart.

Fives. Conclusion, our pain is over. Please visit http: // localhost: 8080 / xpetstore-servlet / take a look at your hard work.

This configuration has two purposes, one is to familiarize with JBoss, and the other is to learn the XPetStore source code. The first goal we reached, but the second goal began now, so let us share together and continue to work hard.

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

New Post(0)