Link to home
Start Free TrialLog in
Avatar of WAS
WASFlag for United States of America

asked on

jython script for modify the contextroot of a running app in WAS 6.1

i have trouble modifying the contextroot of a running application port-logic, below is the info and errors iam getting, please provide me with correct jython command to modify just the
context root of a running, mine is WAS6.1.0.21
wsadmin>AdminApp.edit('port-logic', ["-options"])
WASX7015E: Exception running command: "AdminApp.edit('lossb-slm', ["-options"])"; exception information:
 com.ibm.ws.scripting.ScriptingException: WASX7107E: Invalid options specified: "[options]"; valid options are:
MapModulesToServers
MapWebModToVH
CtxRootForWebMod
MapSharedLibForMod
JSPReloadForWebMod
distributeApp
nodistributeApp
useMetaDataFromBinary
nouseMetaDataFromBinary
createMBeansForResources
nocreateMBeansForResources
reloadEnabled
noreloadEnabled
allowDispatchRemoteInclude
noallowDispatchRemoteInclude
allowServiceRemoteInclude
noallowServiceRemoteInclude
verbose
installed.ear.destination
reloadInterval
validateinstall
filepermission
buildVersion
filepermission
installed.ear.destination

wsadmin>print AdminApp.view("port-logic", "-CtxRootForWebMod")


CtxRootForWebMod: Edit the Context root of web module

Context root defined in the deployment descriptor can be edited.

Web module:  port-logic.war
URI:  port-logic.war,WEB-INF/web.xml
ContextRoot:  krishna


wsadmin>


wsadmin>AdminApp.edit ( 'port-logic', ['-CtxRootForWebMod', 'Govind'])
WASX7015E: Exception running command: "AdminApp.edit ( 'port-logic', ['-CtxRootForWebMod', 'govind'])"; exception information:
 java.lang.ClassCastException: java.lang.ClassCastException: java.lang.String incompatible with java.util.List

wsadmin>
Avatar of WAS
WAS
Flag of United States of America image

ASKER

Hi HonorGod,

How are you..not sure this ticket same into your radar, can you please help me with question
ASKER CERTIFIED SOLUTION
Avatar of HonorGod
HonorGod
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of WAS

ASKER

that worked really good. one more thing, is there a way to output script output to a file, this is how i run the jython script
sudo -u web ./wsadmin.sh -lang jython -f ~/scripts/change_contextroot.py
Sure.  Just add a normal output redirect...

Thanks for the grade & points.

Good luck and have a great day.
sudo -u web ./wsadmin.sh -lang jython -f ~/scripts/change_contextroot.py > /tmp/change_contextroot.output

Open in new window

Avatar of stanjavoor
stanjavoor

Hi HonorGod,

I'm in same situation here, but using jacl on WAS v8.5.5.2 Base version.
I'm trying to deploy DefaultApplication.ear file through a script. I downloaded the WAS Samples script and doing the deploy.
I'm using the attached the below script to deploy ear file successfully.

I want to change the default ContextRoot and I want to map the modules to both the AppServer and WebServer using jacl wsadmin in the app deploy.
I tried to add MapModulesToServers but i always get error.

Can you please tell me what arguments i need to pass in the below script to deploy the application, change the context root to /samples and MapModules to both appservers and webservers.
In simple, is all three possible in $AdminApp install {...................}

Thanks,
ST