You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Peter Verhoye <pe...@synergetic-solutions.be> on 2005/07/01 11:31:22 UTC
Automatic deploy with ant and Tomcat 4.1.31
Hi,
I'm trying to use an Ant build script to deploy/install a war file to a
local Tomcat server. I've found and read the documentation.
The task I use is as follows:
<target name="tomcat.install" description="Installs the Web Application"
depends="package">
<echo message="Installing ${tomcat.app.name} ..."/>
<install url="${tomcat.manager.url}"
username="${tomcat.manager.username}"
password="${tomcat.manager.password}" path="/${tomcat.app.name}"
config="file:${basedir}/${assemble}/META-INF/context.xml"
war="file:${basedir}/${artifacts}/${war.file}"/>
</target>
Now, the war file to be installed is copied in the local work folder of
the manager application but the unzipping of the war file does not work
well. It seems only the WEB-INF directory gets unzipped, the other
files/folders are nowhere to be seen.
Anyway offer any help?
Thanks in advance,
Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Logging (Log4J) with Tomcat 4.1.x
Posted by Daniel Fanjul <da...@gmail.com>.
No, you have to put each application log4j.xml in each WEB-INF/classes or
WEB-INF/lib (in a jar)
The first time you declare a Logger in your app, log4j.xml is searched in
the ClassLoader; but, I donĀ“t know why (maybe some log4j initialization
static code), some log4j class is loaded by the Tomcat's Common ClassLoader,
not by your WebappX classloader.
Because of this, log4j.lib must be in the common dir.
The log4j.xml is loaded by the WebappX, so each application may have its
own log4j.xml. Each time you redeploy an application, the log4j.xml is
searched again.
2005/7/4, Peter Verhoye <pe...@synergetic-solutions.be>:
>
> > log4j lib must bin in the Tomcat's common/lib
>
> There are multiple webapps deployed on the server. Will adding log4j to
> common/lib not activate log for all of them?
>
> BB
> Peter
>
> >
> >
> > 2005/7/4, Anoop kumar V <an...@gmail.com>:
> >
> >>A log4j mailing list might give u a more effective answer....
> >>
> >>Try and change the appender to be ConsoleAppender (please check the
> >>name) - see if the output displays on the tomcat console.Then u can
> >>debug from there...
> >>
> >>HTH,
> >>Anoop
> >>
> >>On 7/4/05, Peter Verhoye <pe...@synergetic-solutions.be> wrote:
> >>
> >>>Hi all,
> >>>
> >>>I must be getting stupid or so but the logging in my webapp doesn't
> work
> >>>anymore.
> >>>
> >>>I've the log4j.properties file in WEB-INF/classes
> >>>log4j.jar is in WEB-INF/lib
> >>>
> >>>My properties are:
> >>>#
> >>># Configures Log4j as the Tomcat system logger
> >>>#
> >>>
> >>>#
> >>># Configure the logger to output info level messages into a rolling log
> >>>file.
> >>>#
> >>>log4j.rootLogger=DEBUG, R
> >>>
> >>>#
> >>># Configuration for a rolling log file ("tomcat.log").
> >>>#
> >>>log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
> >>>log4j.appender.R.DatePattern='.'yyyy-MM-dd
> >>>#
> >>># Edit the next line to point to your logs directory.
> >>># The last part of the name is the log file name.
> >>>#
> >>>
> log4j.appender.R.File=C:/data/apps/jakarta-tomcat-4.1.31/logs/tomcat.log
> >>>log4j.appender.R.layout=org.apache.log4j.PatternLayout
> >>>#
> >>># Print the date in ISO 8601 format
> >>>#
> >>>log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
> >>>
> >>>I don't see the tomcat.log file anywhere :(
> >>>
> >>>Someone has any idea?
> >>>
> >>>BB
> >>>Peter
> >>>
> >>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> >>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >>>
> >>>
> >>
> >>--
> >>Thanks and best regards,
> >>Anoop
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >>
> >>
> >
> >
>
> --
> Peter Verhoye
>
> Synergetic Solutions nv (www.synergetic-solutions.be<http://www.synergetic-solutions.be>
> )
> Crystal Palace
> Paalstraat 14
> B-1080 Brussel
> Tel : +32 (0)2 219.10.12
> Fax : +32 (0)2 219.40.28
> GSM : +32 (0)475 60.12.61
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
Re: Logging (Log4J) with Tomcat 4.1.x
Posted by Peter Verhoye <pe...@synergetic-solutions.be>.
> log4j lib must bin in the Tomcat's common/lib
There are multiple webapps deployed on the server. Will adding log4j to
common/lib not activate log for all of them?
BB
Peter
>
>
> 2005/7/4, Anoop kumar V <an...@gmail.com>:
>
>>A log4j mailing list might give u a more effective answer....
>>
>>Try and change the appender to be ConsoleAppender (please check the
>>name) - see if the output displays on the tomcat console.Then u can
>>debug from there...
>>
>>HTH,
>>Anoop
>>
>>On 7/4/05, Peter Verhoye <pe...@synergetic-solutions.be> wrote:
>>
>>>Hi all,
>>>
>>>I must be getting stupid or so but the logging in my webapp doesn't work
>>>anymore.
>>>
>>>I've the log4j.properties file in WEB-INF/classes
>>>log4j.jar is in WEB-INF/lib
>>>
>>>My properties are:
>>>#
>>># Configures Log4j as the Tomcat system logger
>>>#
>>>
>>>#
>>># Configure the logger to output info level messages into a rolling log
>>>file.
>>>#
>>>log4j.rootLogger=DEBUG, R
>>>
>>>#
>>># Configuration for a rolling log file ("tomcat.log").
>>>#
>>>log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
>>>log4j.appender.R.DatePattern='.'yyyy-MM-dd
>>>#
>>># Edit the next line to point to your logs directory.
>>># The last part of the name is the log file name.
>>>#
>>>log4j.appender.R.File=C:/data/apps/jakarta-tomcat-4.1.31/logs/tomcat.log
>>>log4j.appender.R.layout=org.apache.log4j.PatternLayout
>>>#
>>># Print the date in ISO 8601 format
>>>#
>>>log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
>>>
>>>I don't see the tomcat.log file anywhere :(
>>>
>>>Someone has any idea?
>>>
>>>BB
>>>Peter
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>>
>>>
>>
>>--
>>Thanks and best regards,
>>Anoop
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
>
>
--
Peter Verhoye
Synergetic Solutions nv (www.synergetic-solutions.be)
Crystal Palace
Paalstraat 14
B-1080 Brussel
Tel : +32 (0)2 219.10.12
Fax : +32 (0)2 219.40.28
GSM : +32 (0)475 60.12.61
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Logging (Log4J) with Tomcat 4.1.x
Posted by Daniel Fanjul <da...@gmail.com>.
log4j lib must bin in the Tomcat's common/lib
2005/7/4, Anoop kumar V <an...@gmail.com>:
>
> A log4j mailing list might give u a more effective answer....
>
> Try and change the appender to be ConsoleAppender (please check the
> name) - see if the output displays on the tomcat console.Then u can
> debug from there...
>
> HTH,
> Anoop
>
> On 7/4/05, Peter Verhoye <pe...@synergetic-solutions.be> wrote:
> > Hi all,
> >
> > I must be getting stupid or so but the logging in my webapp doesn't work
> > anymore.
> >
> > I've the log4j.properties file in WEB-INF/classes
> > log4j.jar is in WEB-INF/lib
> >
> > My properties are:
> > #
> > # Configures Log4j as the Tomcat system logger
> > #
> >
> > #
> > # Configure the logger to output info level messages into a rolling log
> > file.
> > #
> > log4j.rootLogger=DEBUG, R
> >
> > #
> > # Configuration for a rolling log file ("tomcat.log").
> > #
> > log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
> > log4j.appender.R.DatePattern='.'yyyy-MM-dd
> > #
> > # Edit the next line to point to your logs directory.
> > # The last part of the name is the log file name.
> > #
> > log4j.appender.R.File=C:/data/apps/jakarta-tomcat-4.1.31/logs/tomcat.log
> > log4j.appender.R.layout=org.apache.log4j.PatternLayout
> > #
> > # Print the date in ISO 8601 format
> > #
> > log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
> >
> > I don't see the tomcat.log file anywhere :(
> >
> > Someone has any idea?
> >
> > BB
> > Peter
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
> >
>
> --
> Thanks and best regards,
> Anoop
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
Re: Logging (Log4J) with Tomcat 4.1.x
Posted by Anoop kumar V <an...@gmail.com>.
A log4j mailing list might give u a more effective answer....
Try and change the appender to be ConsoleAppender (please check the
name) - see if the output displays on the tomcat console.Then u can
debug from there...
HTH,
Anoop
On 7/4/05, Peter Verhoye <pe...@synergetic-solutions.be> wrote:
> Hi all,
>
> I must be getting stupid or so but the logging in my webapp doesn't work
> anymore.
>
> I've the log4j.properties file in WEB-INF/classes
> log4j.jar is in WEB-INF/lib
>
> My properties are:
> #
> # Configures Log4j as the Tomcat system logger
> #
>
> #
> # Configure the logger to output info level messages into a rolling log
> file.
> #
> log4j.rootLogger=DEBUG, R
>
> #
> # Configuration for a rolling log file ("tomcat.log").
> #
> log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
> log4j.appender.R.DatePattern='.'yyyy-MM-dd
> #
> # Edit the next line to point to your logs directory.
> # The last part of the name is the log file name.
> #
> log4j.appender.R.File=C:/data/apps/jakarta-tomcat-4.1.31/logs/tomcat.log
> log4j.appender.R.layout=org.apache.log4j.PatternLayout
> #
> # Print the date in ISO 8601 format
> #
> log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
>
> I don't see the tomcat.log file anywhere :(
>
> Someone has any idea?
>
> BB
> Peter
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
--
Thanks and best regards,
Anoop
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Logging (Log4J) with Tomcat 4.1.x
Posted by Peter Verhoye <pe...@synergetic-solutions.be>.
Hi all,
I must be getting stupid or so but the logging in my webapp doesn't work
anymore.
I've the log4j.properties file in WEB-INF/classes
log4j.jar is in WEB-INF/lib
My properties are:
#
# Configures Log4j as the Tomcat system logger
#
#
# Configure the logger to output info level messages into a rolling log
file.
#
log4j.rootLogger=DEBUG, R
#
# Configuration for a rolling log file ("tomcat.log").
#
log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
log4j.appender.R.DatePattern='.'yyyy-MM-dd
#
# Edit the next line to point to your logs directory.
# The last part of the name is the log file name.
#
log4j.appender.R.File=C:/data/apps/jakarta-tomcat-4.1.31/logs/tomcat.log
log4j.appender.R.layout=org.apache.log4j.PatternLayout
#
# Print the date in ISO 8601 format
#
log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
I don't see the tomcat.log file anywhere :(
Someone has any idea?
BB
Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Authentication using Apache Httpd and Tomcat
Posted by Peter Verhoye <pe...@synergetic-solutions.be>.
Hi,
Next to my first problem, I also have the following (sorry to bother the
list with this but I'm leaving on holiday next week and some PM shoved
this task on my lap :S)
We have the following local setup:
Apache 2.0 --- Tomcat 4.1.31
On Tomcat, we have several applications called app1, app2, app3.
Now, we want a basic authentication scheme (later they probably want
something more but that's for then :-) where, when a user enters the URL
http://localhost/app1 he gets immediately a challenge request box for
login.
Now, how should I do this?
BB
Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Automatic deploy with ant and Tomcat 4.1.31
Posted by Peter Verhoye <pe...@synergetic-solutions.be>.
> the tomcat deploy task doesn't build the war, it only deploys it, so
> unlikely that it is at fault. Have you checked the war manually to
> ensure it unzips normally with some zip util?
>
> also the unzipping is not really "done" by the deploy task - but is
> something that tomcat does at some point as part of its process of
> deploying a war.
The war file is correct. This is indeed doen in another task. And I've
checked it manually. And the copy of the warfile (in the work
CATALINA_HOME\work\Standalone\localhost\manager directory) is also
correct (I guess it's basically a copy).
Now, I do have to mention that I'm working on windows, so maybe this has
something to do with it.
Anyway, when I use the manager page to upload the war file, it works
like a charm. So noting wrogn there either.
Also, according to the docs, there should be a difference between the
install and the deploy tasks. But both 'deploy' the same directory (the
mentioned above).
BB
Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Automatic deploy with ant and Tomcat 4.1.31
Posted by Tim Diggins <su...@red56.co.uk>.
the tomcat deploy task doesn't build the war, it only deploys it, so
unlikely that it is at fault. Have you checked the war manually to
ensure it unzips normally with some zip util?
also the unzipping is not really "done" by the deploy task - but is
something that tomcat does at some point as part of its process of
deploying a war.
--Tim
Peter Verhoye wrote:
> Hi,
>
> I'm trying to use an Ant build script to deploy/install a war file to a
> local Tomcat server. I've found and read the documentation.
>
> The task I use is as follows:
>
> <target name="tomcat.install" description="Installs the Web Application"
> depends="package">
> <echo message="Installing ${tomcat.app.name} ..."/>
> <install url="${tomcat.manager.url}"
> username="${tomcat.manager.username}"
> password="${tomcat.manager.password}" path="/${tomcat.app.name}"
> config="file:${basedir}/${assemble}/META-INF/context.xml"
> war="file:${basedir}/${artifacts}/${war.file}"/>
> </target>
>
> Now, the war file to be installed is copied in the local work folder of
> the manager application but the unzipping of the war file does not work
> well. It seems only the WEB-INF directory gets unzipped, the other
> files/folders are nowhere to be seen.
>
> Anyway offer any help?
>
> Thanks in advance,
>
> Peter
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org