Deploy with Ant tasks

2003-03-20 Thread Jeff Jensen
Hi,

When using the Tomcat Ant tasks to deploy (install or deploy) a war, where
should the war and extracted archive end up?

Is it supposed to deploy to the work subdirectory or webapps?

The problem I am having is that I get a nearly successful deploy with either
install or deploy - the war ends up in the manager subdir (as expected) and
the jars from the war are extracted to an appropriate work subdir (as
expected), but the properties files in the war (in WEB-INF) are not
extracted to the WEB-INF dir of the appropriate work subdir - which is an
unexpected error.  So when the app starts, errors occur from lack of reading
the needed property files.

Also, no files are placed in the webapps dir structure as when placing a war
in the webapps dir, but I interpret this as expected behavior from the
docs.(?)

I am wondering if I am missing a configuration item or similar, but cannot
determine what.

I have spent many days trying different things and searching the web and
archives with no info.  Is there something in the docs I have missed?
Appreciate any pointers or answers.  TIA.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Reloading shared/lib JAR files?

2003-03-22 Thread Jeff Jensen
Also, from a release management standpoint, the risk is the dependency of
all the apps on the specific versions of the jars in shared/lib.  Meaning,
if one app needs a newer version of a shared component placed in shared/lib,
then all are forced to upgrade as well.  Timing on upgrading the other apps
is not usually so helpful, particularly when needing even a small coding
change!

It is typically better to use the source control tool to integrate specific
versions of shared components into its own codeline - so the codeline is
complete without external dependencies (reproducible builds from the source
tree).  If it is a 3rd party component, check-in the distributables and
integrate/merge the right versions of them into your different product
codelines.  If it is your own component, do the same - check-in the
distributables.  For deployment, as part of the normal build/package/deploy
process, place the shared components in WEB-INF/lib so each app can have its
own version.

As Tim says, this would "rethink the design" and solve the problem by not
having anything in shared/lib.  At the same time, eliminating a potential
cross-application dependency problem.

Disclaimer - there may be something in your environment that forces you to
use shared/lib (or possibly never even have an upgrade problem), whether
technical (can't think of much other than large footprint jars) or
"political" ;-)

Your mileage may vary.


