论坛首页 Java企业应用论坛

Using wsadmin to restore WAS server configuration

浏览 1484 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2013-07-08  

 

RAD is a terriable 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', 'D:/3M/code/WMS/.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 proble 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 shell:

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

if the your server profile is created with a 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>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 shell and it's done.

 

 

 

 

 

 

 

 

 

 

论坛首页 Java企业应用版

跳转论坛:
Global site tag (gtag.js) - Google Analytics