 | 级别: 初级 Don Bourne (dbourne@ca.ibm.com), WebSphere Serviceability 架构师, IBM Daniel Julin (dpj@us.ibm.com), WebSphere 服务能力技术领域负责人, IBM India Software Lab Services and Solutions
2007 年 8 月 21 日
通过新的诊断提供程序技术,您可以实时地探测 IBM® WebSphere® Application Server 组件(甚至包括自定义应用程序的组件)的配置和状态信息,并能够让这些组件执行自检,以检查是否存在任何已知的问题情况。
来自 IBM WebSphere Developer Technical Journal。
在每个专栏中,支持权威将讨论 IBM Technical Support 的可用于 WebSphere 产品的资源、工具和其他要素,以及一些可以进一步增强您的 IBM 支持体验的技术和新思想。
最新快报
按照惯例,我们将首先提供关于整个 WebSphere 社区的一些重要新闻:
-
IBM Support Assistant
中提供了两个新工具:
-
新版本的 Log and Trace Analyzer,之前已经在本专栏中多次提到过此工具,曾作为独立工具采用多种形式提供,目前已加入到 IBM Support Assistant 中,现在称为 Log Analyzer。Log Analyzer 可以扫描大量产品的日志文件,将这些日志文件组合为单个视图,突出显示与特定方面相关的事件以及将这些事件与已知问题的症状数据库进行匹配。
-
Visual Configuration Explorer 作为技术预览首次公开露面,可用于从很多产品(包括 WebSphere Application Server)收集配置信息,并将此信息以方便的整合图形视图呈现给用户,从而能更方便地在诊断问题时从一个位置查找配置信息并确定相关性。此外,此工具还可以对不同的工具进行比较,以对潜在的重大差异进行标记,而且还能够运行各种验证规则,以确定潜在问题。
-
如果您已经下载了 IBM WebSphere Portal 最近的修补程序,则可能已经注意到其中很多修补程序现在都通过新的中央网站
Fix Central
进行管理。通过这个新网站,可以方便地查找、下载和安装所选 IBM 产品的修补程序,并能够跟踪修补程序之间的依赖关系和先决条件。此工具将继续发展,我们预计很快将有更多的 WebSphere 产品使用这个强大的站点。请定期查看本专栏,以了解新添加的功能和产品。
-
请留意即将举行的 WebSphere 社区技术大会。我们将不断向此表中添加更多的全球技术人员感兴趣的话题,敬请密切关注!
继续关注与支持相关的各个网站以及本专栏,以获得有关我们所碰到的其他工具的新闻。
接下来让我们继续今天主要的主题……
什么是诊断提供程序?
较早的一篇文章中概略介绍了 WebSphere Application Server 运行时中包括的很多问题确定工具。本文将更深入地介绍诊断提供程序,一项 WebSphere Application Server V6.1 中引入的新技术。通过使用此技术,每个 WebSphere Application Server 组件(例如 Web 容器、连接管理器、系统管理等)甚至应用程序中的组件都可以通过工具导出自己的诊断提供程序对象。每个诊断提供程序对象均提供了统一的机制来执行三项主要功能:
- 转储组件的配置。
- 转储组件的状态。
- 在组件上运行自检。
每个诊断提供程序都可以实现所有这三个功能,或这些功能的子集,具体取决于与诊断提供程序关联的组件的诊断需求。
 |
