4141from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_kEYSTORE_PROPERTY
4242from wlsdeploy .aliases .model_constants import JDBC_DRIVER_PARAMS_PROPERTIES
4343from wlsdeploy .aliases .model_constants import JDBC_SYSTEM_RESOURCE
44+ from wlsdeploy .aliases .model_constants import LISTEN_PORT
4445from wlsdeploy .aliases .model_constants import LOG_FILTER
4546from wlsdeploy .aliases .model_constants import MACHINE
4647from wlsdeploy .aliases .model_constants import MIGRATABLE_TARGET
@@ -819,10 +820,12 @@ def __create_machines_clusters_and_servers(self, delete_now=True):
819820 # Now, fully populate the ServerTemplates, if any.
820821 #
821822 server_template_nodes = dictionary_utils .get_dictionary_element (self ._topology , SERVER_TEMPLATE )
823+
822824 if len (server_template_nodes ) > 0 :
823825 self ._create_named_mbeans (SERVER_TEMPLATE , server_template_nodes , location , log_created = True ,
824826 delete_now = delete_now )
825827
828+
826829 #
827830 # Finally, create/update the servers.
828831 #
@@ -832,6 +835,20 @@ def __create_machines_clusters_and_servers(self, delete_now=True):
832835 if len (server_nodes ) > 0 :
833836 self ._create_named_mbeans (SERVER , server_nodes , location , log_created = True , delete_now = delete_now )
834837
838+ # Work around for bug in WLST where Server Template Listen Port must be set after Server
839+ # Listen Port for 7001 in order to show up in the config.xml
840+ if len (server_template_nodes ) > 0 :
841+ for template in server_template_nodes :
842+ listen_port = dictionary_utils .get_dictionary_element (self ._topology [SERVER_TEMPLATE ][template ], LISTEN_PORT )
843+ if listen_port is not None :
844+ temp_loc = LocationContext ()
845+ temp_loc .append_location (SERVER_TEMPLATE )
846+ temp_loc .add_name_token (self .aliases .get_name_token (temp_loc ), template )
847+ attribute_path = self .aliases .get_wlst_attributes_path (temp_loc )
848+
849+ self .wlst_helper .cd (attribute_path )
850+ self ._set_attribute (temp_loc , LISTEN_PORT , listen_port , [])
851+
835852 self .__create_migratable_targets (location , delete_now = delete_now )
836853
837854 self .logger .exiting (class_name = self .__class_name , method_name = _method_name )
0 commit comments