Scout/Tutorial/5.0/Deploy to Tomcat
|Download • Git|
|Forums • Blog • Twitter • G+|
Deploy a Scout Application to Tomcat
This page shows how to export and deploy your Scout application to a Tomcat webserver using the Scout SDK.
If you have not yet installed Tomcat please go to the Tomcat homepage. Then download and install Tomcat version 7 using the proposed default settings. Once you started the webserver you verify that its running by starting your browser with the address http://localhost:8080. Your browser should display some page similar as shown below.
Export Scout Application
In the Scout SDK perspective use the context menu 'Export Scout Project ...' on the project node as shown below.
This opens the Export a Scout Project dialog as shown below. For this tutorial we assume that you have all user interfaces in your project.
In the first field we define in which directory the exported files will be stored.
In the checkbox below we can also choose if we would like to create an EAR containing all WAR files. If this checkbox is ticked, all output WAR files will be packed together in a single EAR that can be deployed into an application server like JBoss. If this checkbox remains unticked, each WAR file will be stored separately in the output folder defined above.
In the list you can choose amongst the following export artifacts:
- Server Web Application: The server application will be exported. If a client is available, it is packed into the server as well and will be provided for download on the target URL where the resulting WAR file will be deployed.
- Client Application: The client application packed as ZIP file. The same client will be available for download on the server if ticked (see above).
- RAP Web Application: The RAP web UI application. After the deploy of this WAR file the web UI can be accessed using an URL like http://host:port/webappname/web
Depending on which elements are ticked you will have to specify the details in the next wizard pages.
If the server is ticked as export artifact, you will have to define the WAR file name of the server application and choose which product you would like to export.
If a client should be exported, you have to choose which client product to use (usually a production product should be selected). Furthermore you must define where the client should be stored to be available for download after the deploy.
If the RAP Web Application has been ticked as export artifact in the first step, we must specify now how the resulting WAR file should be named and which RAP product that should be exported.
After pressing Finish the selected components will be exported to the target directory specified in the first step. As soon as the export as completed you can deploy the WAR files in the output directory to your Tomcat installation e.g. using the Manager App that is part of Tomcat: http://localhost:8080/manager/.
Test the Application
Now we can access the application homepage under http://localhost:8080/helloworld_server/
From there we can download the client application as ZIP file. After it has been extracted you can start the client. It will connect to the server that has just been deployed.
If you have also decided to export the RAP UI, you can deploy this WAR file the same way as for the server application. You should then be able to access the Web UI with the following URL: http://localhost:8080/helloworld/web. The mobile and tablet versions are available under http://localhost:8080/helloworld/mobile and http://localhost:8080/helloworld/tablet
Redeploy to Tomcat
When you redeploy to Tomcat, you need to ensure that you get the new version of your application installed. We have observed that sometime, some old binaries are cached and that the second deployment is corrupted. To be sure to deploy properly, follow this process:
- stop tomcat
- apache-tomcat-7.x/webapps/<your_app>/ (if you use the unpackWARs="true" config)
- copy your new war in the webapps folder.
- restart tomcat
Deploy to other Webservers
Download and Installation
- Download GlassFish 220.127.116.11
- Install GlassFish with accepting default settings everywhere
- Start the GlassFish server
- Open the web UI
Deploy the WAR Files
For the deploy procedure described here, you may use the WAR files as generated in the description for Tomcat.
Start with opening the GlassFish web UI on address http://localhost:4848/. In the web UI, choose the button to deploy a web application.
Click on the Upload button, select the helloworld_server.war file as shown below. Glassfish automatically chooses "Web Application" as type and fills in the settings. Keep these settings unchanged and complete the deploy by clicking on the Ok button in the GlassFish web UI.
Then, repeat the steps to deploy the helloworld.war file. You should now see the two web applications listed in the GlassFish web UI.
And the running web application should be available under these addresses:
http://<your GlassFish server>:8080/helloworld_server/ http://<your GlassFish server>:8080/helloworld/web (or /mobile or /tablet)