Bootstrap FreeKB - IBM WebSphere - Auto start application
IBM WebSphere - Auto start application

Updated:   |  IBM WebSphere articles

When auto start is enabled, an application will automatically start when the application server is started or restarted. When auto start is disabled, an application will be stopped when the application server is started or restarted. In this scenario, the application would need to be manually started.

  1. In the WebSphere admin console, expand Applications > Application Types, and select WebSphere enterprise applications.
  2. Select the application that you want to enable or disable auto start.
  3. Select Target specific application status.
  4. Check the cluster the application is in and select Enable Auto Start or Disable Auto Start.
  5. Select Save.

In this example, the Auto Start status is Yes, which means the applications in exampleCluster will automatically start when the application server is started or restarted.

 

Or you can use wsadmin.

/opt/WebSphere/AppServer/profiles/profile01/bin/wsadmin.sh -lang jython -c "print AdminConfig.getid('/Deployment:HelloWorldEAR/')"

 

This should return the deployment ID, something like this.

HelloWorldEAR(cells/Cell01/applications/HelloWorldEAR.ear/deployments/HelloWorldEAR|deployment.xml#Deployment_1234567890123)

 

Using the output above, run this command.

/opt/WebSphere/AppServer/profiles/profile01/bin/wsadmin.sh -lang jython -c "print AdminConfig.showAttribute('(cells/Cell01/applications/HelloWorldEAR.ear/deployments/HelloWorldEAR|deployment.xml#Deployment_1403144753114)', 'deployedObject')"

 

Which should return the Application Deployment ID.

(cells/Cell01/applications/HelloWorldEAR.ear/deployments/HelloWorldEAR|deployment.xml#ApplicationDeployment_1403144753115)

 

Using the output above, run this command.

/opt/WebSphere/AppServer/profiles/profile01/bin/wsadmin.sh -lang jython -c "print AdminConfig.showAttribute('(cells/Cell01/applications/HelloWorldEAR.ear/deployments/HelloWorldEAR|deployment.xml#ApplicationDeployment_1403144753115)', 'targetMappings')"

 

Which should return the Deployment Target Mapping IDs.

[(cells/Cell01/applications/HelloWorldEAR.ear/deployments/HelloWorldEAR|deployment.xml#DeploymentTargetMapping_1403144753115)]

 

And then using the Deployment Target Mapping IDs, run this command. enable "false" to disables auto start or enable "true" enables auto start.

/opt/WebSphere/AppServer/profiles/profile01/bin/wsadmin.sh -lang jython -c "print AdminConfig.modify('(cells/Cell01/applications/HelloWorldEAR.ear/deployments/HelloWorldEAR|deployment.xml#DeploymentTargetMapping_1403144753115)', '[[enable "false"]]')"

 

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 9607ce in the box below so that we can be sure you are a human.