Using wsadmin to restore WAS server configuration

 

RAD is a terrible IDE, but sometimes you have to work on it.

 

One of the most frequently happened problem is that we always get an error like below:

AdminTask.importWasprofile(['-archive', '******.metadata/.plugins/com.ibm.ws.ast.st.v6.core/tmp0/WAS60ServerConfig.car'])
com.ibm.bsf.BSFException: exception from Jython:
Traceback (innermost last):
  File "<input>", line 1, in ?
TypeError: importWasprofile(): 1st arg can't be coerced to String

 

This is an error happened when we are trying to use .car file to restore the WAS configuration, you probably do it by this approach, right click a server profile in the server tab, select Server Configuration --> Restore...

Most times you will get the above error, I have tried many times on different versions of RAD, none of any attempt has been successfull.

 

This problem has been a pain in the ass for a very long time, till I found I can use wsadmin to restore the configuration instead of using the context menu of RAD.

 

Here is the steps:

 

1. Start the WAS Server

2. Run wsadmin in a cmd shell :

C:\Program Files\IBM\SDP\runtimes\base_v6\bin>wsadmin -conntype SOAP -host 127.0.0.1 -port 8881 -user wsadmin -password wsadmin 

Note: The host should be the server ip address, and the port number here may be different with yours, please check the SOAP port number of your own server.

if the your server profile is created with an admin user name and password, you should add -user wsadmin -password wsadmin at the end of the command line.

3. Once you have connected to the server you could get a prompt of wsadmin> and execute the following command:

wsadmin>$AdminTask importWasprofile {-archive C:\WAS60ServerConfig.car}
wsadmin>$AdminConfig save

Note: C:\WAS60ServerConfig.car is the .car file you should have and be used.and wait until it is executed.

4. Exit the cmd shell and it's done.

 

 To export current profile config for backup:

wsadmin>$AdminTask exportWasprofile {-archive C:\WAS60ServerConfig.car}

 

 To delete a profile:

IBM\WebSphere\AppServer\bin>manageprofiles.bat -delete -profileName AppSrv01

IBM\WebSphere\AppServer\bin>manageprofiles.bat -validateAndUpdateRegistry

 

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值