术语
术语组件 此处的使用并不严格;可以为单个类创建诊断提供程序,也可以为整个应用服务器创建诊断提供程序。 |
|
诊断提供程序与应用服务器中的其他故障诊断工具不同。日志记录工具提供用于在发生事件时记录此信息的方法,并提供严重性信息来帮助管理员了解这些事件的重要性。跟踪工具提供记录关于应用服务器中发生的活动的详细信息的方法,由于其包含大量信息,而且具有技术特征,因此,相对于管理员而言,这些详细信息对于所跟踪的代码的原始作者更有意义。类似地,应用服务器中的首次故障数据捕获(First Failure Data Capture,FFDC)系统捕获关于系统出现异常时的信息。另一方面,诊断提供程序提供了一种方法,以根据需要请求关于应用服务器状态的当前信息,这些信息在请求时为已知状态。
在有些情况下,诊断提供程序可公开不能通过任何其他机制获取的信息。在其他情况下,特别对于大多数配置信息而言,可以采取其他方式从特定的组件获取类似信息。不过,这里的关键是,诊断提供程序提供了统一的方法来从利用诊断提供程序技术的所有组件访问诊断信息,从而提供一个更为简单的接口来允许故障诊断人员通过一个位置查找所需的所有信息。诊断提供程序还允许通过各种形式的自动化工具和脚本进行问题确定,例如本文稍后将给出的一些示例。
诊断提供程序特别适合用于公开关于系统的有状态部分的详细信息。应用服务器中包含大量的有状态组件,例如:动态缓存工具在内存中保存缓存的页片段,连接池维护一组连接,Web 服务依赖于一组 SOAP Servlet 线程,EJB 容器具有一组已初始化的 EJB 组件,日志记录子系统具有一组已配置的日志记录程序,等等。所有这些实体都维护一组资源,而这些资源在正常情况下都不需要过多地加以注意。出现错误时(如线程池耗尽),如果能够直接查询所涉及的组件,则将能带来非常大的价值。问题被组件所有者知道后,可以设计自检来检查是否存在这些问题。这可为诊断组件相关问题经验不足的人员提供帮助,而且能够帮助监视系统来确定问题。自检还可以执行简单的试验,如尝试连接到数据库,以确定一切都已进行了恰当的设置和配置。
WebSphere Application Server V6.1 中的诊断提供程序
WebSphere Application Server V6.1 中首次引入了用于实现诊断提供程序的基础设施。基于该基础设施,系统的每个组件都可以实现针对该组件定制的诊断提供程序。WebSphere Application Server V6.1 提供了一组初始组件:
-
Connection manager (ConnMgrDP) 提供关于数据源和连接工厂的配置和状态信息。这包括关于托管连接、活动事务、连接池信息及其他有用数据的信息。
-
Node synchronization (NodeSyncDP) 提供关于最近尝试执行配置同步的状态信息,并包括节点同步配置详细信息,如关于自动同步的信息。另外还有通用自检,将检查连接性、文件传输能力及系统是否同步。
-
Node agent (NodeAgentDP) 提供关于节点代理的信息。其中包括节点代理已知哪些服务器的状态信息,以及检查已知服务器的状态的自检。
-
Deployment manager (DeploymentManagerDP) 提供关于部署管理器的信息。其中包括代理管理器已知哪些节点代理的状态信息,以及检查已知节点代理的状态的自检。
-
Web container (WebContainerDP) 提供关于应用服务器的 Web 容器的配置和状态信息,包括关于已缓存的 Servlet、虚拟主机的信息及关于 Web 容器的通用配置信息。
-
Runtime advisor (AdvisorDP) 提供关于之前生成的堆转储的信息以及关于应用服务器堆转储创建设置的配置信息。另外还提供了自检,以检查应用服务器是否出现内存泄漏。
预计在系统的未来版本中,会有更多的组件添加自己的诊断提供程序。
诊断提供程序与 WebSphere Application Server 系统管理工具完全集成,因而可以通过与其他 WebSphere 管理功能相同的方式进行访问,包括:
- 管理控制台
- wsadmin 脚本工具
- 直接调用相关 MBean 的 JMX 客户机
选择用于与诊断提供程序交互的方法取决于具体的情况。本文将通过一些涉及各个诊断提供程序功能的示例对此进行说明:自检(示例 1)、状态转储(示例 2)和配置(示例 3)。
示例 1:使用管理控制台检查应用服务器是否出现内存泄漏
此示例演示 runtime advisor 诊断提供程序 自检 功能。
如果主要目标是从诊断提供程序快速检查数据,就可以使用管理控制台来完成此工作。在此示例中,runtime advisor 诊断提供程序用于说明如何使用管理控制台检查应用服务器中的 Java™ 内存泄漏。要在管理控制台中找到此诊断提供程序,请执行以下步骤:
- 启动管理控制台。(如果启用了安全机制,则需登录。)
- 从左侧导航栏中选择 Troubleshooting。
- 展开 Diagnostic Provider(图 1),以列出三个主要诊断提供程序功能。
图 1. 管理控制台中显示诊断提供程序部分的导航栏
- 在左侧导航栏选择 Tests,以找到相应的诊断提供程序。
- 在右侧内容窗格中展开 cell 和 server,并单击相应的服务器名称。将显示具有测试功能的可用诊断提供程序列表(图 2)。
图 2. 未联合应用服务器中的可用诊断提供程序
- 内存泄漏检查是 runtime advisor (AdvisorDP) 诊断提供程序的一部分。要运行此提供程序,请选择 AdvisorDP。将显示此诊断提供程序的可用测试列表(图 3)。
图 3. runtime advisor 的可用自诊断测试
- 要运行测试,请选择 ServerRule11。所得到的结果将为测试的输出,如图 4 中所示。
图 4. 内存泄漏自检的结果
- 如果收到消息,指示“
The Performance and Diagnostic Advisor is disabled. In order to perform a Self Diagnostic
|--10--------20--------30--------40--------50--------60--------70--------80--------9|
|-------- XML error: The previous line is longer than the max of 90 characters ---------|
of this component you should enable it. |
”,则表明此程序所必需的运行时功能当前已禁用。要启用此功能,请执行以下操作:
- 在左侧导航栏选择 Servers。
- 选择 Application Servers。
- 在右侧内容窗格中选择恰当的服务器。
- 选择 Performance and Diagnostic Advisor Configuration。
- 选择 Runtime 选项卡。
- 选中 Enable Performance and Diagnostic Advisor Framework。
- 单击 OK。
某些自检和状态数据仅在系统进行了一段时间的数据收集之后才有意义。例如,用于检查潜在内存泄漏的算法需要一定的时间来观察 Java 堆使用情况的趋势,以作出正确的判断。
示例 2:使用 wsadmin 脚本诊断常见连接管理器使用问题
此示例说明如何使用 connection manager 诊断提供程序的状态转储功能。
为了方便地进行与诊断提供程序的可重复交互,可以采用 wsadmin 脚本。在此示例中,将使用 wsadmin 脚本访问 Connection Manager 诊断提供程序,以了解与连接使用相关的问题。第一步是使用 wsadmin 查找相应的诊断提供程序 MBean。为了方便起见,所有诊断提供程序 MBean 都在其 JMX 对象名称中包含 diagnosticProvider=true,以便以下脚本片段列出所有可用诊断提供程序:
清单 1. Jython 脚本 listObjectNames.py,用于输出名称中包含 diagnosticProvider=true 的 MBean
dpObjectNames = AdminControl.queryNames('diagnosticProvider=true,*')
print dpObjectNames |
清单 1 中的脚本可以使用以下命令通过 wsadmin 执行:
wsadmin -lang jython -f listObjectNames.py
所得到的结果与以下所示类似:
清单 2. 在非联合服务器上运行 DiagnosticProvider=true 脚本的输出
WASX7209I: Connected to process "server1" on node don7Node03 using SOAP connector;
The type of process is: UnManagedProcess
WebSphere:name=Default Datasource,process=server1,platform=dynamicproxy,node=don7Node03,
JDBCProvider=Derby JDBC Provider,diagnosticProvider=true,j2eeType=JDBCDataSource,
J2EEServer=server1,Server=server1,version=6.1.0.0,type=DataSource,mbeanIdentifier=cells
/don7Node03Cell/nodes/don7Node03/servers/server1/resources.xml#DataSource_1156718666915,
JDBCResource=Derby JDBC Provider,cell=don7Node03Cell,spec=1.0
WebSphere:name=DefaultEJBTimerDataSource,process=server1,platform=dynamicproxy,node=
don7Node03,JDBCProvider=Derby JDBC Provider (XA),diagnosticProvider=true,j2eeType=
JDBCDataSource,J2EEServer=server1,Server=server1,version=6.1.0.0,type=DataSource,
mbeanIdentifier=cells/don7Node03Cell/nodes/don7Node03/servers/server1/resources.xml
#DataSource_1000001,JDBCResource=Derby JDBC Provider (XA),cell=don7Node03Cell,spec=1.0
WebSphere:name=PLANTSDB,process=server1,platform=dynamicproxy,node=don7Node03,JDBCProvider
=Samples Derby JDBC Provider (XA),diagnosticProvider=true,j2eeType=JDBCDataSource,
J2EEServer=server1,Server=server1,version=6.1.0.0,type=DataSource,mbeanIdentifier=cells
/don7Node03Cell/nodes/don7Node03/servers/server1/resources.xml#DataSource_1156718677751,
JDBCResource=Samples Derby JDBC Provider (XA),cell=don7Node03Cell,spec=1.0
WebSphere:name=Runtime Advisor,process=server1,platform=dynamicproxy,node=don7Node03,
diagnosticProvider=true,reInit="Des:reinitialize the Runtime Performance Advisor.
#DesLookup:perfTuningAdmin.operation.reInit.des",version=6.1.0.0,type=ServerRule
DriverMBean,mbeanIdentifier=ServerRuleDriverMBean2,cell=don7Node03Cell,spec=1.0,
perfTuningAdmin.operation.takeHeapDump="Des:Triggers IBM JDK to take a multiple heap
dumps based upon downward trends in memory#DesLookup:perfTuningAdmin.operation.
takeHeapDump.des"
WebSphere:name=WebcontainerDiagnosticProvider,process=server1,platform=dynamicproxy,node=
don7Node03,diagnosticProvider=true,version=6.1.0.0,type=WebcontainerDiagnosticProvider,
mbeanIdentifier=null,cell=don7Node03Cell,spec=1.0 |
在清单 2 中,可以看到给出了多个包含 j2eeType=JDBCDataSource 的对象名称这些对象名称与连接管理器数据源 MBean 的名称对应。清单 3 显示了用于对 PLANTSDB 数据源诊断提供程序执行格式化状态转储的 Jython 代码。
清单 3. 用于从 PLANTSDB 数据源诊断提供程序生成格式化状态转储的 Jython 脚本
import javax.management.ObjectName
import java.util.Locale
# find JMX object name for DiagnosticService MBean -- provides formatting helper methods
dsObjectName = AdminControl.queryNames('type=DiagnosticService,*')
# find JMX object name for specific diagnosticProvider MBean we're interested in
dpObjectName = AdminControl.queryNames('name=PLANTSDB,*')
# turn on all state collection for connection manager diagnostic providers
result = AdminControl.invoke_jmx(javax.management.ObjectName(dsObjectName),
'setStateCollectionSpec', ['ConnMgrDP.*:.*=1'],['java.lang.String'])
# invoke the stateDump on the diagnostic provider
result = AdminControl.invoke_jmx(javax.management.ObjectName(dsObjectName),
'stateDumpFormattedById', [dpObjectName, '.*', java.lang.Boolean(0),
java.util.Locale('en_US')], ['java.lang.String', 'java.lang.String',
'boolean', 'java.util.Locale'])
print result[0] |
其输出可能与以下所示类似:
清单 4. PLANTSDB 数据源诊断提供程序的格式化状态转储输出
WASX7209I: Connected to process "server1" on node don7Node03 using SOAP connector;
The type of process is: UnManagedProcess
DiagnosticProviderId: ConnMgrDP_jdbc/PlantsByWebSphereDataSource
EventType: stateDump MessageKey: null
ResourceBundleName: null
Source Class: ConnectionFactoryMbeanImpl Source Method: stateDump ContentType: 1
Cell: don7Node03Cell Node: don7Node03 Server: server1 SrvDetail:
Item Concatenated Name Value
approximateNumberFreeConnections = 1
approximateNumberSharedConnections = 0
approximateNumberUnSharedConnections = 0
approximateNumberWaitingConnections = 0
connections-7e3a7e3a-destroyState = false
connections-7e3a7e3a-handleCount = 0
connections-7e3a7e3a-isParkedWrapper = false
connections-7e3a7e3a-isStale = false
connections-7e3a7e3a-managedConnection = WSRdbManagedConnectionImpl@6c3a6c3a
connections-7e3a7e3a-mcWrapperState = STATE_ACTIVE_FREE
connections-7e3a7e3a-poolState = STATE_ACTIVE_FREE
connections-7e3a7e3a-tranWrapperInUse = NONE
connections-7e3a7e3a-transactionId = null
inStuckConnectionMode = false
poolManagerObject = 526655332
quiesced = false |
清单 4 中的输出列出了数据源的一些全局数据,然后给出了一些与数据源中当前处于活动状态的特定连接 (connections-7e3a7e3a) 关联的属性。
DiagnosticService MBean
在清单 4 中,您会注意到我们没有直接访问连接管理器的诊断提供程序 stateDump 方法,而是调用了 DiagnosticService MBean 的 stateDumpFormattedById 方法。DiagnosticService 提供了一系列方法来帮助对从诊断提供程序返回的结果进行格式化。DiagnosticService MBean 的主要作用是格式化诊断提供程序输出和充当注册中心(以便查找在其上运行 DiagnosticService 的 JVM 中的任意诊断提供程序)。
您可能会发现以下 DiagnosticService 方法对于从诊断提供程序获取格式化的结果非常有用。其中的每个方法都接受诊断提供程序的 JMX 对象名称、属性列表(一个正则表达式,指示所感兴趣的属性,例如 connections-.*-transactionId)以及区域设置(用于选择用于进行格式化的恰当区域设置)作为参数:
- configDumpFormattedById(java.lang.String, java.lang.String, boolean, java.util.Locale)
- stateDumpFormattedById(java.lang.String, java.lang.String, boolean, java.util.Locale)
- selfDiagnosticFormattedById(java.lang.String, java.lang.String, boolean, java.util.Locale)
使用此信息
诊断提供程序所生成的所有信息看起来似乎有些让人生畏。应该如何对其进行处理呢?以下是能够从此信息确定的两个典型情况:
-
单个事务使用了很多连接
应用程序中经常会报告连接池耗尽的问题。每个数据源和连接工厂都维护着自己的指向基础资源的连接池。当连接池中的所有资源都分配给了线程时,下一个从连接池请求连接的线程将必须等待。如果连接配置为共享且应用程序经过了恰当的编码能够进行共享,则数据源或连接工厂可以向多个调用方提供相同的托管连接。反过来,编码不合理的应用程序可能会使用相同资源的同一个连接池中的很多物理托管连接。在有些情况下,在从连接池请求连接时被阻塞的线程可能实际上就是持有相同资源的其他连接的线程,从而导致死锁的情况发生。通过分析 Connection Manager 诊断提供程序的状态输出,可以诊断一些常见的应用程序问题。
-
首先,您可能希望检查在特定数据源或 J2C 连接工厂的连接池中是否存在连接争用。为每个数据源或 J2C 连接工厂创建了不同的 Connection Manager 诊断提供程序,因此可以通过选择恰当的诊断提供程序来方便地重点处理所涉及的数据源或连接工厂。从数据源或连接工厂的诊断提供程序返回的侦听信息将通过 approximateNumberWaitingConnections 数据指示等待获得连接的线程数量。如果多个示例上等待连接的数量大于 0,则该资源可能存在争用。
-
下一步是检查相同的事务是否使用了多个托管连接。使用多个托管连接的事务之所以这样,可能是由于疏忽所致。connections-(connection-reference)-transactionId 值指示与特定托管连接关联的 transactionId。如果多个托管连接与同一个 transactionId 关联,则需要进行进一步分析。
当应用程序导致每个事务持有对相同资源的多个托管连接的引用时,该资源的可用连接池会在加载此应用程序时很快耗尽。可以采用很多方法来对此进行补救,通过重新配置或重新设计应用程序,但这些方法不在本文的讨论范畴之内(请参见参考资料)。
-
大量连接句柄
当不再需要连接而未将其关闭并返回到池中时,连接池也会很快耗尽。如果应用程序代码使用 UserTransaction 类显式地区分事务,然后却未能始终在完成后提交或回滚,则可能会出现这样的情况。
在这种情况下,由于事务未能恰当关闭,因此会找到一系列具有非空 connections-(connection-reference)-transactionId 值的连接。还会看到这些连接的 connections-(connection-reference)-handleCount 值大于 0。

 |

