wlst.creatCluster: [wlst] <WLSTTask> Adding test1 to sys.argv [wlst] <WLSTTask> sys.argv is ['wlst/createCluster.py', 'test1'] [wlst] <WLSTTask> The script that will be executed [wlst] Exiting WebLogic Scripting Tool. BUILD FAILED F:work_topfounderworkspacecallcenteruild-wls.xml:185: Traceback (innermost last): File "wlstcreateCluster.py", line 127, in ? File "<iostream>", line 46, in exit org.eclipse.ant.internal.ui.antsupport.AntSecurityException at org.eclipse.ant.internal.ui.antsupport.AntSecurityManager.checkExit(AntSecurityManager.java:54) at java.lang.Runtime.exit(Runtime.java:88) at java.lang.System.exit(System.java:868) at weblogic.management.scripting.WLScriptContext.exit(WLScriptContext.java:579) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:160) at org.python.core.PyMethod.__call__(PyMethod.java:96) at org.python.core.PyObject.__call__(PyObject.java:283) at org.python.core.PyObject.invoke(PyObject.java:2055) at org.python.pycode._pyx6.exit$3(<iostream>:46) at org.python.pycode._pyx6.call_function(<iostream>) at org.python.core.PyTableCode.call(PyTableCode.java:208) at org.python.core.PyTableCode.call(PyTableCode.java:404) at org.python.core.PyTableCode.call(PyTableCode.java:253) at org.python.core.PyFunction.__call__(PyFunction.java:169) at org.python.pycode._pyx16.f$0(wlstcreateCluster.py:127) at org.python.pycode._pyx16.call_function(wlstcreateCluster.py) at org.python.core.PyTableCode.call(PyTableCode.java:208) at org.python.core.PyCode.call(PyCode.java:14) at org.python.core.Py.runCode(Py.java:1135) at org.python.core.__builtin__.execfile_flags(__builtin__.java:308) at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:158) at weblogic.management.scripting.utils.WLSTInterpreter.execfile(WLSTInterpreter.java:305) at weblogic.ant.taskdefs.management.WLSTTask.execute(WLSTTask.java:108) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) at org.apache.tools.ant.Task.perform(Task.java:364) at org.apache.tools.ant.Target.execute(Target.java:341) at org.apache.tools.ant.Target.performTasks(Target.java:369) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216) at org.apache.tools.ant.Project.executeTarget(Project.java:1185) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40) at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32) at org.apache.tools.ant.Project.executeTargets(Project.java:1068) at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423) at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137) org.eclipse.ant.internal.ui.antsupport.AntSecurityException: org.eclipse.ant.internal.ui.antsupport.AntSecurityException
createCluster.py
#======================================================================================= # This is an example of a WLST offline configuration script. This example demonstrates # how to create a single-cluster domain. This sample is based on the Basic WebLogic # Server Domain template. # # Please note that many values used in this script are subject to change based # on your WebLogic installation and the template you are using. # # Usage: # wlst createcluster.py <domain name> # #======================================================================================= import string #======================================================================================= # Open a domain template. #======================================================================================= template=wlsHome +'/common/templates/domains/'+ domainTemplate readTemplate(template) #======================================================================================= # Configure the Administration Server and SSL port. #======================================================================================= cd('Servers/AdminServer') set('ListenAddress','') set('ListenPort', 7001) create('AdminServer','SSL') cd('SSL/AdminServer') set('Enabled', 'True') set('ListenPort', 7002) #======================================================================================= # Define the password for user weblogic. You must define the password before you # can write the domain. #======================================================================================= cd('/') cd('Security/base_domain/User/weblogic') cmo.setPassword('weblogic') #======================================================================================= # Set Options: # - CreateStartMenu: Enable creation of Start Menu shortcut. # - ServerStartMode: Set mode to development. # - JavaHome: Sets home directory for the JVM used when starting the server. # - OverwriteDomain: Overwrites domain, when saving, if one exists. #======================================================================================= setOption('CreateStartMenu', 'false') setOption('ServerStartMode', 'dev') setOption('JavaHome',javaHome) setOption('OverwriteDomain', 'true') #======================================================================================= # Write the domain and close the domain template. #======================================================================================= writeDomain(beaHome +'/user_projects/domains/'+ domainName) closeTemplate() #======================================================================================= # Reopen the domain. #======================================================================================= readDomain(beaHome +'/user_projects/domains/'+ domainName) #======================================================================================= # Create three Managed Servers and configure them. # # Migratable servers, which provide for both automatic and manual migration # at the server-level, are created automatically when you create the Managed Servers. #======================================================================================= # 受管服务器的列表,若需要修改修改服务数量,可以修改这个变量,注意不可以重名 mServers ='ms1', 'ms2', 'ms3' startPort =8001 for mServer in mServers: cd('/') create(mServer, 'Server') cd('Server/'+mServer) set('ListenPort', startPort) startPort +=10 set('ListenAddress', 'localhost') #======================================================================================= # Create and configure a cluster and assign the Managed Servers to that cluster. #======================================================================================= clusterName ='wlsCluster' cd('/') create(clusterName, 'Cluster') assign('Server', string.join(mServers,','), 'Cluster', clusterName) cd('Clusters/'+clusterName) set('MulticastAddress', '237.0.0.101') set('MulticastPort', 9200) set('WeblogicPluginEnabled', 'true') #======================================================================================= # Write the domain and close the domain template. #======================================================================================= updateDomain() closeDomain() #======================================================================================= # Exit WLST. #======================================================================================= exit()