> -Original Message-
> From: Tim Funk [mailto:[EMAIL PROTECTED]
> Sent: Saturday, March 22, 2003 8:50 AM
> To: Tomcat Users List
> Subject: Re: Reloading shared/lib JAR files?
>
>
> If you redeploy jars into /shared/lib - they will not be
> reloaded on a
> webapp reload and there is no way to reload them(except a
> stop/start of
> tomcat). But jars/classes in WEB-INF/ can be reloaded.
>
> If you have jars in shared/lib that need reloaded when an webapp is
> reloaded - you might need to rethink the design of those shared libs.
>
> -Tim
>
> Johannes Fiala wrote:
> > Hi there,
> >
> > I know it is possible to reload a web-application using the
> manager app
> > (especially the JAR-files in WEB-INF/lib).
> > Is it possible to also include the shared/lib directory?
> >
> > We have some helper JARs, which are used by four web
> contexts, so I'd
> > prefer to put them into /shared/lib.
> > However, if it doesn't get reloaded after an update of
> /shared/lib, I have
> > no means to perform a hot redeploy if only the JAR files change.
> >
> > thx alot
> > Johannes


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat 5 and Ant install/reload/remove

2003-03-22 Thread Jeff Jensen
Ant install and deploy do not update the webapps dir (look in the work
subdir hierarchy for the files).  So if you have placed an app in webapps,
then conflicts will occur when using the Ant tasks (e.g. problems for
starting, as Tomcat will already have been running it from webapps).

So, do not combine usage of the Ant tasks and copying to webapps!

I suggest using the deploy task to deploy the war from your build's
distributables directory.


> -Original Message-
> From: Paul Campbell [mailto:[EMAIL PROTECTED]
> Sent: Saturday, March 22, 2003 10:28 AM
> To: [EMAIL PROTECTED]
> Subject: Tomcat 5 and Ant install/reload/remove
>
>
> Following the docs for the deployment process I created a
> simple HelloWorld
> servlet.
>
> I cannot be certain, but I believe, proir to running ant
> install, I manually
> copied the servlet directory to TOMCAT/webapps/HelloWorld.
> After running ant
> install the servlet ran perfectly.
>
> However, modifting the development copy of the srevlet and
> rerunning ant
> install produced no effect.
>
> I deleted the TOMCAT/webapps/HelloWorld directory and ran
> "ant remove clean all
> install".  All reported fine, but NO evidence of anything on
> TOMCAT/webapps/
>
> I double check the server has write access and it does.  I
> eventually manually
> copied the contents of HelloWorld/build to TOMCAT/webapps/
> and renamed it
> HelloWorld.  Nothing.  I reran ant install and it said, OK.
> Servlet Not
> Avaliable or 404 errors was all I could get.
>
> I can not get the ant install to work at all.  It registers
> it with the
> manager, but that is it.
>
> To get subsequent versions even after minor edits to work, I
> need to...
>
> ant compile
> cp build/* -r /opt/tomcat/webapps/HelloWorld
> ant install
> /opt/tomcat/bin/shutdown.sh
> [ .. wait 20 seconds .. ]
> ps ax
> possibly: /opt/tomcat/bin/shutdown.sh  again
>
> /opt/tomcat/bin/startup.sh
> [ takes over a minute to restart ]
>
> Finally the app works.
>
> Unless I am doing something wrong, this conflicts with the
> documentation on the
> deployment process that states all you need to do to get the
> app running
> temporarily on the server during development is to run ant install.
>
> Any help and advice would be very greatfully recieved.  Thanks.
>
> --
>
> Paul Campbell
>
> Campbell Multimedia
> Web Design | PC Sales
> +===+
> [ WWW:   http://campbell-multimedia.com ]
> [ Tel:   07970 510549   ]
> [ Email: [EMAIL PROTECTED]   ]
> +===+
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Reloading shared/lib JAR files?

2003-03-23 Thread Jeff Jensen
>
> Do you think the approach outlined above makes sense?
> I think this would reduce the "scattered" library version
> troubles and it
> would even be possible to search all the contexts to find out which
> versions are used.
>
> Thx for your feedback
> Johannes
>
>
>
>
> "Jeff Jensen" <[EMAIL PROTECTED]>
> 22.03.2003 16:44
> Please respond to
> "Tomcat Users List" <[EMAIL PROTECTED]>
>
>
> To
> "'Tomcat Users List'" <[EMAIL PROTECTED]>
> cc
>
> Subject
> RE: Reloading shared/lib JAR files?
>
>
>
>
>
>
> Also, from a release management standpoint, the risk is the
> dependency of
> all the apps on the specific versions of the jars in
> shared/lib.  Meaning,
> if one app needs a newer version of a shared component placed in
> shared/lib,
> then all are forced to upgrade as well.  Timing on upgrading
> the other
> apps
> is not usually so helpful, particularly when needing even a
> small coding
> change!
>
> It is typically better to use the source control tool to integrate
> specific
> versions of shared components into its own codeline - so the
> codeline is
> complete without external dependencies (reproducible builds from the
> source
> tree).  If it is a 3rd party component, check-in the
> distributables and
> integrate/merge the right versions of them into your different product
> codelines.  If it is your own component, do the same - check-in the
> distributables.  For deployment, as part of the normal
> build/package/deploy
> process, place the shared components in WEB-INF/lib so each
> app can have
> its
> own version.
>
> As Tim says, this would "rethink the design" and solve the
> problem by not
> having anything in shared/lib.  At the same time, eliminating
> a potential
> cross-application dependency problem.
>
> Disclaimer - there may be something in your environment that
> forces you to
> use shared/lib (or possibly never even have an upgrade
> problem), whether
> technical (can't think of much other than large footprint jars) or
> "political" ;-)
>
> Your mileage may vary.
>
>
> > -Original Message-
> > From: Tim Funk [mailto:[EMAIL PROTECTED]
> > Sent: Saturday, March 22, 2003 8:50 AM
> > To: Tomcat Users List
> > Subject: Re: Reloading shared/lib JAR files?
> >
> >
> > If you redeploy jars into /shared/lib - they will not be
> > reloaded on a
> > webapp reload and there is no way to reload them(except a
> > stop/start of
> > tomcat). But jars/classes in WEB-INF/ can be reloaded.
> >
> > If you have jars in shared/lib that need reloaded when an webapp is
> > reloaded - you might need to rethink the design of those
> shared libs.
> >
> > -Tim
> >
> > Johannes Fiala wrote:
> > > Hi there,
> > >
> > > I know it is possible to reload a web-application using the
> > manager app
> > > (especially the JAR-files in WEB-INF/lib).
> > > Is it possible to also include the shared/lib directory?
> > >
> > > We have some helper JARs, which are used by four web
> > contexts, so I'd
> > > prefer to put them into /shared/lib.
> > > However, if it doesn't get reloaded after an update of
> > /shared/lib, I have
> > > no means to perform a hot redeploy if only the JAR files change.
> > >
> > > thx alot
> > > Johannes


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Guidelines on application development

2003-03-26 Thread Jeff Jensen
One of the first tasks on a project is to create the Ant build file for a
fully automated deploy.  It is used for every deploy to the app server,
including the compilation.  But, sometimes when working on a class, I
compile with the IDE until it is done/ready for the integrated build (I
typically use Emacs with JDE and it has a fast "compile server").

The Tomcat Ant tasks allow a fully automated deploy, including eliminating
that full restart of Tomcat (I do the same process no matter what app server
deploying to).  Particularly, look at the "deploy" and "undeploy" tasks in
Tomcat.


> -Original Message-
> From: Greg Speechley [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 26, 2003 7:01 PM
> To: Tomcat User
> Subject: Re: Guidelines on application development
>
>
> I have just migrated from Tomcat 4.0.3 to 4.1.24 on win2k. At
> present we
> have a test server which we do all development and testing on
> then once the
> app is stable we transfer the app directory onto the live server to
> $CATALINA_HOME\webapps, restart tomcat and it's good to go.
>
> During development we use a java editor eg jGrasp to edit
> .java files which
> are stored in $CATALINA_HOME\webapps\app\WEB-INF\classes and
> compile these
> individually. It gets a bit tiresome restarting tomcat after
> each recompile
> but I can live with that (I have reloadable=true but this
> doesn't seem to be
> reliable). Obviously this is a fairly poor way to do things
> so I am keen to
> use the manager in 4.1.24 to reload apps and ant to build it.
> I have looked
> at the docs and created the directory structure as suggested in the
> Application Developer's guide (java files in
> src\WEB-INF\classes, etc) and
> can build from src directory so that class files are stored in the
> build\WEB-INF\classes. BTW this dir structure should be
> stored in folder
> called "projectname" somewhere other than $CATALINA_HOME\webapps?
>
> Now from what I can tell I would then have to move these
> class files to
> $CATALINA_HOME\webapps\app\WEB-INF\classes to be able to test
> it, surely I
> am missing something because this seems to be quite
> laborious. Do you use
> ant each time you recompile during development or just
> compile from your
> editor? If anyone can provide some suggestions on the
> recommended way to do
> things I would greatly appreciate it coz I am trying to implement much
> better development practices :)
>
> Cheers
> Greg
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Trouble with ant install command and ResourceLink

2003-03-29 Thread Jeff Jensen
I do not have an answer for your specific issue, but I found minor deploy
issues with install, so I only use deploy and undeploy tasks and do not have
any more issues.  Have you tried using deploy - did it have the same
problems?


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 28, 2003 11:52 AM
> To: Tomcat Users List
> Subject: Trouble with ant install command and ResourceLink
>
>
> hi there,
>
> In my /webapps/myapp.xml I'm using a ResourceLink:
>   
>
> I'm using the manager app via ant to test my application.
> After calling
> ant remove
> ant install
>
> it tells me the context has been installed OK.
> However, it seems as if the ResourceLink has not been inited during
> install, so it seems Tomcat doesn't read the /webapps/myapp.xml file.
>
> Sidenote: this problem is somewhat related to my
> initparameter problem
> outlined earlier today, but cannot be overcome as easily.
>
> has anybody overcome this issue?
> is else using the ant manager task together with JNDI resourcelinks
> successfully?
>
> thx
> Johannes


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Trouble with ant install command and ResourceLink

2003-03-29 Thread Jeff Jensen
Yes, me too.  Based on what the install process does compared to deploy, I
have not yet determined an applicable time to use install vs deploy!  I
haven't looked back since started using deploy... :-)


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Saturday, March 29, 2003 8:23 AM
> To: Tomcat Users List
> Subject: RE: Trouble with ant install command and ResourceLink
>
>
> Hi Jeff,
>
> no, using the ant deploy task it worked smoothly.
> I was just wondering what the install task is all about
> (if it's not
> working)
>
> thx
> Johannes
>
>
>
>
> "Jeff Jensen" <[EMAIL PROTECTED]>
> 29.03.2003 15:02
> Please respond to
> "Tomcat Users List" <[EMAIL PROTECTED]>
>
>
> To
> "'Tomcat Users List'" <[EMAIL PROTECTED]>
> cc
>
> Subject
> RE: Trouble with ant install command and ResourceLink
>
>
>
>
>
>
> I do not have an answer for your specific issue, but I found
> minor deploy
> issues with install, so I only use deploy and undeploy tasks
> and do not
> have
> any more issues.  Have you tried using deploy - did it have the same
> problems?
>
>
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > Sent: Friday, March 28, 2003 11:52 AM
> > To: Tomcat Users List
> > Subject: Trouble with ant install command and ResourceLink
> >
> >
> > hi there,
> >
> > In my /webapps/myapp.xml I'm using a ResourceLink:
> >   
> >
> > I'm using the manager app via ant to test my application.
> > After calling
> > ant remove
> > ant install
> >
> > it tells me the context has been installed OK.
> > However, it seems as if the ResourceLink has not been inited during
> > install, so it seems Tomcat doesn't read the
> /webapps/myapp.xml file.
> >
> > Sidenote: this problem is somewhat related to my
> > initparameter problem
> > outlined earlier today, but cannot be overcome as easily.
> >
> > has anybody overcome this issue?
> > is else using the ant manager task together with JNDI resourcelinks
> > successfully?
> >
> > thx
> > Johannes
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Where to store files in a portable app?

2003-03-29 Thread Jeff Jensen
Have property files that are loaded per OS type/deployment environment.
e.g. "build.dev.properties" & "build.prod.properties" or a set of
"build.${os.name}.properties" files (but then you have to do the deploy
process on the same OS as the deploy target).

So you can have a "${deploy.persist.dir}" property defined in each one, and
dependent on where you are deploying to.

If necessary, you can have a property defined in one file (that is loaded
first) and then use that in another property file.  e.g.:
${deploy.persist.base.dir} defined in build.dev.properties (& .prod.) and
then another like
"build.persist.dir=${build.persist.base.dir}/subdir/subdir" in
build.properties.


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Saturday, March 29, 2003 8:59 AM
> To: Tomcat Users List
> Subject: Re: Where to store files in a portable app?
>
>
> Hi Kaarle,
>
> Thx for the input.
> Unfortunately the development system is Windows and
> production system is
> Unix, so absolute paths will never be the same.
>
> Do you have any idea for how to manage properties files which will be
> different for windows than unix?
> Should I create a separate web_local and web_remote directory
> and make a
> simple ant copy task to distinguish production/development?
> Or is there a more elegant approach to this?
>
> thx alot
> Johannes
>
>
>
>
> Kaarle Kaila <[EMAIL PROTECTED]>
> 29.03.2003 15:41
> Please respond to
> "Tomcat Users List" <[EMAIL PROTECTED]>
>
>
> To
> "Tomcat Users List" <[EMAIL PROTECTED]>
> cc
>
> Subject
> Re: Where to store files in a portable app?
>
>
>
>
>
>
> At 15:35 29.3.2003 +0100, you wrote:
> >HI there,
> >
> >In my app I need to store files after a transaction is complete.
> >I want to keep my application portable, so where should I store such
> files
> >to??
>
> I would put the directory address for the files in a properties file
> (ResourceBundle)
> Then you can really put them anywhere you like.
>
> regards
> Kaarle
>
>
> >Should I use a /output/.. directory in the root area or
> where else could
> >be a smart location?
> >
> >Any ideas on this topic??
> >
> >thx alot
> >Johannes
>
> -
> Kaarle Kaila
> http://www.iki.fi/kaila
> mailto:[EMAIL PROTECTED]
> tel: +358 50 3725844
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: it's always the simplest things (redeploy)

2003-03-30 Thread Jeff Jensen
To get Tomcat to recognize the new deploy, the previous deploy has to not
exist!  It only recognizes a new war on its "first deploy".  So you have to
delete the previous files.

Manually, in webapps, first delete the war, then the respective exploded dir
hierarchy, and finally the respective dir in the work dir hierarchy.  Then
drop in the war in webapps (it's been awhile since I did a manual deploy, so
I am pretty sure that is what it took to get it going).  The key thing is
clearing the existing one all out so Tomcat will deploy the new one - if
anything is there in that context, then it will not.

With Ant, use the Tomcat "deploy" and "undeploy" tasks.  If previously
deployed by dropping the war in webapps, then manually delete as above
before the first use of "deploy" or there will be problems.  The Tomcat Ant
tasks are by far the easiest method I have found.

The 3 app servers I have used (WebSphere, WebLogic, and Tomcat) all do it
differently, behave differently, and have different side effects (or
features ;-).


> -Original Message-
> From: Dan Allen [mailto:[EMAIL PROTECTED]
> Sent: Saturday, March 29, 2003 11:33 PM
> To: [EMAIL PROTECTED]
> Subject: it's always the simplest things (redeploy)
>
>
> I can't for the life of me understand why this has to be so
> difficult.  It seems a major flaw of tomcat not to be able to simply
> redeploy and activate an application from a war file.  I have read many
> posts on the subject from the archives of this list and no one seems
> to have a definitive solution.  The solution just seems to be "just
> use resin for development, it actually works right, then just deploy
> on tomcat."  Since I have invested a great deal of time in tomcat, I
> wish not to give up this easily.
>
> In short, what does it take to drop a war into the webapps
> directory, overwriting a previous war and get tomcat to recognize
> the timestamp is newer and reissue the files so that you can see the
> changes when you visit the application in the browser?  I am tempted
> just to do my development directly inside the web container to avoid
> this issue all together, but that just doesn't seem to be the right
> way to go about things.
>
> Since this question comes up so often, maybe we can work out a full
> answer in this thread so that it doesn't have to be asked again.
>
> Dan
>
> --
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> Daniel Allen, <[EMAIL PROTECTED]>
> http://www.mojavelinux.com/
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> Microsoft's Law of Software Engineering:
> Don't worry if it doesn't work right.
> If everything did, we'd be out of a job.
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]