|
示例 3:使用 wsadmin 脚本诊断常见 Web 容器问题
此示例说明如何使用 Web container 诊断提供程序的 configuration dump 功能。
可用于查找常见问题的另一个诊断提供程序是 WebContainerDP。首先,可以通过查看从 WebContainerDP 的 configDump 获得的配置数据诊断大量问题。调用配置转储与前面调用状态转储的流程非常相似。
清单 5. 用于从 WebContainer 诊断提供程序生成格式化配置转储的 Jython 脚本
import javax.management.ObjectName
import java.util.Locale
# find JMX object name for DiagnosticService MBean -- provides formatting helper methods
dsObjectName = AdminControl.queryNames('type=DiagnosticService,*')
# find JMX object name for the specific diagnosticProvider MBean we're interested in
dpObjectName = AdminControl.queryNames('name=WebcontainerDiagnosticProvider,*')
# invoke the config dump and show results containing PlantsByWebSphere
result = AdminControl.invoke_jmx(javax.management.ObjectName(dsObjectName),
'configDumpFormattedById', [dpObjectName, '.*PlantsByWebSphere.*',
java.lang.Boolean(0), java.util.Locale('en_US')], ['java.lang.String', 'java.lang.String',
'boolean', 'java.util.Locale'])
print result[0] |
请注意,在清单 5 中的配置转储仅限于包含“PlantsByWebSphere”的属性。如果没有此限制,执行上面的脚本通常将得到大量输出,与 Web 容器的诊断提供程序报告的每个已安装 Web 存档的配置信息类似。可以使用类似的约束来查看其他 Web 存档的内容。
其输出可能与以下所示类似:
清单 6. WebContainer 诊断提供程序的格式化配置转储输出
WASX7209I: Connected to process "server1" on node don7Node03 using SOAP connector;
The type of process is: UnManagedProcess
DiagnosticProviderId: WebSphere:name=WebcontainerDiagnosticProvider,process=server1,
platform=dynamicproxy,node=don7Node03,diagnosticProvider=true,version=6.1.0.0,type=
WebcontainerDiagnosticProvider,mbeanIdentifier=null,cell=don7Node03Cell,spec=1.0
EventType: configDump MessageKey: null
ResourceBundleName: null
Source Class: com.ibm.ws.webcontainer.diag.WebcontainerDiagnosticProviderMBean
Source Method: configDump ContentType: 1
Cell: don7Node03Cell Node: don7Node03 Server: server1 SrvDetail:
Item Concatenated Name Value
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
additionalClasspath = Null
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
applicationName = PlantsByWebSphere
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
applicationStartupWeight = 1
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
autoLoadFiltersEnabled = false
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
autoRequestEncoding = true
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
autoResponseEncoding = true
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
codeErrorPages = 500=com.ibm.ws.container.ErrorPage@63dc63dc;404=com.ibm.ws.container.
ErrorPage@63c263c2
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
contextParams = password=wsdemo1;userID=WSDEMO;dataSourceName=jdbc/PlantsByWebSphereData
Source
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
contextRoot = /PlantsByWebSphere
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
defaultErrorPage = Null
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
defaultErrorPageDescription = PlantsByWebSphere Web App
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
directoryBrowingEnabled = false
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
displayName = PlantsByWebSphere Web Application
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
documentRoot = D:WebSphere610profilesAppSrv01installedAppsdon7Node03CellPlantsByWebSphere.
earPlantsByWebSphere.war
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
exceptionErrorPages = Null
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
fileServingAttributes = Null
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
fileServingEnabled = true
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
invokerAttributes = Null
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
mimeFilteringEnabled = false
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
mimeMappings = Null
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
moduleID = Null
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
moduleName = PlantsByWebSphere.war
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
moduleStartupWeight = 10000
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
reloadInterval = 3
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
reloadingEnabled = true
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
servletServingByClassnameEnabled = false
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
syncToThreadEnabled = false
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
version = 24
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsByWebSphere.war-
welcomeFiles = index.html
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
additionalClasspath = Null
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
applicationName = PlantsByWebSphere
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
applicationStartupWeight = 1
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
autoLoadFiltersEnabled = false
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
autoRequestEncoding = false
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
autoResponseEncoding = false
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
codeErrorPages = Null
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
contextParams = Null
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
contextRoot = /PlantsByWebSphere/docs
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
defaultErrorPage = Null
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
defaultErrorPageDescription = Contains the Technology PlantsByWebSphere Sample Gallery
files
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
directoryBrowingEnabled = false
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
displayName = PlantsByWebSphere Sample Gallery Web Application
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
documentRoot = D:WebSphere610profilesAppSrv01installedAppsdon7Node03CellPlantsByWebSphere.
earPlantsGallery.war
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
exceptionErrorPages = Null
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
fileServingAttributes = Null
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
fileServingEnabled = true
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
invokerAttributes = Null
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
mimeFilteringEnabled = false
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
mimeMappings = Null
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
moduleID = Null
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
moduleName = PlantsGallery.war
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
moduleStartupWeight = 10000
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
reloadInterval = 3
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
reloadingEnabled = true
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
servletServingByClassnameEnabled = true
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
syncToThreadEnabled = false
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
version = 24
startup-vhosts-default_host-webapps-PlantsByWebSphere#PlantsGallery.war-
welcomeFiles = Null |
使用此信息
可以通过 WebContainer 诊断提供程序从此示例诊断一系列问题:
-
症状:静态内容和 HTML 文件未正确显示。
查找内容:configDump:验证所涉及应用程序的 fileServingEnabled 是否设置为 True。
示例:
startup-vhosts-admin_host-webapps-filetransfer#filetransfer.war-fileServingEnabled = true
|--10--------20--------30--------40--------50--------60--------70--------80--------9|
|-------- XML error: The previous line is longer than the max of 90 characters ---------|
|
-
症状:用户尝试调用 JSP 并收到“Error 404: SRVE0190E: File not found”。
查找内容:configDump:验证是否为应用程序指定了正确的上下文根。
示例:
startup-vhosts-default_host-webapps-DefaultApplication#DefaultWebApplication.war-
contextRoot = / |
-
症状:welcome 文件未正确提供。
查找内容:configDump:验证正确指定了 welcom 文件,而且,如果 welcome 文件为静态文件,请验证 fileServingEnabled 是否已设置为 True。
示例:
startup-vhosts-default_host-webapps-DefaultApplication#DefaultWebApplication.war-
fileServingEnabled = false |
-
症状:某些类型的资源显示正确,但无法按照类名称显示 Servlet。
查找内容:configDump:验证 servletServingByClassname Enabled 是否已设置为 True。
示例:
startup-vhosts-default_host-webapps-DefaultApplication#DefaultWebApplication.war-
servletServingByClassnameEnabled = true |
-
症状:在测试控制台模块时,发现对 JSP 的更改未在登录到应用服务器时显示。
查找内容:configDump:验证所涉及应用程序的 reloadingEnabled 是否已设置为 True(以允许每次部署新更改时重新加载 JSP)。
示例:
startup-vhosts-default_host-webapps-DefaultApplication#DefaultWebApplication.war-
reloadingEnabled = true |
-
症状:无法通过正确的上下文根找到已安装的应用程序。
查找内容:configDump:检查重复的虚拟主机别名。
示例:
startup-vhosts-admin_host-aliases = :9062;:9045; |
-
症状:未正确调用筛选器。
查找内容:stateDump:验证是否已正确地对筛选器进行了命名和映射。
示例:
vhosts-default_host-webapps-DefaultApplication#DefaultWebApplication.war-filters-
AsyncFilter-filterClassName = com.ibm.ws.ard.filter.AsyncFilter
vhosts-default_host-webapps-DefaultApplication#DefaultWebApplication.war-filters-
AsyncFilter-filterMapping-349705432-dispatchMode = REQUEST
vhosts-default_host-webapps-DefaultApplication#DefaultWebApplication.war-filters-
AsyncFilter-filterMapping-349705432-servletName = Null
vhosts-default_host-webapps-DefaultApplication#DefaultWebApplication.war-filters-
AsyncFilter-filterMapping-349705432-urlPattern = /* |
-
症状:重复刷新 Servlet/JSP 时显示相同的输出。
查找内容:stateDump:页面可能已缓存。验证是否已将 Caching Enabled 设置为 False。
示例:
vhosts-default_host-webapps-DefaultApplication#DefaultWebApplication.war-servlets-Snoop
|--10--------20--------30--------40--------50--------60--------70--------80--------9|
|-------- XML error: The previous line is longer than the max of 90 characters ---------|
Servlet-cachingEnabled = true |
-
症状:服务器处于已启动状态前,Servlet 未完全初始化。
查找内容:stateDump:验证所涉及的应用程序的 loadOnStartup 是否已设置为 True。
示例:
vhosts-default_host-webapps-DefaultApplication#DefaultWebApplication.war-servlets-Hello
|--10--------20--------30--------40--------50--------60--------70--------80--------9|
|-------- XML error: The previous line is longer than the max of 90 characters ---------|
Pervasive Servlet-loadOnStartup = true |

 |

|
结束语
本文讨论了 WebSphere Application Server V6.1 中的诊断提供程序工具。能够实时地探测具有诊断提供程序的组件,以了解器配置信息和状态信息,并能执行自诊断测试。诊断提供程序提供的所有信息都可以方便地在一个位置找到,而不用通过很多不同的机制来获得信息的不同部分,而且能够方便地通过脚本收集和分析此信息。
多个重要的 WebSphere Application Server 组件都具有诊断提供程序,可以提供有用的信息来帮助解决常见问题。可以通过管理控制台、wsadmin 脚本或 JMX 客户机代码访问诊断提供程序。本文中使用了 runtime advisor、connection manager 和 Web 容器诊断提供程序来说明其使用。
虽然本文中没有讨论,但 WebSphere Application Server V6.1 也提供了系统编程接口(System Programming Interface,SPI)来支持创建新诊断提供程序。具体来说,可以为构建于 WebSphere Application Server 之上的其他产品创建新诊断提供程序,甚至还可以为复杂自定义应用程序中的组件创建诊断提供程序。WebSphere Application Server 信息中心提供了关于此 SPI 的信息。
致谢
作者要感谢 Erinn Koonce、Jim Stephens 和 Kevin Kelle 在撰写本文的过程中提供的帮助。
参考资料 学习
获得产品和技术
讨论
作者简介  | |  |
Don Bourne 是 IBM Toronto Lab 的 WebSphere Serviceability 架构师。Don 于 1996 年加入 IBM,自从 2003 年加入 WebSphere Application Server 团队后一直专门从事服务能力方面的工作。目前 Don 正在与 IBM Support Assistant 团队合作设计未来的解决方案的体系结构,以帮助用户快速解决问题。 |
 | 
|  |
Daniel Julin 在开发复杂的联机系统及其故障诊断方面具有 20 年的经验。作为 WebSphere Serviceability Team 的技术领域负责人,他目前重点关注于帮助团队定义和实现一组工具和技术的集合,以协助确定 WebSphere Application Server 问题,并实现 IBM Support 工作效率的最大化。他有时候也直接为各种关键的客户支持情况提供协助。 |
对本文的评价
|  |