Forums Register Login
Web app deployment model depends on build.xml? (Lomboz)
I am re opening this topic since the problem might be not in IDE but in Servlet concept itself.
Everything used to be fine when eclipse/lomboz deployed my project into my /webapps/modulename/ folder.. it made testing a snap and everything was cool...
But one day (yesterday) for some reason it started deploying my project into /webapps/modulename.war and it bugs the shit out of me because I takes me forever to do the whole thing and my stupid tomcat doesnt want to extract the archive anyway..
so what I want is for the software to go back to deploying it in a folder manner, rather than WAR manner... does anybody have any ideas?
I dont remember changing anything (and I am the only 1 who has access to my comp)... IT just started doing it and that's all...
I have a suspicion the reason might be in build.xml... which I also haven't changed... help anybody?

Thank you in advance, your help is greatly appreciated
Tomcat should automatically extract a .war file into its directory structure. At least, mine does.
Additionally, if the problem is in build.xml this is an ant question.
do you hae any idea why doesnt my tomcat automatically extract it? I do restart the server...
but still, I'd rather have a folder-type rathern than WAR
If its a tomcate issue (which its not primarily), then tomcat cane be set to either automatically unwar the WAR files or leave them as is. You can change this in the server.xml file.
I think what is probably happening is that you have different build options (i have compile, deploy etc) and its has switched from doing a simply compile and tranfer files to war it all up.
You should check which option is being called in Eclipse of the build file.
I hope this helps.
That's what I was thinking.. I probably switched the deploy configuration or something... I will look into how to configure tomcat to unwar wars, but here's my build.xml:
<!-- Copyright (c) 2002 by ObjectLearn. All Rights Reserved. -->
<project name="AnotherTest" default="deploy" basedir=".">

<!-- set global properties for this build -->
<property file="build.properties"/>
<property name="dist" value="../../dist" />
<property name="web" value="../" />

<target name="init">
<!-- Create the dist directory structure used by compile
and copy the deployment descriptors into it-->
<mkdir dir="${dist}"/>
<mkdir dir="${dist}/WEB-INF"/>
<mkdir dir="${dist}/WEB-INF/classes"/>
<mkdir dir="${dist}/WEB-INF/lib"/>
<copy todir="${dist}">
<fileset dir="${web}">
<include name="**/*.*"/>
<exclude name="**/jsp_servlet/*.class"/>
<exclude name="**/build.xml"/>
<exclude name="**/build.properties"/>
<exclude name="**/servers.xml"/>
<exclude name="**/targets.xml"/>
<exclude name="**/*.war"/>
<copy todir="${dist}/WEB-INF/classes">
<fileset dir="${build}">
<include name="**/*.*"/>
<exclude name="**/jsp_servlet/*.class"/>


<target name="deploy" depends="undeploy,init" >
<!-- Create the distribution directory -->
<delete file="${war}.war"/>
<jar jarfile="${war}.war" basedir="${dist}"/>
<copy file="${war}.war" todir="${domain}"/>
<delete file="${war}.war"/>
<!-- Create the distribution directory -->
<delete dir="${dist}"/>

<target name="undeploy">
<!-- Create the distribution directory -->
<delete file="${domain}/${war}.war"/>

<!-- Tomcat -->
<delete dir="${domain}/${war}"/>
<!-- Tomcat 4.0.x-->
<delete dir="${serverhome}/work/localhost/${war}"/>
<!-- Tomcat 4.1.x-->
<delete dir="${serverhome}/work/Standalone/localhost/${war}"/>



... war=web is the name of web module to be deployed as far as I understand....

Any suggestions?
BTW I am very disappointed with Eclipse/Lomboz's poor documentation
Ok I configured my server.xml to unpack wars... now at least I have some hope ))
BUt still... Any suggestions on how to make it deploy in folders rather than wars??? That allowed me to test my app within a touch of a button.... now I have to wait for restart and blah and blah blah

BUt still... Any suggestions on how to make it deploy in folders rather than wars??? That allowed me to test my app within a touch of a button.... now I have to wait for restart and blah and blah blah

What do you mean "deploy in folders rather than wars???" Isn't your "dist" folder basically you're webapp folder? Just copy the whole entire thing over to tomcat.home/webapps using ANT's copy task. Along the way, you might want to change "dist" to another name that describes your app, i.e. FooApp. Then access it http://localhost:8080/FooApp
You should read Tomcat's documentation. It outlines various ways in which you can deploy your application. I think using a WAR file is one of five ways, but the documentation can tell you more on it.
K will reade it... thx for tip
Looking at your build.xml file, if you call "ant deploy" this will war up your app but not if you simply call the "ant init".
To test this, you can open up a console in Eclipse and run at init and see how it goes.
Get out of my mind! Look! A tiny ad!
Become a Java guru with IntelliJ IDEA

This thread has been viewed 1402 times.

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2019 14:45:16.