??xml version="1.0" encoding="utf-8" standalone="yes"?> 在每个专栏中Q支持权威将讨论 IBM Technical Support 的可用于 WebSphere 产品的资源、工具和其他元素Q以及一些可以进一步增强您?IBM 支持体验的技术和新思想?/em> 按照惯例Q我们将首先提供关于整个 WebSphere® C的一些重要新闻: 通过q些更新Q要?IBM Support Assistant Version 3 UL?Version 4 的所有问题确定工具都已完成了转换?/p> l箋x与支持相关的各个|站以及本专栏,以获得有x们所到的其他工L新闻?/p> 接下来让我们l箋今天的主?#8230;… 我们在与 WebSphere 产品用户q行有关问题定的交谈时Q遇到的一个常见问题是“我现在应该用哪个工P”本专栏自从开始以来,已描qC如何以及何时使用许多问题定工具Q但是如果像q样一ơ一个地介绍工具Q跟t每个可用的工具会充满了挑战,要确定哪个工h适合于Q何给定的情Ş更不用说了。由于更q大? IBM WebSphere Support C是相当动态的工具开发h员社一事实Q问题变得进一步复杂化Q这意味着可用的工具集始终变化不定Q针对相似的问题Q某一天用的最佛_具可能在几个月后已经不一样了?/p> 我们的希望在于,本文ؓ您阐明某些目前可用的主要问题定工具。您在下面扑ֈ单的参考表|其中在单个地ҎCZ您在?WebSphere Support 合作时可能遇到的最常见问题定工具Q特别是有关 IBM WebSphere Application Server ?Java 虚拟机(Java Virtual MachineQJVMQ的工具。这些表格ƈ不详,所提供的信息在性质上是不完的——因ؓ在本文发表之后,工具l发展改q,q且不同的h以不同的方式评价各个工兗然而,不管您最l用的工具是什么,此信息都可作为有价值的初始参考点。如果您y发现q种Ҏ很成功,请告诉我们,以便我们能够Z后的专栏计划定期的更新?/p> 在接触到具体的表g前,查一下我们在l合q些信息时用的指导原则是有帮助的: ?IBM Support l织直接或间接提供的大多数问题确定资源一P本文专门集中于可?IBM 免费获得的工兗这q不是说不存在其他工PIBMQ特别是 Tivoli®Q和其他软g供应商提供了各种收费的问题确定工P您可以用它们来调查 WebSphere 问题。其中有些工h供的功能q远出了这里提到的免费工具的范围。然而,本文的目的而言Q以及ؓ了确保每个h都有讉Kq些资源的同{能力,q些表格省略了商业化的工兗?/p> 在评估问题确定工hQIBM 考虑所有的相关候选工P而不这些工具驻留在何处。不q在一般情况下QIBM Support 仅收?IBM Support Assistant 提供的公共^C的独立工P除非存在攉其他工具的技术原因)。IBM Support Assistant 是中央存储库Q目前用于查找所有的工具、用于安装和接收现有工具的定期更斎ͼ以及用于利用多个工具和其他问题确定功能之间的集成潜力Q例如,工具与诊断攉?PMR 报告功能联系hQ或者将一个工L输出作ؓ输入提供l另一个工P{等Q?/p> q里列出的工具仅限于客户?IBM Support 团队l常用于在活动中帮助分析问题定构g的工P而不包括攉问题定构g或者指导或全面帮助问题定q程的工兗?/p> 随着工具的发展和新工L出现Q在最大限度地促进创新的名义下Q以及ؓ了鼓p多感兴趣的工L写h员做A献,必定存在功能上的重叠。因此,您将发现q些表格中有些地方列Z用于同一个目的的多个工具。在q些情况下,提供有兌些工具之间的重要区别的信息,以帮助您挑选最适合需要的工具。一般情况下Q将会有一个工兯标识?strong>主要工具Q用_体字型表示Q,我们估计它是您在试执行特定问题定d时最适合首先试的工兗然而,如果您具有对另一个工L特定特征的特D需要,您也可以使用替代工具。一般来ԌIBM Support 主要致力于对每个领域中指定的主要工具q行增强和支持,q且随着旉的推U,会量把替代工具中有h值的新功能合q到主要工具中?/p> 支持 虽然我们希望使新的工具和新的工具功能快可用Q但q有时意味着在编写它们之后随?#8220;按原?#8221;使它们可用。另一斚wQ我们认识到许多用户惌q且需要可靠和可信赖的工具IBM WebSphere Support 提供的每个工具与许可协议相关联,许可协议定义了该工具是否受支持的条g。(不得本文中的Q何信息理解ؓ覆盖或取代Q何许可协议中提供的信息。)不过在一般情况下Q?/p> 下面的表g要按照它们读取的构gcdq行l织。其中也列出了可以用每U构建分析来定的问题类型。在调查某个问题时决定如何进行的时候,务必Cq一炏V当您需要快速参考的时候,q种以构件ؓ中心的视N常非常有用Q例如,您面ҎU特定类型的日志或{储文Ӟq且您需要快速查找某个可用于分析该文件的工具。然而,以前?#8220;权威支持”专栏用事实证明,要提高效率,问题定q程应该遵@定义良好的计划,该计划基于问题症状及其可能的ҎQƈ且不执行随机操作或?#8220;只是因ؓ那些构g存在”而分析各个构件。无论是哪种方式Q这些表格都应该能够帮助您?/p> 或者,您可能希望利?IBM Guided Activity Assistant 或以前的专栏中提到的其他某个问题定指导资源Q以帮助您决定何时检查每个构件和使用每个工具可能是最高效的?/p> 下面几个部分中的工具表格按照它们所用于的构件进行组l: 每个表格后面是每个工兯q文档中对每个工具的描qͼ以及每个工具的一般特征的大致l分?/p> 此类构g包括Q?/p> Verbose Garbage Collection (verboseGC) 日志也许是最常见?JVM 诊断cd。它昄了整?JVM 生存期间Q各个垃圑֛收周期的序。它作ؓ定问题时的一初始的辅助工具Q常常具有不可估量的价|用于和诊断反常的内存分配问题,例如内存泄漏、碎片,以及? GC 有关的性能问题{等?/p> U程转储也是一U极为常见的 JVM 诊断cd。线E{储(也称?javacoreQ可以根据管理员的请求触发,或者在 JVM 中遇到某U特D情冉|自动触发。线E{储是一个文本文Ӟ其中包含 JVM 状态的关键斚w的一个相对较短的快照。该快照最常用的部分是 JVM 中当前活动线E的列表Q线E{储也因此而得名。线E{储最常见的用途是诊断 JVM 中出现挂赗变慢、崩溃或 CPU 占用率过高的原因? 堆{?/strong>是也可由 JVM 生成的另一UŞ式的转储Q可以按需生成Q也可以在满特D条件时自动生成。通常Q堆转储通常是一个非常大的文Ӟ其中包含当前 JVM 堆中所有对象的一个列表。它用于在出现内存不的情况下执行深入分析?/p> pȝ堆或核心?/strong>是开销最大的堆,但也是最完整的堆。它是一个巨大的二进制文Ӟ反映?JVM q程的全部内容:每一? Java 对象及其字段、每一个线E、每个内存区域,{等。系l{储的最初用途是在其他类型的转储不或无法生成时Q帮助诊断崩溃、挂h复杂的内存分配问题。不q,׃pȝ转储非常完整Q它也能用来获取有关 WebSphere Application Server q行时当前状态的多方面信息,甚至有关在该q行时中执行的应用程序的信息? q里的有些构件的名称和类型特定于 IBM JDKQ其他供应商?JDK 可能产生怼的文件。有兌些类型的构g的进一步详l信息,请参?#8220;权威支持”专栏用于实际故障诊断的功能和工具?/p> 工具描述 IBM Monitoring and Diagnostic Tools for Java - Garbage Collection and Memory Visualizer (GCMV) 请参?IBM Support Assistant 中的完整描述? IBM Pattern Modeling and Analysis Tool (PMAT) for Java Garbage Collector 请参?IBM Support Assistant ?alphaWorks 中的完整描述? Diagnostic Tool for Java Garbage Collector 请参?alphaWorks 中的完整描述? IBM Thread and Monitor Dump Analyzer (TMDA) 请参?IBM Support Assistant ?alphaWorks 中的完整描述? ThreadAnalyzer 请参?IBM Support Assistant 中的完整描述? IBM Lock Analyzer for Java 该图形用L面连接到q_包,q提供所需的控制和分析以确定性能p糕的锁?/p> 请参?alphaWorks 中的完整描述? 用于堆{储: Memory Dump Diagnostic for Java (MDD4J) 请参?IBM Support Assistant 中的完整描述? HeapAnalyzer 请参?alphaWorks 中的完整描述? HeapRoots 请参?alphaWorks 中的完整描述? IBM Monitoring and Diagnostic Tools for Java - Dump Analyzer 请参?IBM Support Assistant 中的完整描述? 用于q些cd的构件的zd包括Q?/p> 日志记录通常用于在日志文件中记录您希望跟t的重要事g。日志记录用于指C: 日志记录通常是始l启用的Q因此日志记录代码必MU相当小Q这通常是您应该注意的重要事V? 跟踪通常用于记录在调试代码问题时可能有用的Q何信息。跟t通常用于指示调用了哪些方法、向Ҏ传入了哪些数据(或从Ҏq回了什么|以及对代码边界之外的其他Ҏ的调用返回了什么数据。跟t事件体U可能比较大Q因此只有在诊断问题时启用。由于跟t事件的内容极ؓ详细Q而且是技术信息,因此l常只对~写应用E序的h有h倹{打开跟踪的情况下Q应该能够了解在代码中可能出现的M问题? 工具描述 Log AnalyzerQ以及相关的 Symptom EditorQ?/strong> 请参?IBM Support Assistant 中的完整描述? Trace Analyzer for WebSphere Application Server 请参?alphaWorks 中的完整描述? IBM Trace and Request Analyzer for WebSphere Application Server 请参?alphaWorks 中的完整描述? Database Connection Pool Analyzer for IBM WebSphere Application Server 有关使用此工具分析连接池问题所需要的 WebSphere Application Server 跟踪讄Q请参阅 MustGather 信息?/p> 请参?alphaWorks 中的完整描述? 工具描述 Visual Configuration Explorer (VCE) 请参?IBM Support Assistant 中的完整描述? IBM Web Server Plug-in Analyzer for WebSphere Application Server 请参?alphaWorks 中的完整描述? Configuration Validator 请参?WebSphere Application Server 信息中心的完整描q? Classloader Viewer 请参?WebSphere Application Server 信息中心的完整描q? Install Verification Utility (IVU) 请参?WebSphere Application Server 信息中心的完整描q? IBM Port Scanning Tool 请参?IBM Support Assistant 中的完整描述? 我们对用?WebSphere 产品的一些最帔R到的问题定工具的概q到此就l束了,q提供了一些帮助您定何时最适合使用每个工具的信息。但愿此信息帮助您q速和可能高效地启动问题解决d。请CQIBM 提供的工具集在不断地发展和增加,因此务必定期查有x个工L最C息,q从问题定工作的前沿返回到本专栏以了解更多新闻?/p> 如果仍然使用~省的类加蝲{略:PARENT_FIRST, ׃BSF自n加蝲c,D使用org.eclipse.osgi.framework.internal.core.BundleLoader装蝲器来装蝲Q在q个装蝲器别,g发现不了JavaScriptEnginec,实际上JavaScriptEngine和BSFManager同在一个包中?/p> 一个可行的解决Ҏ是,该baf.jar(JavaScriptEnginecL在jar?拯到jre/lib/ext目录下,则org.eclipse.osgi.framework.internal.core.BundleLoaderc装载器一定能扑ֈQ因JDK加蝲序在org.eclipse.osgi.framework.internal.core.BundleLoader之先?/p> 然而,pȝ理员处于安全的考虑Q不同意在jre下放|bsf.jar包。看来只得另M法。通过阅读下面的文章,理解WAS6.1的加载方式,可知创徏应用E序׃n库可以解册一问题。参考:在应用程序服务器U别使用׃n?/strong>。注意:在应用程序别用共享库q不能解册个问题,如果该类没有使用自己的ClassLoader则应可行?/p> 详细操作步骤Q?/p> 1、打开WAS6.1控制収ͼ创徏׃n?/p> 2、在应用E序服务器别用共享库 新徏c装载器Q注意,q里?nbsp;cd装入且是先用应用程序装载器 选项 保存 c装载器创徏完成 新徏׃n库的引用 选择已经配置好的׃n?br /> q是配置完的样子 以下为参考文?br /> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 12Q?Q?步骤2Q添加一个EJB模块和工具JAR 下面Q往应用E序中添加一个EJBQ它也依赖VersionChecker JAR文g。在此,在EAR的根目录d一个VersionCheckerV2.jar文g。在q个JAR文g中的VersionCheckerc返回了Version 2.0。ؓ了保证扩展类加蝲中的工具JAR可用Q在EJB模块的manifest文g中添加一个引用,如例12-8Q?/p> ?2-8更新EJB模块的MANIFEST.MF文g Manifest-Version: 1.0 Class-Path: VersionCheckerV2.jar 现在的结果是Q有一个Web模块Q在它的WEB-INF/classes目录下面有一个servletQ在WEB-INF/lib目录下面有VersionCheckerV1.jar文g。还有一个EJB模块引用了EAR根目录下面的VersionCheckerV2.jar工具JAR。你期望Web模块装入VersionCheckercL件的版本是什么?是WEB-INF/lib下的Version 1.0q是工具JAR下面的Version 2.0Q测试结果如?2-9Q?/p> ?2-9cd载例2 VersionChecker called from Servlet VersionChecker is v2.0. Loaded bycom.ibm.ws.classloader.CompoundClassLoader@26282628 Local ClassPath: C:\WebSphere\AppServer\profiles\AppSrv02\installedApps\kcgg1d8Node02Cel l\ClassloaderExample.ear\ClassloaderExampleEJB.jar;C:\WebSphere\AppServ er\profiles\AppSrv02\installedApps\kcgg1d8Node02Cell\ClassloaderExample .ear\VersionCheckerV2.jar Delegation Mode: PARENT_FIRST VersionChecker called from EJB VersionChecker is v2.0. Loaded bycom.ibm.ws.classloader.CompoundClassLoader@26282628 Local ClassPath: C:\WebSphere\AppServer\profiles\AppSrv02\installedApps\kcgg1d8Node02Cel l\ClassloaderExample.ear\ClassloaderExampleEJB.jar;C:\WebSphere\AppServ er\profiles\AppSrv02\installedApps\kcgg1d8Node02Cell\ClassloaderExample .ear\VersionCheckerV2.jar Delegation Mode: PARENT_FIRST 正如所看到的,当同时调用EJB模块和Web模块QVersionChecker是Version 2.0。当Ӟ原因是:WARcd载器请求委托给了父cd载器而不是他自己Q所以工具JARp同一个类加蝲器加载,而无需考虑h是来自于servletq是EJB?/p> 12Q?Q?步骤 3Q改变WARcd载的委托模式 现在是否希望Web模块使用WEB-INF/lib目录下面的VersionCheckerV1.jar文gQؓ了这个目的,需要先类加蝲委托模式从parent first改ؓparent last?br /> 1. 在向导栏选择Enterprise ApplicationsQ?/p> 2. 选择ClassloaderExample应用E序Q?/p> 3. 在模块部分选择Manage modules Q?/p> 4. 选择ClassloaderExampleWeb模块Q?/p> 5. 类加蝲序修改成应用程序类加蝲优先(PARENT_LAST)。记住,q个条目应该UCؓWARcd载优先,参见 “cd?委托模式”Q?/p> 6. 单击OK. 7. 保存配置Q?/p> 8. 重新启动应用E序?/p> WEB-INF/lib下的VersionCheckerV1q回version of 1.0。可以在?2-10中看刎ͼ ?2-10cd载例3 VersionChecker called from Servlet VersionChecker is v1.0. Loaded bycom.ibm.ws.classloader.CompoundClassLoader@4d404d40 Local ClassPath: C:\WebSphere\AppServer\profiles\AppSrv02\installedApps\kcgg1d8Node02Cel l\ClassloaderExample.ear\ClassloaderExampleWeb.war\WEB-INF\classes;C:\W ebSphere\AppServer\profiles\AppSrv02\installedApps\kcgg1d8Node02Cell\Cl assloaderExample.ear\ClassloaderExampleWeb.war\WEB-INF\lib\VersionCheck erV1.jar;C:\WebSphere\AppServer\profiles\AppSrv02\installedApps\kcgg1d8 Node02Cell\ClassloaderExample.ear\ClassloaderExampleWeb.war Delegation Mode: PARENT_LAST VersionChecker called from EJB VersionChecker is v2.0. Loaded bycom.ibm.ws.classloader.CompoundClassLoader@37f437f4 Local ClassPath: C:\WebSphere\AppServer\profiles\AppSrv02\installedApps\kcgg1d8Node02Cel l\ClassloaderExample.ear\ClassloaderExampleEJB.jar;C:\WebSphere\AppServ er\profiles\AppSrv02\installedApps \kcgg1d8Node02Cell\ClassloaderExample .ear\VersionCheckerV2.jar Delegation Mode: PARENT_FIRST 如果你用类加蝲器的搜烦功能Q搜?VersionChecker*Q会得到?2-9Q?/p> ?2-9cd载查看器搜烦功能 ?2-11昄源代?/p> ?2-11cd载查看器搜烦功能 WAS Module Compound Class Loader (WAR class loader): file: / C: / WebSphere / AppServer / profiles / AppSrv02 / installedApps / kcgg1d8Node02Cell / ClassloaderExample.ear / ClassloaderExampleWeb.war / WEB-INF / lib / VersionCheckerV1.jar WAS Module Jar Class Loader (Application class loader): file: / C: / WebSphere / AppServer / profiles / AppSrv02 / installedApps / kcgg1d8Node02Cell / ClassloaderExample.ear / VersionCheckerV2.jar 12Q?Q?步骤4Q用共享库׃n工具JAR 在此之前Q只有一个应用程序用VersionCheckerV2.jar文g。是否希望多个应用程序能够共享它Q当Ӟ你可以在每个EAR文g中把q个文g打包q去。但是如果需要修改这个工具JARQ那需要重新部|所有的应用E序。ؓ了避免这个麻烦,你可以用共享库全局׃nq个JAR文g?/p> ׃n库可以定义在单元、节炏V应用程序服务器和集。一旦你定义了共享库Q必d它跟应用E序服务器的cd载器或者单独的Web模块兌h。根据共享库指派的目的地不同QWebSphere会用匹配的cd载器加蝲׃n库?/p> 只要愿意Q可以定义多个共享库。也可以为应用程序、Web模块或者应用程序服务器指派多个׃n库?/p> 在应用程序别用共享库 定义一个名为VersionCheckerV2_SharedLib的共享库Qƈ把它跟ClassloaderTest应用E序兌hQ步骤如下: 1. 在管理控制台Q选择Environment→Shared LibrariesQ?/p> 2. 选择׃n库的作用域,比如单元Q单击NewQ?/p> 3. 如图12-10Q?/p> ?2-10׃n库配|?/p> –Name: 输入VersionCheckerV2_SharedLibQ?/p> –Class path: 输入c\径中的条目,每个条目之间用回车隔开。如果提供绝对\径,是用WebSphere环境变量Q比?FRAMEWORK_JARS%/VersionCheckerV2.jarQ确定你已经定义了一个和׃n库相同作用域的变量?/p> –Native library path: 输入JNI代码使用的DLLs?so文g列表?/p> 4. 单击OKQ?/p> 5.选择Applications → Enterprise ApplicationsQ?/p> 6. 选择应用E序ClassloadersExample Q?/p> 7. 在引用选项Q选择Shared library references Q?/p> 8. 在应用程序列选择ClassloaderExample Q?/p> 9. 单击Reference shared librariesQ?/p> 10. 选择VersionCheckerV2_SharedLibQ单?gt;>按钮选中的移动到Selected列,如下?2-11Q?/p> ?2-11指定一个共享库 11.单击OK Q?/p> 12.ClassloaderExample应用E序׃n库配|窗口如下图12-12Q?/p> ?2-12共享库指派l应用程序ClassloaderExample 13.单击OKQ保存配|?/p> 如果我们现在从EAR文g的根目录VersionCheckerV2.jar删除Q在EJB模块的manifest文g中也把引用删除,重新启动应用服务器,看到?2-12的结果。记住,Web模块的类加蝲序依然是应用程序类加蝲优先(PARENT_LAST)?/p> ?2-12cd载例4 VersionChecker called from Servlet VersionChecker is v1.0. Loaded bycom.ibm.ws.classloader.CompoundClassLoader@2e602e60 Local ClassPath: C:\WebSphere\AppServer\profiles\AppSrv02\installedApps\kcgg1d8Node02Cel l\ClassloaderExample.ear\ClassloaderExampleWeb.war\WEB-INF\classes;C:\W ebSphere\AppServer\profiles\AppSrv02\installedApps\kcgg1d8Node02Cell\Cl assloaderExample.ear\ClassloaderExampleWeb.war\WEB-INF\lib\VersionCheck erV1.jar;C:\WebSphere\AppServer\profiles\AppSrv02\installedApps\kcgg1d8 Delegation Mode: PARENT_LAST VersionChecker called from EJB VersionChecker is v2.0. Loaded bycom.ibm.ws.classloader.CompoundClassLoader@19141914 Local ClassPath: C:\WebSphere\AppServer\profiles\AppSrv02\installedApps\kcgg1d8Node02Cel l\ClassloaderExample.ear\ClassloaderExampleEJB.jar;C:\henrik\VersionChe ckerV2.jar Delegation Mode: PARENT_FIRST 正如预料的,׃Web模块的委托模式,当servlet需要VersionCheckerc,VersionCheckerV1.jar文g被加载。当EJB需要VersionChecker的类的时候,׃从指向C:\henrik\VersionCheckerV2.jar的共享库中加载它。如果你希望Web模块也用共享库Q只需要将cd载顺序恢复成~省|Web模块的类加蝲是父cd载优先?/p> 在应用程序服务器U别使用׃n?/strong> ׃n库也可以跟应用程序服务器兌h。在q个服务器上的部|的所有应用程序都能够看到׃n库的代码列表。要把共享库跟应用程序服务器兌hQ首先要为应用程序服务器创徏一个附加的cd载器Q步骤如下: 1. 选择应用E序服务器; 2. 在应用程序基l构部分Q展开Java and Process ManagementQ选择Class loaderQ?/p> 3. 选择NewQؓq个cd载器选择cd载顺序,父类加蝲优先(PARENT_FIRST)或者应用程序类加蝲优先(PARENT_LAST)Q单击ApplyQ?/p> 4. 单击刚刚创徏的类加蝲器; 5. 单击Shared library referencesQ?/p> 6. 单击AddQ选择希望跟应用程序服务器兌的库。重复选择操作Q将多个库跟q个cd载器兌。比如选择VersionCheckerV2_SharedLib条目Q?/p> 7. 单击OKQ?/p> 8. 保存配置Q?/p> 9. 重新启动应用E序服务器,修改才会生效?/p> VersionCheckerV2׃n库跟应用E序服务器关联v来,得C12-13的结果?/p> ?2-13cd载例5 VersionChecker called from Servlet VersionChecker is v1.0. Loaded bycom.ibm.ws.classloader.CompoundClassLoader@40c240c2 Local ClassPath: C:\WebSphere\AppServer\profiles\AppSrv02\installedApps\kcgg1d8Node02Cel l\ClassloaderExample.ear\ClassloaderExampleWeb.war\WEB-INF\classes;C:\W ebSphere\AppServer\profiles\AppSrv02\installedApps\kcgg1d8Node02Cell\Cl assloaderExample.ear\ClassloaderExampleWeb.war\WEB-INF\lib\VersionCheck erV1.jar;C:\WebSphere\AppServer\profiles\AppSrv02\installedApps\kcgg1d8 Node02Cell\ClassloaderExample.ear\ClassloaderExampleWeb.war VersionChecker called from EJB VersionChecker is v2.0. Loaded bycom.ibm.ws.classloader.ExtJarClassLoader@7dee7dee Local ClassPath: C:\henrik\VersionCheckerV2.jar Delegation Mode: PARENT_FIRST 我们定义的新的名为ExtJarClassLoadercd载器Q在EJB模块hӞ它装入VersionCheckerV2.jar文g。由于委托模式,WARcd载器l箋装入自己的version?/p> 12Q?cd载器问题诊断 JVM 5.0提供了一些配|,可以让我们查看详l的c装入,比如JVM参数 -verbose:dynload?Dibm.cl.verbose=<name>?/p> 在实际开发过E中Q如果用不当,会出现很多类加蝲相关的问题。当遇到cd载问题时Q可以查看WAS的相x志,在日志中出现如下异常Q可以认为是cd载器出现了问题: ClassCastException ClassNotFoundException NoClassDefFoundError NoSuchMethodError IllegalArgumentException UnsatisfiedLinkError VerifyError 关于问题诊断Q将在下一文章《WAS 6.1cd载问题诊断》详l阐q?/p> ȝ 本文针对WAS6.1版本Q详l介l了cd载的概念以及如何客户化,q过几个例子向大家讲qC影响cd载的选项的用。虽然WAS 6.1允许Ҏ需要修改类加蝲{略Q比如将父类优先Ҏ应用E序优先Q但是不推荐q么使用。笔者曾l就遇到因ؓ修改{略Q导致应用程序无法启动。原因是WAS?的组件和应用E序使用的某些类是一致的Q加载策略选择不正,׃Dcd载错误?/p>首先QWAS用IBM JSSEQ不支持Sun JSSEQ有文档说明?br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal;" />http://www-01.ibm.com/support/docview.wss?uid=swg21418924
然后Q你要检?nbsp;
1Q?WAS\java\jre\lib\security\java.security, 看看secrity provider list里是否有Sun JSSE
# List of providers and their preference orders (see above):
#
#security.provider.1=com.ibm.crypto.fips.provider.IBMJCEFIPS
security.provider.1=com.ibm.crypto.provider.IBMJCE
security.provider.2=com.ibm.jsse.IBMJSSEProvider
security.provider.3=com.ibm.jsse2.IBMJSSEProvider2
security.provider.4=com.ibm.security.jgss.IBMJGSSProvider
security.provider.5=com.ibm.security.cert.IBMCertPath
security.provider.6=com.ibm.crypto.pkcs11impl.provider.IBMPKCS11Impl
security.provider.7=com.ibm.security.cmskeystore.CMSProvider
security.provider.8=com.ibm.security.jgss.mech.spnego.IBMSPNEGO
security.provider.9=com.ibm.security.sasl.IBMSASL
security.provider.10=com.ibm.xml.crypto.IBMXMLCryptoProvider
security.provider.11=com.ibm.xml.enc.IBMXMLEncProvider
security.provider.12=org.apache.harmony.security.provider.PolicyProvider
2Q?c\径里是否有Sun JSSE 的jar?br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal;" />
3Q你的代码里是否有调用Sun JSSE provider最新快?/h2>
“再多一个工hp叫?#8221;
我们选择的工?/h2>
用于 JVM 生成的信息的工具
?1. 用于 JVM 生成的信息的工具
构gcd 问题cd 典型输入 可用的工?/th> Verbose Garbage Collection 日志 (verbosegGC)
Java 转储/javacore
U程
堆{?/td>
pȝ或核心{?/td>
一个详l的 GC 数据可视化器Q用于分析ƈl制所?IBM 详细 GC 日志——Xtgc 输出Qƈ且可扩展到分析和l制其他形式的输入)。它提供了广泛的详细 GC 数据值的囑Ş昄Qƈ处理 optthruput、optavgpause ?gencon GC 模式。它h原始日志、表格式数据和图表视图,q且可以数据保存到 jpeg ?.csv 文gQ用于导出到电子表格Q?/p>
输入Qverbosegc 日志
输出Q图形表CŞ式、html、jpeg ?csv 文g
支持Q此工具?IBM 提供支持Q目前是用于其所在领域的主要工具?/p>
分析 IBM 详细 GC 跟踪Q分?Java 堆用情况,q基?Java 堆用情늚模式建模提供重要配置。此工具先于上面?IBM Monitoring and Diagnostic Tools for Java - Garbage Collection and Memory Visualizer (1)Qƈ提供了一个可能相当有用的不同透视图?/p>
输入Qverbosegc 日志
输出Qverbosegc 日志的图形或表格表示形式
其他功能Q关?JVM 参数的一般徏?
支持Q技术预览版Q按原样提供?/p>
通过d详细垃圾回收的输出,q生文本和囑Ş可视化表CŞ式及相关l计信息Q从而帮助检查运行在 JVM 下的应用E序的垃圑֛收特征?
输入Qverbosegc
输出Q文本和囑Ş可视化表CŞ?
支持Q按原样提供的工兗?/p>
分析一个或多个 Java U程转储?javacoreQƈ诊断监视器锁和线E活动,以便定挂v、死锁和资源争用或监视器瓉的根源?/p>
输入Q用于显C相关线E历史记录的单个或多?javacore
输出Q基?GUI 的视?
其他信息Q关?Analysis of hangs, deadlocks, and resource contention or monitor bottlenecks using IBM Thread and Monitor Dump Analyzer for Java Technology 的网l广?
支持Q技术预览版Q按原样提供Q但是是该领域的主要工具?/p>
提供 Java U程转储?javacore 的分析,例如来自 WebSphere Application Server 的{储或 javacore。可以在不同的别分析线E用情况,从高U图形视囑ּ始,然后深入到各个线E的详细记录。如果线E{储中存在M死锁QThreadAnalyzer 检ƈ报告它们。此工具先于上面?IBM Thread and Monitor Dump Analyzer 工具 (4)Q但是其功能已集成到后者之中,后者正在成领域的主要工兗?
输入QJava U程转储/javacore
输出Q线E的囑Ş视图、加载多个线E{储以昄U程历史记录的能?
支持Q技术预览版Q按原样提供Q但是是该领域的主要工具。此工具可能会逐步淘汰Q请可能?IBM Thread and Monitor Dump Analyzer?/p>
旨在对动态应用程序执行锁分析Q以便突出具有可能媄响性能的锁争用的线E。此工具׃个包l成Q?
输入Q从 JVM 攉的统计信?
输出Q锁的图形视?
支持Q按原样提供的工兗?/p>
分析正在q行 WebSphere Application Server 或Q何其他独?Java 应用E序?JVM 中常见格式的内存转储Q堆转储Q。内存{储分析旨在确?Java 堆中可能是内存泄露根源的数据l构。该分析q确定应用程序的 Java 堆占用空间的主要肇事者和它们的所属关pR此工具能够分析从遇? OutOfMemoryError 问题的生产环境应用程序服务器中获得的非常大的内存转储Q将需?2 GB 或更多的 RAMQ。MDD4J 扩展了下面较旧的 IBM HeapAnalyzer (8) 的功能,管两个工具的用L面完全不同?/p>
输入Q来自虚拟机 (JVM) 的内存{储(堆{储)
输出Q交互式报告Q其中显CZ要的内存泄露可疑之处Q以及有兌些泄露的详细信息?
其他功能Q操作单个{储。有些版本提供了多个转储的比较分析?
支持Q此工具?IBM 提供支持Q目前是用于其所在领域的主要工具。在本文~写之际QIBM Support Assistant 中的最新版本ؓ Beta 版?/p>
HeapAnalyzer d单个 Java 内存转储Q堆转储Q,q您能够浏览{储以查看其内宏V此工具是上面的 Memory Dump Diagnostic for Java (MDD4J) 工具(7) 的前w,后者现在包含前者的大多数功能。当ӞHeapAnalyzer 中的原始树浏览功能比?MDD4J 中更加灵zR另一斚wQHeapAnalyzer ~Z MDD4J 中的某些更完善的泄露嫌疑算法,q且不支持多个{储的比较分析?/p>
输入Q单?java 堆{?
输出Q可疑对象的囑Ş视图和堆览?
支持Q按原样提供的工兗?/p>
HeapRoots d Java 堆{储文件ƈ提供用于分析数据的命令。这些命令对数据q行法Q或查询有关该数据的信息。HeapRoots 提供了命令行交互式界面,您可以在其中输入命oq获取结果?
输入Q堆转储文g
输出Q可疑对象的囑Ş视图和堆览?
支持Q按原样提供的工兗?/p>
一个可扩展的工hӞ它读?IBM JVM 产生的系l{储或核心文gQƈ针对该{储运行各U各L分析模块以诊断常见问题,或提供有兌 JVM 和当前运行在?JVM 中的M中间件或应用E序的内部状态的深入信息。目前,提供了用于对诸如死锁、挂赗崩溃、内存情늭常见 JVM 问题执行基本分析功能的模块。作为对该基本工L补充QWebSphere Applicationi Server Modules for Dump Analyzer 提供了附加的模块Q可昄 JVM 中的 WebSphere Application Server q行时的一般状态,以及有关多个 WebSphere Application Server 子系l的详细信息?/p>
输入Q由 JVM 附带?jextract 工具q行预处理的格式化系l{?
输出Q显CZ个报告,其中包含由指定的分析模块提取的信息,q包含有x在问题的观察l果的简短摘要,以及一个提供深入信息的详细信息部分?
其他功能Q提供交互式模式以手动检查{储的内容。得用戯够编写自q新的专门分析模块q将模块d到该工具?
支持Q此工具?IBM 提供支持Q目前是用于其所在领域的主要工具?/p>
用于日志和跟t文件的工具
?2. 用于日志和跟t文件的工具
构gcd 问题cd 典型输入 可用的工?/th> 来自多个产品的日志文?/td>
WebSphere 跟踪Q一般)
WebSphere Application Server 跟踪?HTTP 插g跟踪
WebSphere Application Server 跟踪Q连接工P
JVM verboseGC 跟踪
一个图形用L面,提供用于览、分析和兌多个产品产生的日志的单个联络炏V此工具是更q泛?IBM 自主计算zd的一部分?/p>
输入Q来?IBM 和其他供应商推出的许多Y件品的多个日志文g
输出Q基?GUI 的视囑֒日志文g兌
其他功能Q能够保存配|以帮助其他支持工程师进行进一步的分析。提供了配套?Symptom Editor 工具来创建您自己的症状数据库?
支持Q目前是其所在领域的主要工具?/p>
一个高度交互式的实用工P使您能够详细览、检查和搜烦 WebSphere Application Server 中的复杂跟踪文g?/p>
输入QWebSphere Application Server trace.logQ如果启用了高日志记录Q则q支持更多的输入
输出Q功能强大的囑Ş视图Q带{选器和搜索视?
其他功能Q能够保存配|以帮助其他支持工程师进行进一步的分析
支持Q按原样提供Q但目前是其所在领域的主要工具?/p>
帮助查找非正常gq、系l运行缓慢或pȝ表现为挂L后又恢复的情늚Ҏ。此工具?WebSphere Application Server ?HTTP 插g中的跟踪文gQ通过q些文g定各个hQƈ扑և特定操作需要花长时间完成的区域Q从而帮助您查跟t中的可疑区域,以确定是否存在问题。用h时将此工具与上面? Trace Analyzer for WebSphere Application Server (12) 搞淆,但事实上它们是完全不同的。此工具严格地集中于可能自动地扑և性能问题和gq,?Trace Analyzer 是通用工具Q主要用于手动检查跟t?/p>
输入QHTTP 服务器日?(http_plugin.log) ?WebSphere Application Server 跟踪日志 (trace.log)
输出Q表格分析视?
支持Q按原样提供Q但目前是其所在领域的主要工具?/p>
采用启发式分析引擎来帮助您解决与 Java Database Connectivity (JDBC) q接池相关的问题Qƈ诊断 JDBC q接泄露。此工具分析 JDBC q接池管理器跟踪Qƈ提供以下功能Q?/p>
输入QJDBC 跟踪日志
输出Q日志的表格和图形分?
支持Q按原样提供Q但目前是该领域的主要工兗?/p>
用于静态配|文件和相关信息的工?/h2>
?3. 与静态配|相关的文g
构gcd 问题cd 典型输入 可用的工?/th> 来自多个产品的配|文?/td>
WebSphere Application Server http 插g配置文g
WebSphere Application Server 配置Q从q行时中dQ无直接可见的文Ӟ
WebSphere Application Server cd载器配置Q从q行时中dQ无直接可见的文Ӟ
WebSphere 产品安装
多个产品配置和运行时|络状?/td>
提供一U可视化、探索和分析不同来源的配|信息的ҎQ例?WebSphere Application Server、WebSphere MQ ?DB2。此工具允许您:
输入Q从 VCE 附带?VCE q程攉器工具中产生?JAR 文g
输出Q配|的囑Ş描述。配|的差异报告Q保存ؓ XML 格式Q?
其他功能Q能够保存配|,以帮助其他支持工E师q行q一步的分析。提供了配套?Symptom Editor 工具来创建您自己的症状数据库?
支持Q技术预览版Q但它是其所在领域的主要工具?/p>
帮助发现?WebSphere Application Server ?HTTP 插glg相关的潜在问题。此工具同时分析插g配置和对应的跟踪文gQ然后应用模式识别算法,以便向用户发出有兛_能的不一致性的警报。此工具提供配置和跟t文件中? HTTP q回代码列表、URI 和可用集的囑Ş表示形式Q以及服务器拓扑?/p>
输入QWebSphere 插g日志文g (http_plugin.log) ?WebSphere Application Server 跟踪文g (trace.log)?
输出Q显C? plugin-cfg.xml 文g?trace.log 分析中的集群和成员拓扑的可视映射?
支持Q按原样提供Q但目前是其所在领域中的主要工兗?/p>
此工h WebSphere 理控制台的一部分Q它帮助定和查? WebSphere Application Server 中的当前配置中存在的问题?/p>
输入Q操? WebSphere Application Server 的某个运行实例,可通过理控制台进行访问?
输出Q配|问题的表格视图Q单独的错误、警告选项Q管理控制台中可用的信息Q?
支持Q包括ؓ WebSphere Application Server 的一部分Q服从与M品相同的支持程?/p>
提供 WebSphere Application Server 的某个实例中当前zd的所有类加蝲器和它们已加载的所有类的详l清单。这可以帮助诊断一pd与类加蝲相关的问题,例如未能加蝲所需的类、加载了某个cȝ意外版本、多个类之间的可见性问题,{等?/p>
输入Q操? WebSphere Application Server 的某个运行实例,可通过理控制台进行访问?
输出QWebSphere Application Server 理控制C的树形细分视图;可保存到文g以便以后分析?
支持Q包括ؓ WebSphere Application Server 的一部分Q服从与M品相同的支持程?/p>
作ؓ一个在 WebSphere Application Server 中可用的名ؓ“installver”的程序来交付Q此E序Ҏ成当?WebSphere Application Server 安装的文件执行校验和Qƈ校验和?WebSphere Application Server 附带或在该工具以前的执行q程中生成的参考文件做比较。此工具帮助被破坏的安装,例如Q可能安装了修改或修补程序然后却遗忘了?/p>
输入QWebSphere Application Server 文gQ?verifyinstallver.bat ?.sh q行该工兗?
输出Q指C成功的文g查的消息?
支持Q包括ؓ WebSphere Application Server 的一部分Q服从与M品相同的支持程?/p>
在品的安装、配|或Ȁz过E中扫描可用的端口,以帮助防止端口冲H?/p>
输入Q要查的端口可?
输出Q列ZQ何正在用的端口和Q何可能的冲突的报?
支持Q技术预览版Q但目前是其所在领域的主要工具?/p>
ȝ
理解WAS 6.1的类加蝲Q?Q?/h2>
讄委托模式为PARENT_LASTQ用如下步骤:
Node02Cell\ClassloaderExample.ear\ClassloaderExampleWeb.war
Assuming you are familiar with the basic concepts of XMLAccess, the following refinements to the process should be straightforward. Instead of taking a full export from your production environment, suppose you wish to only export the portlets? In XMLAccess, the portlet is represented by the object type "web-app." Naturally you could generate an export of the portlets using the following XML (which is included in the samples shipped with Portal):
<?xml version="1.0" encoding="UTF-8"?>
<request xmlns:xsi=" <portal action="locate">
<web-app action="export"
objectid="*"/>
</portal>
</request>
By importing this xml file, we direct the portal to export only the web-app object called '*' which is a wildcard for all web-apps. The command would be as follows:
xmlaccess.bat -in C:\temp\export_all_portlets.xml -user wpsadmin -pwd wpsadminpwd -url http://portal.example.com/wps/config -out C:\temp\outputfile_all_portlets.xml
Right, so very easy. However, this sort of thing is useful only if we already have a portal configured with all of the portlets. If we're exporting all "web-app" objects, this assumes we have some to export in the first place. Suppose you have 50 new portlets that all need to be installed, but you have no existing portal that has all of them in place. Are you going to use the portal admin interface and click-click-click your way through installing 50 portlets, assigning permissions, creating pages, putting the portlets on the pages, etc. etc. etc.? Probably not - at least, I know I wouldn't.
How can we use XMLAccess to build a portal configuration if we are deploying portal elements for the very first time? This task won't involve exporting a config from somewhere, since we don't have things configured in any environment yet. Instead we're going to construct our XML files from scratch and import them into a blank portal in order to build our configuration.
The various XML files referred to from this point forward are printed at the end of this article.
The Blank Portal
When installing WPS, it is often desirable to deploy the portal without the sample pages and labels and portlets; it is simply too much clutter. To install a blank portal, use the following command when invoking the installation program:
install.bat -W installPortlets Sequence.active="false"
Proceed through the portal install sequence as you normally would. When complete, start the portal and go the portal home page. You should now see the blank portal.
Before continuing, be sure to have all of your necessary files in place. That is, if you are installing a theme, place the folder containing the theme on the PortalServer in the correct location. The same goes for skins, portlet WARs, etc.
Theme folders go into:
C:\WebSphere\AppServer\installedApps\<nodename>\wps.ear\wps.war\themes\html\
Skin folders go into:
C:\WebSphere\AppServer\installedApps\<nodename>\wps.ear\wps.war\skins\html\
By default, portlet WAR files need to be placed in:
C:\WebSphere\PortalServer\installableApps
With our blank portal installed, and with our component files in place, let's begin constructing our new portal. We'll start with the skins and themes.
Install Skins and Themes
The XML to install the theme will of course include the standard XML header for WPS 5.1. After that, we will do the required locate action on the "portal" object. After this we will instruct XMLAccess to perform an "update" on our skin with the parameters that we specify as show in Listing 1.
The skin object we specified includes the objectid, uniquename, and resourceroot parameters. Objectid will be the skin's referential id within the portal database. For ease of use, we also have a uniquename specified for this skin so that we can easily refer to the skin from this point forward. The resourceroot indicates the case-sensitive folder name of our skin that we placed in the skins\html\ directory.
Let's save this file as import_skins.xml. Once we import this file, we will have installed the skins into our portal:
xmlaccess.bat -in C:\temp\import_skins.xml -user wpsadmin -pwd wpsadminpwd -url http://portal.example.com/wps/config
To install our themes, we need an XML file with similar information
Since a theme has default and allowed skins assigned to it, we first have to find these skins before we can assign them to the theme. So we do a 'locate' on our two skins that were added in Listing 1. Once we find them, we perform an "update" on the theme object.
The update uses defaultskinref to define the default skin for the theme. For the first theme, we used Skin_A as the default skin. The objectid and uniquename for the theme are defined (and can be different, as indicated). The resourceroot is the case-sensitive folder name of the themes\html\ directory.
Notice that in addition to defining the default skin for each theme, we can also define the other skins that can be used with this theme. Notice that for Theme_Blue we are using Skin_A as the default, but we allow Skin_A as well as Skin_B. This is defined in the <allowed-skin skin="..."> section. Notice that for Theme_Green we are using Skin_B as the default and we only allow that skin. After all, Skin_A is red. Mixing a red skin with a green theme is just plain ugly.
Now let's save the xml file as import_themes.xml and import our themes into the portal configuration:
xmlaccess.bat -in C:\temp\import_themes.xml -user wpsadmin -pwd wpsadminpwd -url http://portal.example.com/wps/config
Install Portlets
We have our themes and skins imported, now let's put those pesky portlets in place.
Constructing the XML file for portlet install is a little trickier. It involves knowing some key information about the portlets. This information is found in the portlet.xml and web.xml inside the portlet.war file. For this step Winzip is especially useful, as you will need to be able to open the portlet WAR file (see Listing 3). You may also be able to get this info from the portlet developer. After all, he can see this info in his portal toolkit inside WebSphere Studio. However, developers being as busy as they usually are, good luck extracting this info from them.
Okay. This is slightly more complex. Here we have 3 portlets that we're installing. You can see we're locating the portal (of course), and then we do an update on object "web-app" which represents the WAR file.
The next parameter is the web-app uid parameter. The uid must match the uid attribute of portlet-app in portlet.xml in the portlet WAR file.
Following the uid, we have to specify the location of the portlet WAR file. When we transferred our portlet WARs to the server, we placed them in C:\WebSphere\PortalServer\installableApps. To refer to this location, we can use the $server_root$ variable which gets set when the XMLAccess interface is invoked.
Next, we have to perform an update on the portlet-app object. This represents the portlet application and is the parent of all the portlets contained within. The next parameter is the portlet-app uid parameter. The uid must match the uid attribute of concrete-portlet-app in portlet.xml in the portlet WAR file.
Finally we have the update to be performed on each portlet in the portlet application. In this example we only have one portlet in each WAR file, but we could potentially have several in each one. If this were the case, we'd have multiple "portal" objects defined within the "portal-app" object. We give the portlet an objectid and we define the name. The portlet name parameter must match the content of the portlet-name subtag of concrete-portlet in portlet.xml in the portlet WAR file.
So let's go ahead and save the xml file as import_portlets.xml and execute:
xmlaccess.bat -in C:\temp\import_portlets.xml -user wpsadmin -pwd wpsadminpwd -url http://portal.example.com/wps/config
We should now have deployed skins, themes, and portlets. Let's create a page and drop some portlets on it.
Create Pages
This is very straightforward. We need pages on which to place our portlets. Pages and labels are represented in the XML files as "content-node." Seems pretty logical if you think about it. A node of content. A content-node. Brilliant.
Our XML will look like Listing 4. Think of it logically. We first locate the resources we need (themes, portlets) and then we create our pages using those resources. Piece of cake. In this example, we'll create a label in the Content Root called Home (Content Root is the highest node of the content hierarchy. It exists by default). Hanging off this label is a single page called Welcome. On this Welcome page is single row containing our portlet, PortletCharlie.
You can see that we start off by locating the necessary resources - first the theme, Theme_Blue and then the portlet, PortletCharlie. Finally we have to locate the Content Root.
The next step in the process is to create the Home label. We give it an objectid and a uniquename. We define the content-parentref to be this label's immediate parent. In our case, this is the objectid of Content Root. Because we're creating a label at this point and not a page, we can assign a theme to the label. So we define themeref to be Theme_Blue.
Once created, we must immediately "locate" the new label before it can be used in the rest of the XML file. Next, we want to create the page called Welcome that is on the label called Home. You can see the values we use to define this page. With a page, however, we can also define the columns and rows containers that compose the structure of a portal page. Within these containers, we place the portlets.
The rows and columns on the page are defined in the "component" section in that page. In this example, within the page definition for the content-node Welcome, we define a component with an orientation of "H," which stands for horizontal, which is therefore a row. Setting the orientation to "V" would of course create a column. Rows can contain columns and vice versa. Tweaking these settings is how you could create an incredibly complex nested row/column page structure, if you so chose.
There are other parameters you can tinker with. Changing "ordinal" will change the order in which this content-node appears (since we only have one content-node at this level, it doesn't matter, but if we had a whole row of pages on the toolbar, we could order them using the ordinal parameter). Setting the "active" parameter to false would de-activate this content-node; and on and on...
<component action="update" active="true" objectid="container1" ordinal="-1" orientation="H" type="container" width="300">
<portletinstance action="update" handle="" objectid="portletinstance1"portletref="Portlet_Charlie"></portletinstance>
</component>
Inside the component definition for the row on our page, you can see that we have put a portletinstance object with portletref set to Portlet_Charlie. This value must match the uid of the portlet that you wish to put in this container.
So here it is. Let's save this file as import_pages.xml and execute:
xmlaccess.bat -in C:\temp\import_pages.xml -user wpsadmin -pwd wpsadminpwd -url http://portal.example.com/wps/config
Once our import is complete, fire up a browser and go check out your brand new portal! Wunderbar! You should see your label with a page that has a portlet on it. Experiment.
Of course you can also go further and assign permissions to your objects using XML, or you could create XML files to remove portlets but leave the pages and so forth and so on.
Make liberal use of the example files in C:\WebSphere\PortalServer\doc\xml-samples, or the InfoCenter documents regarding XML Access. These pages are currently located at http://publib.boulder.ibm.com/infocenter/wp51help/topic/com.ibm.wp.ent.doc/wps/admxmlai.html.
下面是两个javadJKS文g中密钥的Ҏ
当然在看懂下面两个方法之前要对JKS文g的结构有所了解Q?/p>
JKS文g好像一个仓库,里面可以攑־多的东西Q这里只存放一cM西就是密钥,仓库当然会有一把锁Q防范别人随便ؕ拿,q个是JKS文g的密码。里面存攄密钥也各有不同,每个密钥都有一个名字(在下面叫别名Q,一cd密钥对,一cd公钥Q一cdU钥Q密钥对是包含公钥和私钥的。这里的公钥只要你能q入仓库你就可以随便查看拿走Q私钥则是有密码的,只允许有权限的h查看拿走。所以在下面d密钥时也有点细微的不同之处Q对于读取公钥只需要知道JKS文gQ仓库)的密码就可以了,但是在读取私钥时则必LU钥的密码也是你必要有权限,在下面你会发玎ͼ在读取私钥时多了一个参敎ͼ对应的就是私钥的密码?/p>
WebSphere Application Server V6.1 for Windows
was.cd.6100.trial.base.windows.ia32.zip (518.6MB)
以下下蝲均需IBM 官方账号登陆
IBM Download directorQ?/p>
Download director is required when downloading Common Criteria certified products.
HTTP 下蝲Q?/p>
本文假设读者对WEB和portal及portlet有基本的了解?/p>
一、开发环?/p>
RAD 7.5 + Websphere Portal Server 7.0
二、开发目?/p>
开发一个地址薄,用来记录姓名和地址?/p>
三、开发过E?/p>
1. 创徏一个portlet目
选择File->New->Portlet ProjectQ弹出如下所C的对话框:
输入或选择以上信息后,单击Next按钮Q弹出如下所C的界面Q?/p>
为简便v见,只选择了view和edit两个模式。l点击Next按钮弹出如下界面Q?/p>
取消W一个复选按钮的默认选择Q点击Finish按钮完成目的创建?/p>
目创徏完成后,目中会生成如下4个关键文Ӟ
AddressBookPortlet.java是portlet的处理文Ӟ
AddressBookPortletEdit.jsp对应portlet的编辑状态;
AddressBookPortletView.jsp对应portlet的视囄态;
portlet.xml是portlet的部|描q文件?/p>
2. 增加姓名地址信息
修改~辑模式所对应的AddressBookPortletEdit.jsp文gQ提供用戯入界面?/p>
修改AddressBookPortlet.java中的processActionҎQ?br />
~辑界面提交的姓名和地址作ؓ名称/值对的Ş式保存在PortletPreferences对象中?/p>
response.setPortletMode(PortletMode.VIEW)表示处理完edit模式后迁Udview模式以显C最新的地址信息?/p>
3. 昄地址薄中的名U地址信息
׃名称/地址信息已经保存在PortletPreferences对象中,因此只需要从该对象中取出所有的名称/地址信息q显C出来即可。修改AddressBookPortletView.jspQ?/p>
4. 部v
启动PortServerQ可能需要较长的旉?/p>
选中服务器WebSphere Portal V7.0 at localhostQ弹出如下所C的菜单Q?/p>
点击Add and Remove Projects…Q弹出如下所C的界面Q?/p>
AddressBookPortletEARd到右边列表框中。点击Finish按钮完成部v?/p>
5. q行
从浏览器地址栏输入URLQ?a href="http://localhost:10039/wps/myportal">http://localhost:10039/wps/myportalQ输入用户名和密码后q入如下所C的界面Q?/p>
点击该portlet所在页面右上角处(用蓝色椭圆标ZQ,弹出菜单Q如下图所C:
点击个性化菜单条,弹出增加地址界面Q?/p>
输入姓名和地址Q点M存按钮,则蟩转到昄面Q?/p>
xQ一个具有地址功能的portlet开发部|完成,在以后的portal面中就可以使用该portlet了?/p>