运行以下命令后,我在Jboss AS 7.0.1中成功部署了war文件;
/host=master/server-config=mobile:start
我得到以下内容;
[Server:mobile] 12:47:50,349 INFO [org.jboss.as.logging] (MSC service thread 1-4) Removing bootstrap log handlers
[Server:mobile] 12:47:50,391 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) Bound data source [java:jboss/datasources/ExampleDS]
[Server:mobile] 12:47:51,034 INFO [org.jboss.as.ee] (Controller Boot Thread) Activating EE subsystem
[Server:mobile] 12:47:51,068 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) Starting deployment of "MobileGateway.war"
[Server:mobile] 12:47:51,515 INFO [org.jboss.as.jpa] (MSC service thread 1-1) added javax.persistence.api dependency to MobileGateway.war
[Server:mobile] 12:47:51,809 INFO [org.jboss.web] (MSC service thread 1-4) registering web context: /MobileGateway
[Server:mobile] 12:47:51,822 INFO [org.jboss.as.server.controller] (Controller Boot Thread) Deployed "MobileGateway.war"
[Server:mobile] 12:47:51,824 INFO [org.jboss.as] (Controller Boot Thread) JBoss AS 7.0.1.Final "Zap" started in 4692ms - Started 122 of 176 services (54 services are passive or on-demand)
一切看起来都很好,直到你开始查看最后一行,其中显示176个服务的启动122。其他54项服务怎么了?为什么服务器不启动其余服务?
答案 0 :(得分:6)
JBoss AS 7懒洋洋地启动了一些服务。这意味着当你启动时(并因此占用宝贵的启动时间),它们并非全部启动,而它们可能永远不需要。
E.g。当你不在任何一个bean中使用计时器服务时,它不需要启动。当你从不使用JSF时,不需要进行初始化等等。
这与Glassfish采用的方法相同,也是启动速度如此之快的原因之一。