JBoss server startup sequence is:
1. The run start script initiates the boot sequence using the org.jboss.Main.main(String[])
method entry point.
2. The Main.main method creates a thread group named jboss and then starts a thread belonging to this thread group. This thread invokes the Main.boot
method.
3. The Main.boot method processes the Main.main arguments and then creates an
org.jboss.system.server.ServerLoader
using the system properties along with any additional properties specified as arguments.
4. The XML parser libraries, jboss-jmx.jar, concurrent.jar and extra libraries and classpaths given as arguments are registered with the ServerLoader .
5. The JBoss server instance is created using the ServerLoader.load(ClassLoader)
method with the
current thread context class loader passed in as the ClassLoader argument. The returned server instance is an implementation of the org.jboss.system.server.Server
interface. The creation of the server instance entails:
• Creating a java.net.URLClassLoader
with the URLs of the jars and directories registered with the
ServerLoader . This URLClassLoader uses the ClassLoader passed in as its parent and it is pushed as the thread context class loader.
• The class name of the implementation of the Server interface to use is determined by the
jboss.server.type property. This defaults to org.jboss.system.server.ServerImpl
.
• The Server implementation class is loaded using the URLClassLoader created in step 6 and instantiated using its no-arg constructor. The thread context class loader present on entry into the ServerLoader.load
method is restored and the server instance is returned.
6. The server instance is initialized with the properties passed to the ServerLoader constructor using the Server.init(Properties)
method.
7. The server instance is then started using the Server.start()
method. The default implementation performs the following steps:
• Set the thread context class loader to the class loader used to load the ServerImpl class.
• Create an MBeanServer under the jboss domain using the MBeanServerFactory.createMBeanServer(String)
method.
• Register the ServerImpl and ServerConfigImpl MBeans
with the MBean server.
• Initialize the unified class loader repository to contain all JARs in the optional patch directory as well as the server configuration file conf directory, for example, server/default/conf. For each JAR and directory an org.jboss.mx.loading.UnifiedClassLoader is created and registered with the unified repository.
One of these UnifiedClassLoader is then set as the thread context class loader. This effectively makes all UnifiedClassLoaders available through the thread context class loader.
• The org.jboss.system.ServiceController MBean
is created. The ServiceController manages the
JBoss MBean services life cycle.
• The org.jboss.deployment.MainDeployer
is created and started. The MainDeployer manages deployment dependencies and directing deployments to the correct deployer.
• The org.jboss.deployment.JARDeployer
is created and started. The JARDeployer handles the deployment of JARs that are simple library JARs.
• The org.jboss.deployment.SARDeployer is created and started. The SARDeployer handles the deployment of JBoss MBean services.
• The MainDeployer is invoked to deploy the services defined in the conf/jboss-service.xml of the current server file set.
• Restore the thread context class loader.
The JBoss server starts out as nothing more than a container for the JMX MBean server, and then loads its personality based on the services defined in the jboss-service.xml MBean configuration file from the named configuration set passed to the server on the command line. Because MBeans define the functionality of a JBoss server instance, it is important to understand how the core JBoss MBeans are written, and how you should integrate your existing services into JBoss using MBeans.
ps:
JBoss在启动时将ClassLoader换来换去,实在是看不明白代码的含义了,后来看了看JBoss的ClassLoader结构,稍稍明白了些,但还是比较模糊。
分享到:
相关推荐
在JBoss启动过程中,JDK环境的正确配置至关重要。如果JDK版本不兼容或路径设置有误,很可能导致JBoss启动失败,表现为“一闪而过”的现象。具体而言,以下几点需注意: - **JDK版本**:确保安装的JDK版本与JBoss...
在本文中,我们将深入探讨JBoss的启动过程及其相关知识点。 1. **JBoss目录结构**: JBoss的安装目录包含多个子目录,如`bin`、`server`、`deploy`等。`bin`目录下有启动和停止服务器的脚本,`server`目录则包含了...
**JBoss启动顺序** JBoss的启动过程大致分为以下几个阶段: 1. **环境准备**:首先,JBoss会检查运行环境,包括Java环境(JDK)是否安装正确,版本是否兼容,以及相关的系统变量如JAVA_HOME是否设置。 2. **配置...
JBoss启动与运行过程的研究,JBoss启动与运行过程的研究
JBoss启动的入口 一旦启动脚本成功执行,将调用`C:\Java\bin\java`命令,启动Java虚拟机并加载`org.jboss.Main`类中的`main`方法作为启动入口。`Main.main`方法会创建一个名为“jboss”的线程组,并在该线程组中...
### Linux下安装JBoss并设置自启动服务 在Linux环境下安装JBoss并配置其...通过以上步骤,我们完成了在Linux环境下JBoss的安装及配置自启动服务的过程。这不仅方便了日常的运维工作,还提高了系统的稳定性和可用性。
本篇文章将详细解析JBoss的配置过程,旨在帮助初学者更好地理解和操作JBoss服务器。 一、JBoss安装与环境准备 在开始配置前,确保已安装了Java Development Kit (JDK)。JBoss需要JDK来运行,因此请先下载并安装适合...
在IT领域,特别是Java应用服务器环境下,JBoss与MySQL数据库的集成是常见需求之一,而JNDI(Java Naming and Directory Interface)在此过程中扮演着关键角色。本文将深入解析如何在JBoss中配置MySQL的JNDI数据源,...
执行脚本后,控制台会显示JBoss的启动过程。 6. **测试JBoss**: 启动成功后,可以通过浏览器访问`http://localhost:8080`,如果看到JBoss的欢迎页面,说明安装和启动均成功。默认情况下,JBoss使用8080端口提供...
Jboss 项目部署文档 Jboss 项目部署文档是指在 Jboss 服务器上部署项目的详细步骤,...Jboss 项目部署文档详细地描述了 Jboss 项目部署的整个过程,包括环境变量的配置、项目打包、配置文件的修改、JNDI 的配置等。
- lib目录:JBoss启动时加载的一般JAR文件,这些JAR文件可供所有配置共享。 - server目录:包含服务器配置文件,每个配置有独立的子目录。 - server/all目录:JBoss的完整配置,启动所有服务,包括集群和IIOP。 - ...
【JBoss 用 ANT 部署详解】 在IT行业中,JBoss是一个广泛使用的开源Java应用服务器,它支持Java EE规范,包括EJB(Enterprise JavaBeans)。ANT是Apache项目的一个构建工具,它允许开发者通过XML配置文件来自动化...
对于初学者,使用JBoss可能会遇到一些挑战,因为它的配置和部署过程并不像许多其他应用服务器那样提供图形化界面。这使得EJB的开发和部署相对复杂。本文旨在通过实例简化这一过程,帮助新用户快速熟悉在JBoss 3.0中...
10. **图形化示意图**:为了更直观地理解配置过程,可以参考提供的“图形化示意图.docx”文件,该文件通常包含步骤的截图和流程图,帮助开发者清晰了解每个配置阶段。 通过以上步骤,我们完成了MyEclipse中JBoss的...
同时,`JBOSS_HOME\standalone\log`或`JBOSS_HOME/domain/log`目录下的日志文件也会记录详细的启动过程和可能的错误。 8. **更新与删除服务**: 当需要更新JBoss服务或移除服务时,可以使用以下命令: ```cmd ...
本资源摘要信息将详细介绍 JBOSS 在 Windows 平台上的安装和部署过程,涵盖了环境准备、JBOSS 安装、环境变量设置、运行和终止 JBOSS、部署 WAR 文件等多个方面的知识点。 一、环境准备 在安装 JBOSS 之前,需要...
- 配置过程中,确保MyEclipse和JBoss的版本兼容。不同版本的MyEclipse可能对JBoss的支持程度不同,所以建议使用最新稳定版的MyEclipse。 - 为避免冲突,关闭防火墙或允许MyEclipse通过防火墙访问端口,因为JBoss...