下面是调试过程中可能出现的问题和应对技巧:
- 跟踪属性
如果您不能确定组件未接受属性更改的原因,可以使用 Property Broker 跟踪命令 pbt 来跟踪那个属性。此命令将向控制台和日志打印调试信息,实际上也就是跟踪所更改的属性的路径。如果没有显示任何输出,那么可能是键入了错误的属性名,也有可能是源组件从未发布过该属性,例如:osgi> pbt mypropery
osgi> pbt “my property with spaces” - 连接不工作
如果组件似乎没有工作或没有接受任何属性更改,那么请确保启用了连接和操作。可以使用 pbsh w 命令来显示所有活动的连接,使用 pbsh aa 命令来显示所有活动的操作。 - 您的 WSDL 注册
使用属性和操作的基本显示命令来确保正确地向 Property Broker 注册了 WSDL 文件。pbsh p和pbsh p <owner>命令会列出所有已注册的属性。对于操作,可以使用 pbsh a 命令来获取所有已注册操作的列表。
您可能拥有很多 WebSphere Portal 应用程序,每个应用程序中可能有很多页面,而每个页面中又可能有很多组件。客户端拓扑管理器从 WebSphere Portal 获取复合应用程序 XML,并动态地为 Eclipse 创建透视图、布局及视图。拓扑处理程序还提供了透视图和视图的数据模型,并将 Eclipse 活动关联到页面。
下面是可用于调试的 OSGi 命令列表(回想一下,通过在 OSGi 控制台键入 help 也可以显示该列表):
清单 3. 用于调试的 OSGi 命令
---Topology Handler UI Commands--- thuish desc - Show all Perspective Descriptors thuish del <perspective id> - Delete a Perspective Descriptor thuish lp Show all Launcher Item IDs thuish cd Show Current Perspective Descriptor thuish ea Show Current Enabled Activities thuish a <activity id> Show Activity State
---Topology Handler Commands--- thsh n - Show all navigation elements thsh p - Show all Pages thsh l - Show all Labels thsh f - Show all topology files thsh apps - Show all application GUIDs thsh e <namespace> - Show all registered extensions under the given namespace thsh dp - Show all dirty pages thsh nattr <navigation id> - Show all navigation preferences
