Using weblogic.WLST to create userConfigFile and userConfigKey

Weblogic provide script tool to create userConfigFile and userConfigKey, that encrypt the current user login and password, can be used by auto_deploy tools.

1. Set domain variable:

 cd ${DOMAIN_HOME}/bin
 source setDomainEnv.sh
 

2. Invoke WLST:

java weblogic.WLST
    

3. Generate user config and user key

 connect(<admin_username>,<admin_password>,<admin_url>)

 eg.

connect('weblogic','weblogic1','t3://localhost:7101')

 Note:

  • all parameters enclosed by single quotes(' ') 
  • should be use t3 protocol

 4. Store the user information

   storeUserConfig(<location_of_user_config_file>,<location_of_user_key_file>)

   eg.

storeUserConfig('localConfigFile','localUserKey')
 

5. exit WLST

exit()

6. connect to weblogic using configuration file and key file

connect(userConfigFile='localConfigFile',userKeyFile='localUserKey')
 

7. Set weblogic.userConfigFile and weblogic.userKeyFile properties in build.properties based on your settings

#Location of stored weblogic user config file. 
weblogic.userConfigFile=localConfigFile

#Location of stored weblogic user key file. 
weblogic.userKeyFile=localUserKey
 

8. Put the config file and user key as parameters. then it will use the current user login and password.

<target name="configure.jms">
		<java classname="weblogic.WLST" fork="true" failonerror="true">
                <classpath>
                    <pathelement location="${fusion.middleware.home}/wlserver_10.3/server/lib/weblogic.jar"/>
                </classpath>

		<arg line="configJMS.py ${weblogic.adminurl} ${sifagent.weblogic.server} ${weblogic.userConfigFile} ${weblogic.userKeyFile}"/>
		</java>
	</target>
 

猜你喜欢

转载自fengyonghui.iteye.com/blog/563014