File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Remote WAR file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Remote WAR file" Watch "Remote WAR file" New topic
Author

Remote WAR file

Pushkal Mishra
Greenhorn

Joined: Sep 17, 2003
Posts: 10
Hi All,

Is it possible to source a remote WAR file (hosted on an Apache Web Server inside the htdocs folder as a resource) into an Apache Tomcat 6.x server? The idea is for the Tomcat to source in the latest WAR file during boot time.


<Host name="mydomain.com" unpackWARs="false" autoDeploy="true" appBase=""><Context path="" docBase="jar:http://mydomain2/someapp.war!/" debug="1" reloadable="true" crossContext="true">
...
...

I'd appreciate any lead.

Thanks,
Pushkal
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

No, but you can upload a new jar via the manager app.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Pushkal Mishra
Greenhorn

Joined: Sep 17, 2003
Posts: 10
Thank you.

Would this uploaded jar actually persist in some directory (like webapp) automatically upon upload? Or in some cryptic temp structure inside Tomcat?
Pushkal Mishra
Greenhorn

Joined: Sep 17, 2003
Posts: 10
I checked, it does persist it in the webapps folder.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Pushkal Mishra:
Or in some cryptic temp structure inside Tomcat?


It can work either way, but I don't think that the method used when you've got Tomcat configured not to unpack war files is all that cryptic.
When deployed this way, the war file gets unzipped into Tomcat's work directory.

One thing to note, is that dropping a new version of a war file on top of an existing one is like unzipping one directory structure onto an old one.
It will add files that weren't there, previously. It won't remove files just because they don't exist in the new war file. And on Windows, at least, I've found that it won't always update a jar with the new version. This might be due to the Windows Service locking jar files. Also, if the JSP's file dates in the new war file are older than the ones already in service Tomcat won't know to re-compile them.

Personally, I prefer to undeploy first to make sure that the new version is starting out with a clean slate.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Remote WAR file