Deploying a C-App
After creating your C-Apps and deployable archives, you are ready to deploy them to one or more Carbon servers (that is, servers for products based on WSO2 Carbon). You can then test them and debug your applications and artifacts as needed.
If you are running products in a cluster, you can use Deployment Synchronizer to keep the configurations on all nodes in the cluster in synch.
Deploying a C-App using the management console
To deploy the CAR file for the C-App to a Carbon server, start the server, log in to the management console for that product, go to Application > Add, and browse for the CAR file that you have created.
Once you click Upload, you will be asked to refresh the browser. Once you refresh, you will see that the CAR file has been deployed.
Deploying a C-App to a running server inside Eclipse
Before you deploy the created C-App project, you have to choose the artifacts you need to deploy. For that, double click on the pom.xml
and select artifacts you need to deploy and save the changes.
Go to Servers view, right click and select New > Server.
Select the relevant version of the server under the WSO2 category. For example, WSO2 Carbon 4.2 based server.
To see the relevant version of the Carbon based server, refer to the Release Matrix.
If you have not added WSO2 Server instances before, you will need to specify the location of the downloaded WSO2 Server instance.
Now you will see your version of the server (for example WSO2 Carbon 4.2 based server) added to the Server Runtime Environments. Click OK.
You can change ports if you want. If the default ports are not used by any other application, you can keep them as they are. After setting the ports click Next.
The Enable hot update of published server modules check box is selected by default. Disable this option if you do not want the C-App to be redeployed automatically after saving any changes.
Add the C-App project and click Finish.
Now you will see the newly added server listed in the Servers view. Right click on the WSO2 Carbon x.x.x based server at localhost and select Start from the menu.
Redeploying a C-App to a running server inside Eclipse
If the Enable hot update of published server modules option is selected, the C-App is redeployed automatically when any changes are saved.
After you have deployed your C-App to a running server inside Eclipse, you may want to change the content of your C-App. In that case you do not need to remove the deployed C-App from the server and deploy again to the server. Instead you can re-deploy an already deployed C-App. Deploy the C-App project according to the instructions given above and then do the necessary changes to your C-App project.
Open the Servers view in Eclipse using Window > Show View > Servers.
Click on the expandable icon of the Server you are running inside Eclipse. (This expandable icons available only if you have deployed a project in that server). Right-click on the project and click Re-deploy.
Then you will see that your Eclipse console is updated and you can notice that your C-App project is deployed again.
Deploying a C-App to multiple servers using the Maven plug-in
The WSO2 CAR Deploy plug-in for Maven allows you to generate a CAR file for a C-App project and then deploy it (or undeploy it) to multiple local and remote Carbon servers, including StratosLivePaas.
For detailed information, see Using WSO2 CAR Deploy Plug-In.