For the benefit of others and me when I forget:
Servoy 8:
- Export War file
- Check Automatically upgrade repository if needed - (Tomcat fails to load if there are any issues with the repository with lots of non related issues (not Servoy's fault!))
- Add in the plugins your solution uses - I also included things like default_validators.jar, converters.jar etc just in case
- I am not using Smart client so removed the beans - add these if you are
- same with lafs
- add the database drivers you are using in my case MySQL
- NG add components that your using
- NG add services
- add a default admin username and password - this needs to be reset when you first load servoy-admin
- add your own properties file or let Servoy generate it for you - this is a tricky one both worked for me but the default was simpler and less problematic
- Check rim only if your using smart client if not, don't, as this presented lots of warnings about memory leaks
- check the databases your using - these must be fully qualified - (you can't employ a war to a remote tomcat server referencing a db on localhost obviously)
- Provide the database connection information for each used database. This is critical in the case of repository and I found starting from scratch to be the best solution i.e. let Servoy rebuild the repository
Copy the war file you have created to the tomcat server. IF your using docker as I am you use:
docker cp ~/Desktop/test.war tomcat:/usr/local/tomcat/webapps/test.war
This copies the war from my desktop to the locally installed docker container.
Once copied tomcat will install the Servoy solution and you can access i.e. with a URL such as
http://localhost:32777/test/servoy-webclient/Docker:For those wishing to try this it is a great way to install tomcat on your local machine and deploy completed tested solutions to the cloud. The quick instructions are
Install docker by following the instructions on docker.com. This provides you with virtual light weight host machine (linux) and a gui (kitematic). Open Kinematic, select new and search for Tomcat. I used the official version first option which was quick to install, up to date and consistent.
Once installed you can access the container via Kitematic using the Exec button. This takes you direct to Tomcat home in the container so to get to webapps where wars are installed type 'cd webapps' followed by 'ls' you will recognise the folder structure from the Servoy Server folder in developer.
Tomcat within the container is installed in /usr/local/tomcat
Tomcat home in the default install is /root/.servoy/server/[yoursolution]
To copy your war from your desktop:
- first check the name with 'docker images' this shows you a list of installed containers.
- then use the console copy process 'docker cp ~/Desktop/test.war tomcat:/usr/local/tomcat/webapps/test.war'
to get the servoy log file back from docker to your desktop
docker cp tomcat:/root/.servoy/server/[yoursolution]/servoy_log.txt ~/Desktop/
other files in the same directory include
import.ser
servoy_log.txt
servoy_server.properties
solution.servoy
uploads
IF you want to try again/reset your container you can either delete it:
Hit X next to container in Kitematic
type 'docker rmi tomcat [or your container ID both of which are got from 'docker images']
The other option is to retain the container and remove the servoy files using the DOCKER terminal window (Exec in Kitematic)
cd /usr/local/tomcat/webapps/
rm [yoursolution].war
rm -R [yoursolution]
cd /root/.servoy/server/
rm [yoursolution]
I cd into the folder to make sure I know where I am you can do this direct with rm -R /root/.servoy/server/[yoursolution] if your brave
The crucial thing about docker as opposed to using a service OR installing Tomcat on your local machine is if you mess up you can start again with no impact on your local machine and no security risk its all local. The second key thing is if you get this working and your happy with it you can deploy to Amazon AWS, Google etc all of whom offer container services many of which are free at the lower use tiers.
I hope this helps someone and more than likely I will need to notes again at some point soon
best
Gordon
.....thanks again to Steve and Johan for this input it was a great help. Do bear in mind two things that the guys suggested all of the above works in root it is better if you can get tomcat to work in its own user space. Secondly install a storage volume in docker which I am working at understanding. I will write up a detailed how to if anyone is interested contact me direct