【问题标题】:Weblogic domain creating using wlst scripts使用 wlst 脚本创建 Weblogic 域
【发布时间】:2021-09-23 09:14:50
【问题描述】:

我正在尝试通过脚本创建一个 weblogic 域。当我使用 config.sh 向导创建它时,它可以正常运行。但是,在尝试使用 WLST 时,我收到了一个错误:

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

wls:/offline> selectTemplate('Basic WebLogic Server Domain','12.2.1.1')
Error: selectTemplate() failed. Do dumpStack() to see details.
Error: No domain or domain template has been read.
wls:/offline>selectTemplate('Oracle Service Bus Reference Configuration', '12.2.1.4.0')
wls:/offline/>loadTemplates()
wls:/offline/base_domain>
wls:/offline/base_domain>cd('Servers/AdminServer')
wls:/offline/base_domain/Server/AdminServer>set('ListenAddress','')
wls:/offline/base_domain/Server/AdminServer>set('ListenPort', 7001)
wls:/offline/base_domain/Server/AdminServer>
wls:/offline/base_domain/Server/AdminServer>create('AdminServer','SSL')
Proxy for AdminServer: Name=AdminServer, Type=SSL
wls:/offline/base_domain/Server/AdminServer>cd('SSL/AdminServer')
wls:/offline/base_domain/Server/AdminServer/SSL/AdminServer>set('Enabled', 'False')
wls:/offline/base_domain/Server/AdminServer/SSL/AdminServer>set('ListenPort', 7002)
wls:/offline/base_domain/Server/AdminServer/SSL/AdminServer>
wls:/offline/base_domain/Server/AdminServer/SSL/AdminServer>cd('/')
wls:/offline/base_domain>
wls:/offline/base_domain>cd('Security/base_domain/User/weblogic')
wls:/offline/base_domain/Security/base_domain/User/weblogic>cmo.setPassword('weblogic123')
wls:/offline/base_domain/Security/base_domain/User/weblogic>writeDomain('/home/oracle/12.2.1/user_projects/domains/osb25_domain')
com.oracle.cie.domain.script.ScriptException: 64254: Error occurred in "OPSS Processing" phase execution
64254: Encountered error: oracle.security.opss.tools.lifecycle.LifecycleException: JDBC password for opss-audit-DBDS is missing for configuring security store to database.

有没有人有在 12.2 上使用 OSB 创建域的示例脚本?

@编辑: 更新模板后,像这样:

selectTemplate('Basic WebLogic Server Domain', '12.2.1.3.0')
selectTemplate('Oracle Service Bus Reference Configuration', '12.2.1.4.0')
loadTemplates()

我想知道如何指定他们要求的密码?有什么建议吗?

我明白了:

com.oracle.cie.domain.script.ScriptException: 64254: Error occurred in "OPSS Processing" phase execution
64254: Encountered error: oracle.security.opss.tools.lifecycle.LifecycleException: JDBC password for opss-audit-DBDS is missing for configuring security store to database.

老实说,我不觉得文档很有用。 https://docs.oracle.com/middleware/1221/wls/WLSTG/domains.htm#WLSTG406

【问题讨论】:

  • 使用以下命令检查模板是否可用:showAvailableTemplates('false','true','false')
  • 您为 WebLogic 使用 12.2.1.1 模板,但为 OSB 使用 12.2.1.4。
  • 嗨,我检查了可用的模板,但同样的错误 Basic WebLogic Server Domain:12.2.1.3.0 Oracle Service Bus Reference Configuration:12.2.1.4.0\n Oracle Enterprise Manager:12.2.1.3。 0\n ODSI XQuery 2004 组件:12.1.3.0\n Oracle WSM 策略管理器:12.2.1.3\n Oracle JRF:12.2.1.3.0\n WebLogic Coherence 集群扩展:12.2.1.3.0\n Insight:12.2.1.3 .0\n Oracle 业务活动监控:12.2.1.3.0\n Oracle B2B 客户端:12.2.1.3.0\n Oracle Enterprise Manager Plugin for ESS:12.2.1.3.0\n Oracle Enterprise Manager-Restricted JRF:12.2。 1.3.0\n Oracle API 管理器:12.2.1.4.0\n ...
  • 所以你应该从 selectTemplate('Basic WebLogic Server Domain','12.2.1.3.0')开始
  • 本文档一般是关于 WLST 的,不提供有关 OSB 域创建的信息。无论如何,使用 WLST 创建 OSB 域有点棘手。

标签: weblogic weblogic12c osb wlst


【解决方案1】:

当您启动 jdeveloper 并打开“应用程序服务器”窗格并首次启动 IntegratedWebLogicServer 时,jdeveloper 将为您创建一个 OSB 域,当它这样做时,它会在您的 $JDEV_USER_DIR/system12 下生成一个 wlst 脚本。 2.1.....文件夹。该 wlst 脚本可以保存并重复使用。

我得到了这个我自定义的脚本,现在我可以在需要时重新使用它来重新创建一个 OSB 域...

#===========================================================================
# Create osb domain for JDeveloper application development 
# runtime.
#
# The script creates a default osb domain.  
# The default domain consists of a single server, 
# representing a typical development environment.  This type of configuration 
# is not recommended for production environments.
#===========================================================================

import os

if not 'JDEV_USER_DIR' in os.environ:
  print("Error:  JDEV_USER_DIR environment variable not set.")
  exit()
  
if not 'ORACLE_HOME' in os.environ:
  print("Error:  ORACLE_HOME environment variable not set.")
  exit()  
  
print("Creating Default Domain")

#%%%VARIABLE_ASSIGNMENTS%%%

templateFile =  'Basic WebLogic Server Domain'
targetDomain =  os.environ['JDEV_USER_DIR'] + '/system12.2.1.4.42.190911.2248/DefaultDomain/'
serverName =    'DefaultServer'
domainAdmin =   'weblogic'
domainPassword = 'welcome1'
listenAddress = ''
listenPort =    '7001'
sslListenPort = '7002'
cfgGrpProfile = 'Compact'
jdevHome = os.environ['ORACLE_HOME'] + '/jdeveloper/'
commonComponentsHome = os.environ['ORACLE_HOME'] + '/oracle_common/'


#===========================================================================
# Open a domain template.
#===========================================================================

print("[progress] Reading template: " + templateFile);
setTopologyProfile(cfgGrpProfile)
selectTemplate(templateFile)
loadTemplates()

#===========================================================================
# Configure the domain
#===========================================================================

#%%%BASE_DOMAIN_CONFIGURE_START%%%
cd('Servers/AdminServer')

print('Setting Name to \'' + serverName + '\'')
set('Name', serverName)

print('Setting ListenAddress to \'' + listenAddress + '\'')
set('ListenAddress', listenAddress)

print('Setting ListenPort to ' + listenPort)
set('ListenPort', int(listenPort))

set('TunnelingEnabled', 1)

cd('/Servers/' + serverName)
create (serverName, 'SSL')
cd('SSL/' + serverName)

print('Enabling SSL using port ' + sslListenPort)
set('Enabled' , 'true')
set('ListenPort', int(sslListenPort))

set('ClientCertificateEnforced', 'false')
set('TwoWaySSLEnabled', 'true')

cd('/')
cd('Security/base_domain/User/weblogic')

print('Setting domain administrator to \'' + domainAdmin + '\'')
cmo.setName(domainAdmin)

print('Setting domain password.')
cmo.setPassword(domainPassword)
#%%%BASE_DOMAIN_CONFIGURE_END%%%

#===========================================================================
# Write the domain and close the domain template.
#===========================================================================

setOption('OverwriteDomain', 'true')

print("[progress] Writing domain: " + targetDomain);
writeDomain(targetDomain)

print("[progress] Closing template.")
closeTemplate()

#===========================================================================
# Set environment variables used by extension templates.
#===========================================================================
os.putenv('JDEV_HOME', jdevHome)
os.putenv('COMMON_COMPONENTS_HOME', commonComponentsHome)
os.putenv('DOMAIN_HOME', targetDomain)

#===========================================================================
# Extend the domain
#===========================================================================

#%%%DOMAIN_EXTENSION_TEMPLATES_DECLARTION%%%
templates = \
[
  ["Oracle ADRS", None],
  ["Oracle JRF", None],
  ["Oracle WSM Policy Manager", None],
  ["Oracle ADF Development Mode Logging", None],
  ["Oracle Service Bus", None]
]

try:
  if len(templates) > 0:

#%%%START_TEMPLATE_LOOP%%%
    for t in templates:
      print("[progress] Reading domain: " + targetDomain)
      readDomain(targetDomain);
      print("[progress] Adding domain extension template: " + t[0] + " " + (t[1] or "") )
      if t[1] is None:
        selectTemplate(t[0])
      else:
        selectTemplate(t[0], t[1])
      loadTemplates()
      print("[progress] Updating domain.")
      updateDomain()
      print("[progress] Closing domain.")
      closeDomain()
#%%%END_TEMPLATE_LOOP%%%

except:
  dumpStack()
  raise
  
print("*** Domain processing complete ***");  
  

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多