【问题标题】:wsadmin with jython script gives error AttributeError: 'javapackage' object has no attribute 'SEC_SEGMENT'带有 jython 脚本的 wsadmin 给出错误 AttributeError: 'javapackage' object has no attribute 'SEC_SEGMENT'
【发布时间】:2020-07-27 23:26:56
【问题描述】:

我正在使用 wsadmin 命令运行 jython 脚本。它运行良好,直到在新的 unix 环境中,它停止工作并出现以下错误:

AttributeError: 'javapackage' object has no attribute 'SEC_SEGMENT'

我的测试脚本如下所示:

 #!/usr/bin/python

 properties_file_path=sys.argv[0]
 sys.path.append(properties_file_path)

 import config
 import ast
 import datetime

 start_time=datetime.datetime.now().strftime('%H:%M:%S.%f')[:-3]
 print(start_time+"-Starting execution of script test.py")

 new_domain=config.SEC_SEGMENT['new_domain']
 print("new domain: "+new_domain)

我的配置属性,config.py:

 SEC_SEGMENT = {
    'new_domain': 'Domain2',# New Security Domain
 }

在其他环境中它工作正常。是图书馆的问题吗?

【问题讨论】:

    标签: jython wsadmin


    【解决方案1】:

    问题已解决。在同一父目录下,有一个与属性文件 'config.py' 同名的文件夹。 由于文件的这种命名冲突,出现了上述问题。通过重命名“config”文件夹解决了问题

    【讨论】:

      猜你喜欢
      • 2021-07-25
      • 2015-09-26
      • 2021-04-09
      • 1970-01-01
      • 2022-12-01
      • 2023-02-18
      • 2022-12-03
      • 2017-03-08
      • 1970-01-01
      相关资源
      最近更新 更多