首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

权威支持 使用 WebSphere 诊断提供程序进行实时问题确定(2)实例3

权威支持 使用 WebSphere 诊断提供程序进行实时问题确定(2)实例3

示例 3:使用 wsadmin 脚本诊断常见 Web 容器问题此示例说明如何使用 Web container 诊断提供程序的 configuration dump 功能。
可用于查找常见问题的另一个诊断提供程序是 WebContainerDP。首先,可以通过查看从 WebContainerDP 的 configDump 获得的配置数据诊断大量问题。调用配置转储与前面调用状态转储的流程非常相似。
清单 5. 用于从 WebContainer 诊断提供程序生成格式化配置转储的 Jython 脚本
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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 诊断提供程序的格式化配置转储输出
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
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









返回列表