Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Web app deployment model depends on build.xml? (Lomboz)

 
Ivan Jouikov
Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ivan
 
Ron Newman
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat should automatically extract a .war file into its directory structure. At least, mine does.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64708
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Additionally, if the problem is in build.xml this is an ant question.
bear
 
Ivan Jouikov
Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Faisal Khan
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ivan Jouikov
Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"/>
</fileset>
</copy>
<copy todir="${dist}/WEB-INF/classes">
<fileset dir="${build}">
<include name="**/*.*"/>
<exclude name="**/jsp_servlet/*.class"/>
</fileset>
</copy>

</target>

<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>


<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}"/>
</target>


</project>

___________
build.properties:
build=../../bin
war=web
domain=/var/tomcat4/webapps
serverhome=/var/tomcat4

... 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
 
Ivan Jouikov
Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Hung Tang
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Ivan Jouikov
Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
K will reade it... thx for tip
 
Faisal Khan
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic