aspose file tools*
The moose likes Tomcat and the fly likes Tomcat 7 : Deployment Problem When unpackWARs is false in server.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat 7 : Deployment Problem When unpackWARs is false in server.xml" Watch "Tomcat 7 : Deployment Problem When unpackWARs is false in server.xml" New topic
Author

Tomcat 7 : Deployment Problem When unpackWARs is false in server.xml

Prashant Chotu
Greenhorn

Joined: Jun 28, 2012
Posts: 19
Hi,

I am trying to deploy my grails application in Tomcat 7.0.27

My application lib directory contains some properties file as well along with the Jars.
In tomcat server.xml, When I set unpackWARs false (compressed deployment), then apache-tomcat-7.0.27/work/Catalina/localhost/_/WEB-INF/lib directory contains only Jars not the properties files which I have in my application lib.
I also tried putting properties file in tomcat lib, But no lock.. . Is there any configuration in tomcat to troubleshoot this issue ?

Also when unpackWARs is false, there are only two folders lib and classes in apache-tomcat-7.0.27/work/Catalina/localhost/_/WEB-INF/. This is also creating a new problem as my application searches for some other folders also in WEB-INF. This works good with unpackWARs true.

Any help on the above two problems will really be appriceated

To overcome the above two problems, I can set unpackWARs true, but there is a problem in extracting the war. Suppose my war file name is ROOT.war and the ROOT folder is already existing in webapps, then the server starts do not extract the ROOT.war and my app goes up with the old ROOT folder.
What should be the best way to clean up existing extracted war folder ROOT ? For now, I am deleting the existing ROOT folder in the start up sctipt /etc/init.d/tomcat.

Should I set unpackWars true or false ?

Many many Thanks in advance..

The OS I am using is RHEL 5.2 .. Please let me know If you need more info

Regards,
Prashant Gupta
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15657
    
  15

Welcome to the JavaRanch, Prashant!

I have not verified for Tomcat7, but in earlier versions of Tomcat, if there was an unexploded WAR (WAR file) and an exploded WAR (directory) with the same base name (with/without ".war"), the exploded WAR took precedence. Replacing the WAR file would not update the exploded WAR directory and the exploded WAR directory was what the webapp actually ran from. So to do a "proper" update, you would have to delete the exploded WAR directory. And, for best results, corresponding directories in TOMCAT_HOME/woek and TOMCAT_HOME/temp.

I am not certain, but it sounds like you are attempting to use TOMCAT_HOME/webapps as a general-purpose directory, storing data in it. Don't do that. Only WARs should be stored there. and you should never attempt to write data into a WAR. Always use an external location. And by "external", I don't just mean external to the webapps directory, I mean external to the entire Tomcat server. On a Linux system, the common practice is to use /var/lib/appname as the base directory for files that can be written or updated.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat 7 : Deployment Problem When unpackWARs is false in server.xml
 
Similar Threads
Error in Setting ContextPath
Problem running Struts applications on external Tomcat server
Define new tomcat webapp location?
Problem excluding *.jars in war build using maven(pom.xml)