Java世界

          學(xué)習(xí)筆記

          常用鏈接

          統(tǒng)計

          積分與排名

          天籟村

          新華網(wǎng)

          雅虎

          最新評論

          JBOSS 4.05 安裝(轉(zhuǎn)載)

          安裝JBOSS

          安裝JBoss之前必須檢查JDK的版本,JBoss要求JDK1.4以上版本,如果需要使用最新的EJB3技術(shù),必須使用JDK1.5版本。

          JBoss有兩種發(fā)布形式,一種是使用zip和tgz壓縮文件,只需要解壓縮到某個目錄即可,需要注意的是目錄名如果包含空格可能會在一些平臺導(dǎo)致一些問題。這種方式可以最快地得到一個運(yùn)行實(shí)例,但是稍后必須手工配置各種服務(wù)。

          JBoss目前提供一個GUI安裝程序簡化安裝過程,這個安裝程序允許選擇需要安裝的服務(wù),保證所有服務(wù)之間的依賴關(guān)系,配置缺省數(shù)據(jù)源。使用這個安裝程序能極大地簡化JBoss的安裝和配置。這個安裝程序可以使用Java Web Start直接從瀏覽器中運(yùn)行,也可以下載一個可執(zhí)行的JAR文件。

          基于GUI安裝程序的安裝步驟如下:

          選擇安裝語言

          啟動安裝程序,選擇安裝語言,這里選擇的安裝語言指安裝過程中的使用的語言,與JBoss和布署在JBoss的應(yīng)用程序沒有任何關(guān)系。

          The installer language selection screen.
          ?
          確認(rèn)License
          The license screen

          選擇安裝路徑

          選擇安裝路徑,安裝程序不會將安裝路徑信息寫入任何腳本或注冊表,因此可以自由地移動或重命名JBoss安裝目錄。注意安裝路徑最好不要包含空格。

          Selecting the installation directory

          ?選擇啟動配置

          Selecting the installation group

          ?

          啟動配置確定可以安裝的包集合,具體如下:

          Name Description Notes
          all A full J2EE 1.4 server profile with enterprise extensions such as clustering and IIOP. ?
          default A base J2EE 1.4 server profile. ?
          ejb3 An EJB3 profile supporting the full EJB3 specification with Tomcat This requires a Java 5 runtime and is not a J2EE 1.4 compatible configuration.
          ejb3-clustered An EJB3 profile supporting the full EJB3 specification with Tomcat and clustering. This requires a Java 5 runtime and is not a J2EE 1.4 compatible configuration.
          jms A JMS 1.1 server profile This is not a J2EE 1.4 compatible configuration.
          minimal A minimal JMX microkernel This is not a J2EE 1.4 compatible configuration.
          portal A JBoss Portal 2.4 profile This is not a J2EE 1.4 compatible configuration.
          tomcat A Servlet 2.4 container profile This is not a J2EE 1.4 compatible configuration.

          選擇啟動配置后可以自定義需要安裝的服務(wù)。安裝程序知道服務(wù)之間的依賴關(guān)系,可以保證安裝的服務(wù)的一致性,這個特性比通過壓縮文件的安裝方式更安全。Selecting the packages to install

          命名配置

          除非需要創(chuàng)建多個配置,通常應(yīng)該使用缺省的配置名稱default,否則必須在啟動JBoss時通過-c選項指定JBoss使用的配置名稱。

          Name the configuration

          配置數(shù)據(jù)源

          幾乎所有的應(yīng)用程序都會要求一個數(shù)據(jù)源,JBoss提供一個內(nèi)嵌的Hypersonic數(shù)據(jù)庫,并設(shè)置了一個缺省的數(shù)據(jù)源。下面的屏幕用來選擇數(shù)據(jù)源類型。

          Configure the default datasource

          ?

          下面的屏幕用來配置數(shù)據(jù)源參數(shù),使用這種方式配置數(shù)據(jù)源,必須將相應(yīng)的JDBC驅(qū)動庫保存在服務(wù)器。

          Configure the default datasource

          設(shè)置隔離級別?

          現(xiàn)在可以啟用應(yīng)用程序隔離功能,此功能可以完全分離所有應(yīng)用程序的類加載。應(yīng)用程序隔離功能在某些情況是非常有用的,但是這會降低性能。通常會禁用此功能。

          Configure application isolation

          安全設(shè)置

          當(dāng)使用壓縮文件進(jìn)行安裝時,所有的服務(wù)都沒有安全認(rèn)證,包括管理服務(wù)。GUI安裝程序可以進(jìn)行安全設(shè)置,推薦作法是啟用所有服務(wù)的安全設(shè)置,并更改admin用戶的密碼。

          JBoss security settings

          確認(rèn)安裝

          The installation is completed

          目錄結(jié)構(gòu)

          安裝JBoss將創(chuàng)建一個jboss-4.0.4目錄,包含服務(wù)器啟動腳本,庫文件,服務(wù)配置集和工作目錄。下圖包含服務(wù)器目錄結(jié)構(gòu):The JBoss AS directory structure

          ?

          org.jboss.system.server.ServerConfig 接口常量和相應(yīng)的系統(tǒng)屬性字符串顯示如上圖。那些以URL結(jié)束的位置表示可以使用URL來訪問的遠(yuǎn)程地址。

          JBoss頂級目錄
          Directory Description
          bin All the entry point JARs and start scripts included with the JBoss distribution are located in the bin directory.
          client The JARs that are required for clients that run outside of JBoss are located in the client directory.
          server The JBoss server configuration sets are located under the server directory. The default server configuration set is the server/default set. JBoss ships with minimal, default and all configuration sets. The subdirectories and key configuration files contained default configuration set are discussed in more detail in Chapter?4, The Default Server Configuration File Set
          lib The lib directory contains startup JARs used by JBoss. Do not place your own libraries in this directory.

          JBoss服務(wù)器配置目錄

          Directory Description
          conf The conf directory contains the jboss-service.xml bootstrap descriptor file for a given server configuration. This defines the core services that are fixed for the lifetime of the server.
          data The data directory is available for use by services that want to store content in the file system.
          deploy The deploy directory is the default location the hot deployment service looks to for dynamic deployment content. This may be overridden through the URLDeploymentScanner URLs attribute.
          lib The lib directory is the default location for static Java libraries that should not be hot deployed. All JARs in this directory are loaded into the shared classpath at startup.
          log The log directory is the directory log files are written to. This may be overridden through the conf/log4j.xml configuration file.
          tmp The tmp directory is used by JBoss to store temporarily files such as unpacked deployments.

          ?

          缺省服務(wù)器配置

          JBOSS_DIST/server 包含一個或多個服務(wù)器配置集合,default配置集合保存在?JBOSS_DIST/server/default 目錄。JBoss允許添加多個配置文件集合,可以通過選項設(shè)置進(jìn)行切換。

          要創(chuàng)建一個新的配置集合,拷貝default文件集合到一個新的目錄,并更改相應(yīng)的配置文件。下圖顯示default配置文件集合。.

          An expanded view of the default server configuration file set conf and deploy directories
          ?
          如下是conf目錄下的配置文件描述:
          jboss-minimal.xml

          This is a minimalist example of the jboss-service.xml configuration file. It is the jboss-service.xml file used in the minimal configuration file set.

          jboss-service.xml

          jboss-service.xml defines the core services configurations.

          jndi.properties

          The jndi.properties file specifies the JNDI InitialContext properties that are used within theNS-MYC10 JBoss server when an InitialContext is created using the no-argument constructor.

          log4j.xml

          This file configures the Apache log4j framework category priorities and appenders used by the JBoss server code.

          login-config.xml

          This file contains sample server side authentication configurations that are applicable when using JAVAS based security.

          props/*

          The props directory contains the users and roles property files for the jmx-console.

          standardjaws.xml

          This file provides the default configuration for the legacy EJB 1.1 CMP engine.

          standardjboss.xml

          This file provides the default container configurations.

          standardjbosscmp-jdbc.xml

          This file provides a default configuration file for the JBoss CMP engine.

          xmdesc/*-mbean.xml

          The xmdesc directory contains XMBean descriptors for several services configured in the jboss-service.xml file.

          The following are the files in the deploy directory and their function.

          bsh-deployer.xml

          This file configures the bean shell deployer, which deploys bean shell scripts as JBoss services.

          cache-invalidation-service.xml

          This is a service that allows for custom invalidation of the EJB caches via JMS notifications. It is disabled by default.

          client-deployer-service.xml

          This is a service that provides support for J2EE application clients. It manages the java:comp/env enterprise naming context for client applications based on the application-client.xml descriptor.

          ear-deployer.xml

          The EAR deployer is the service responsible for deploying J2EE EAR files.

          ejb-deployer.xml

          The EJB deployer is the service responsible for deploying J2EE EJB JAR files.

          hsqldb-ds.xml

          hsqldb-ds.xml configures the Hypersonic embedded database service configuration file. It sets up the embedded database and related connection factories.

          http-invoker.sar

          http-invoker.sar contains the detached invoker that supports RMI over HTTP. It also contains the proxy bindings for accessing JNDI over HTTP.

          jboss-aop.deployer ,

          This service configure the AspectManagerService and deploys JBoss AOP applications.

          jboss-bean.deployer

          jboss-bean.deployer provides the JBoss microcontainer, which deploys POJO services wrapped in .beans files.

          jboss-ha-local-jdbc.rar

          jboss-ha-local-jdbc.rar is an experimental version of jboss-local-jdbc.rar that supports datasource failover.

          jboss-ha-xa-jdbc.rar

          jboss-ha-xa-jdbc.rar is an experimental version of jboss-xa-jdbc.rar that supports datasource failover.

          jboss-local-jdbc.rar

          jboss-local-jdbc.rar is a JCA resource adaptor that implements the JCA ManagedConnectionFactory interface for JDBC drivers that support the DataSource interface but not JCA.

          jboss-xa-jdbc.rar

          jboss-xa-jdbc.rar is a JCA resource adaptor that implements the JCA ManagedConnectionFactory interface for JDBC drivers that support the XADataSource interface.

          jbossjca-service.sar

          jbossjca-service.sar is the application server implementation of the JCA specification. It provides the connection management facilities for integrating resource adaptors into the JBoss server.

          jbossweb-tomcat55.sar

          The jbossweb-tomcat55.sar directory provides the Tomcat 5.5 servlet engine. The SAR is unpacked rather than deployed as a JAR archive so that the tomcat configuration files can be easily edited.

          jbossws14.sar

          jbossws14.sar provides J2EE web services support.

          jms/hsqldb-jdbc-state-service.xml

          hsqldb-jdbc-state-service.xml provides JMS state management using Hypersonic.

          jms/hsqldb-jdbc2-service.xml

          hsqldb-jdbc2-service.xml configures JMS persistence and caching using Hypersonic. It also contains the DestinationManager MBean, which is the core service for the JMS implementation.

          jms/jbossmq-destinations-service.xml

          jbossmq-destinations-service.xml configures a number of JMS queues and topics used by the JMS unit tests.

          jms/jbossmq-httpil.sar

          jbossmq-httpil.sar provides a JMS invocation layer that allows the use of JMS over HTTP.

          jms/jbossmq-service.xml

          The jbossmq-service.xml file configures the core JBossMQ JMS service.

          jms/jms-ds.xml

          The jms-ds.xml file configures the JBossMQ JMS provider for use with the jms-ra.rar JCA resource adaptor.

          jms/jms-ra.rar

          jms-ra.rar is a JCA resource adaptor that implements the JCA ManagedConnectionFactory interface for JMS connection factories.

          jms/jvm-il-service.xml

          jvm-il-service.xml configures the in-JVM JMS transport invocation layer.

          jms/uil2-service.xml

          uil2-service.xml configures the JMS version 2 unified invocation layer. Its a fast and reliable custom socket based transport that should be used for messaging between JVMs.

          jmx-console.war

          The jmx-console.war directory provides the JMX Console. The JMX Console provides a simple web interface for managing the MBean server.

          jmx-invoker-service.sar

          jmx-invoker-service.sar is an unpacked MBean service archive that exposes a subset of the JMX MBeanServer interface methods as an RMI interface to enable remote access to the JMX core functionality. This is similar to the legacy jmx-rmi-adaptor.sar, with the difference that the transport is handled by the detached invoker architecture.

          jsr-88-service.xml

          jsr-88-service.xml provides the JSR 88 remote deployment service.

          mail-ra.rar

          mail-ra.rar is a resource adaptor that provides a JavaMail connector.

          mail-service.xml

          The mail-service.xml file is an MBean service descriptor that provides JavaMail sessions for use inside the JBoss server.

          management/console-mgr.sar

          console-mgr.sar provides the Web Console. It is a web application/applet that provide a richer view of the JMX server management data than the JMX console. You may view the console using the URL http://localhost:8080/web-console/.

          monitoring-service.xml

          The monitoring-service.xml file configures alert monitors like the console listener and email listener used by JMX notifications.

          properties-service.xml

          The properties-service.xml file is an MBean service descriptor that allows for customization of the JavaBeans PropertyEditors as well as the definition of system properties.

          scheduler-service.xml , schedule-manager-service.xml

          The scheduler-service.xml and schedule-manager-service.xml files are MBean service descriptors that provide a scheduling type of service.

          sqlexception-service.xml

          The sqlexception-service.xml file is an MBean service descriptor for the handling of vendor specific SQLExceptions.

          uuid-key-generator.sar

          The uuid-key-generator.sar service provides a UUID-based key generation facility.

          所有的配置都包含幾個額外的服務(wù):
          cluster-service.xml

          This service configures clustering communication for most clustered services in JBoss.

          deploy-hasingleton-service.xml

          This provides the HA singleton service, allowing JBoss to manage services that must be active on only one node of a cluster.

          deploy.last/farm-service.xml

          farm-service.xml provides the farm service, which allows for cluster-wide deployment and undeployment of services.

          httpha-invoker.sar

          This service provides HTTP tunneling support for clustered environments.

          iiop-service.xml

          This provides IIOP invocation support.

          juddi-service.sar

          This service provides UDDI lookup services.

          snmp-adaptor.sar

          This is a JMX to SNMP adaptor. It allows for the mapping of JMX notifications onto SNMP traps.

          tc5-cluster.sar

          Provides AOP support for field-level HTTP session replication.

          如果安裝了EJB3支持,幾個額外的EJB3服務(wù)可用:

          ejb3-interceptors-aop.xml

          This service provides the AOP interceptor stack configurations for EJB3 bean types.

          ejb3.deployer

          This service deploys EJB3 applications into JBoss.

          jboss-aop-jdk50.deployer

          This is a Java 5 version of the AOP deployer. The AOP deployer configures the AspectManagerService and deploys JBoss AOP applications.

          jbossws.sar

          This services provides Java EE 5 web services support.

          Finally, in the EJB3 all configuration adds two additional services:

          ejb3-clustered-sfsbcache-service.xml

          This services provides replication and failover for EJB3 stateful session beans.

          ejb3-entity-cache-service.xml

          This services provides a clustered cache for EJB3 entity beans.

          啟動停止JBoss

          安裝好JBoss后,要確認(rèn)安裝是否成功,進(jìn)入bin目錄,執(zhí)行run.bat或run.sh腳本。輸出應(yīng)該類似如下:

          						
          java 代碼
          1. $?sh?run.sh ??
          2. ========================================================================= ??
          3. ??
          4. ??JBoss?Bootstrap?Environment ??
          5. ??
          6. ??JBOSS_HOME:?/tmp/jboss- 4.0 . 4 .GA ??
          7. ??
          8. ??JAVA:?java ??
          9. ??
          10. ??JAVA_OPTS:?-server?-Xms128m?-Xmx512m?-Dsun.rmi.dgc.client.gcInterval= 3600000 ? ??
          11. ?????????????-Dsun.rmi.dgc.server.gcInterval= 3600000 ?-Dprogram.name=run.sh ??
          12. ??
          13. ??CLASSPATH:?/tmp/jboss- 4.0 . 4 .GA/bin/run.jar:/lib/tools.jar ??
          14. ???????????? ??
          15. ========================================================================= ??
          16. ??
          17. 23 : 28 : 48 , 561 ?INFO??[Server]?Starting?JBoss?(MX?MicroKernel) ??
          18. ... ??
          19. 23 : 29 : 09 , 249 ?INFO??[Server]?JBoss?(MX?MicroKernel)?[ 4.0 . 4 .GA?(build:? ??
          20. ??CVSTag=JBoss_4_0_4_GA?date= 200605151000 )]?Started?in?20s:679ms??

          如果輸出類似如上圖,現(xiàn)在應(yīng)該可以使用JBoss了。

          如果不指定參數(shù)使用run.sh,會使用default服務(wù)配置集合。要切換到其他服務(wù)配置集合,使用如下命令啟動腳本,minimal是服務(wù)配置集合名稱。

          						
          java 代碼
          1. $?./run.sh?-c?minimal ??
          2. ... ??
          3. 23 : 37 : 41 , 582 ?INFO??[Server]?JBoss?(MX?MicroKernel)?[ 4.0 . 4 .GA?(build:? ??
          4. ??CVSTag=JBoss_4_0_4_GA?date= 200605151000 )]?Started?in?2s:212ms??

          run腳本選項包括:

          						
          java 代碼
          1. usage:?run.sh?[options] ??
          2. ??-h,?--help??????????????????Show? this ?help?message ??
          3. ??-V,?--version???????????????Show?version?information ??
          4. ??--??????????????????????????Stop?processing?options ??
          5. ??-D[=]??????????Set?a?system?property ??
          6. ??-d,?--bootdir=?????????Set?the?boot?patch?directory;?Must?be?absolute?or?url ??
          7. ??-p,?--patchdir=????????Set?the?patch?directory;?Must?be?absolute?or?url ??
          8. ??-n,?--netboot=?????????Boot?from?net?with?the?given?url?as?base ??
          9. ??-c,?--configuration=??Set?the?server?configuration?name ??
          10. ??-B,?--bootlib=????Add?an?extra?library?to?the?front?bootclasspath ??
          11. ??-L,?--library=????Add?an?extra?library?to?the?loaders?classpath ??
          12. ??-C,?--classpath=???????Add?an?extra?url?to?the?loaders?classpath ??
          13. ??-P,?--properties=??????Load?system?properties?from?the?given?url ??
          14. ??-b,?--host=?????Bind?address? for ?all?JBoss?services ??
          15. ??-g,?--partition=??????HA?Partition?name?( default =DefaultDomain) ??
          16. ??-u,?--udp=??????????????UDP?multicast?address ??
          17. ??-l,?--log=???????Specify?the?logger?plugin?type??

          要關(guān)閉服務(wù)器,只需要在啟動的JBoss控制臺按 Ctrl-C 鍵即可,也可以使用shutdown.sh命令。

          						
          java 代碼
          1. [bin]$?./shutdown.sh?-S??

          shutdow腳本支持如下選項。

          						
          java 代碼
          1. usage:?shutdown?[options]? ??
          2. ??
          3. options: ??
          4. ??-h,?--help??????????????Show? this ?help?message?( default ) ??
          5. ??-D[=]??????Set?a?system?property ??
          6. ??--??????????????????????Stop?processing?options ??
          7. ??-s,?--server=??????Specify?the?JNDI?URL?of?the?remote?server ??
          8. ??-n,?--serverName=??Specify?the?JMX?name?of?the?ServerImpl ??
          9. ??-a,?--adapter=????Specify?JNDI?name?of?the?MBeanServerConnection?to?use ??
          10. ??-u,?--user=???????Specify?the?username? for ?authentication ??
          11. ??-p,?--password=???Specify?the?password? for ?authentication ??
          12. ??
          13. operations: ??
          14. ??-S,?--shutdown??????????Shutdown?the?server ??
          15. ??-e,?--exit=???????Force?the?VM?to?exit?with?a?status?code ??
          16. ??-H,?--halt=???????Force?the?VM?to?halt?with?a?status?code??

          使用shutdown命令將查詢包含 jmx-invoker-service.xml 服務(wù)的服務(wù)器配置,因此shutdown命令不能在minimal配置下使用。

          posted on 2008-02-18 21:00 Rabbit 閱讀(1175) 評論(1)  編輯  收藏

          評論

          # re: JBOSS 4.05 安裝(轉(zhuǎn)載) 2008-02-19 11:33 CoderDream

          請給出原文鏈接!  回復(fù)  更多評論   


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 西城区| 大同县| 洪江市| 鄄城县| 新平| 旌德县| 高州市| 油尖旺区| 资溪县| 巫溪县| 保山市| 开平市| 全州县| 平顶山市| 鲜城| 衡南县| 梅州市| 大连市| 司法| 古丈县| 抚顺市| 平昌县| 黄梅县| 吉水县| 灵川县| 根河市| 汨罗市| 门源| 巩义市| 丹凤县| 宁武县| 盱眙县| 荣昌县| 河北省| 诸暨市| 长汀县| 大田县| 休宁县| 固安县| 嵊州市| 出国|