# Tomcat HotDeploy from ZK-GUI

IngoB
256 6

Hi,

I want an "Update Feature" in my GUI. So I thought to upload a WAR-File via ZK Fileupload and then replace the "old" WAR File on-the-fly in the Tomcat Webapps directory to deploy it (and restart the server).

The upload is working, but the copying of the file to the webapps folder is not working. If I do it manually it works ( "mv new_app.war app.war" ).

I tried it with "apache.common.io" and "1.7 java", same result: No error, nevertheless no copied file!

String realPath = Executions.getCurrent().getDesktop().getWebApp().getRealPath("/");
File destFile = new File(realPath.substring(1, realPath.lastIndexOf("/")) + "/app.war");
...


Any Idea?

Linux / ZK 7.0.2 EE / Mozilla FF 30.0

delete retag edit

Sort by » oldest newest most voted

9393 3 7 16
http://www.oxitec.de/

I would NOT do that. Tomcat is not build for hot-deployment !!

This should work 3 or 4 times dependent of the memory that Tomcat uses. By next 'hot-deployment' you will get 100% a 'Perm Gem' error.

best Stephan

IngoB
256 6

Yes, I know. But! uploading an update and telling the customer to reboot is MUCH easier, than to discuss how to shutdown/deploy/startup on linux :p

9393 3 7 16
http://www.oxitec.de/

if it's possible to write a little java command tool as an observer who will oberserve if it's a new war is uploaded. And than it calls a sh-script?

best Stephan

IngoB
256 6

The upload is working fine. I save the uploaded file in a tmp directory. The only problem is, that i can't get the file copied to my webapps folder. there is no error, nothing, but the file is still not there :<

jimmyshiau
4921 5
http://www.zkoss.org/

You can try to invoke ant build to move the file, or restart server with ant.

IngoB
256 6

There was a problem with my tomcat configuration and auto-deploy. Now its working, thanks for your input :)

[hide preview]