【问题标题】:Displaying all native paths for the shared Library显示共享库的所有本机路径
【发布时间】:2025-12-25 03:35:06
【问题描述】:

我想使用 jython 脚本访问共享库本机路径

libraries = AdminConfig.list('Library').split('\n')

这会返回一个库列表。

在库.xml 中

<libraries:Library xmi:id="Library_1443450998699" name="MY_TOOLKIT" description="AMY_TOOLKIT" isolatedClassLoader="false">
    <classPath>MY_TOOLKIT</classPath>
    <nativePath>/mypath_TOOLKIT/lib/path.jar</nativePath>

我想访问每个库的本地路径..

我怎样才能做到这一点..任何帮助..提前谢谢

【问题讨论】:

  • 查看 XML 数据抓取,这是一个非常简单的 Python 内置过程。 *.com/questions/1912434/… 可能会有所帮助。你也可以使用正则表达式,这样会更简单
  • @RNar 直接访问 WebSphere Application Server 的 XML 配置可能可行,但不建议这样做。

标签: python xml python-2.7 websphere jython


【解决方案1】:

迭代从list/split 返回的值并使用AdminConfig.showAttribute(lib, "nativePath")。有关其他 AdminConfig 操作,请参阅知识中心中的 Commands for the AdminConfig object using wsadmin scripting 主题。

【讨论】: