Re: Massive Startup Time after Server Reboot

2019-05-21 Thread Jerry Malcolm
It's currently automatic.  I'll try delayed-start tonight and see if 
there are changes.


Thx

On 5/21/2019 1:21 PM, Suvendu Sekhar Mondal wrote:

Jerry,


On Tue, May 21, 2019, 10:55 PM Jerry Malcolm 
Update I totally disabled Windows Real Time Virus protection.
Apparently it was 'one' of the problems.  However...

Original startup after reboot (with WIndows Real Time Virus scan) -- ~21
minutes

With Windows Real Time Virus scan totally disabled immediately after
reboot -- ~3 minutes


Wow!


Second TC startup -- ~35 seconds.

3 minutes beats 21 minutes, and I guess I can live with it.  But there's
still something else slowing it down on the first startup after system
reboot.   I'll see about getting some stack dumps.


May I know what is the startup type of Tomcat service? If it is
'automatic', can you please try with 'automatic delayed start'?


Thanks for the help.

Jerry


On 5/21/2019 9:55 AM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jerry,

On 5/20/19 14:05, Jerry Malcolm wrote:

Andre,

Your theory sounds like a real possibility.  It would explain why
it only blows up the first time after a reboot.  I'll test the
theory tonight during off-peak use hours for the web sites I host.

If André's theory is correct, you will probably find that 2-3 months
ago the version of your virus scanner was upgraded, and all of the
whitelisted applications (like Tomcat) were lost.

If that's the case, you can probably re-whitelist Tomcat and get your
performance back. At least until the next upgrade.

- -chris


On 5/20/2019 3:43 AM, André Warnier (tomcat) wrote:

On 20.05.2019 00:09, Jerry Malcolm wrote:

Just an FYI this server has been in production a little
over a year.  This TC load problem only started 2-3 months ago.
So 'something' changed to cause this problem to manifest
itself. It's been too long to try to correlate a specific
server change to the start of this problem. But I just wanted
to point out that this problem has NOT been around since day 1
on this server.

Just in case, since this is a Windows server .. 2-3 months ago,
an update of a virus scanner ? (of the intrusive kind which
pre-checks each file that wants to be opened) Checking may be
easy or not, depending on your access : disable the virus scanner
just the time to start tomcat and check.


Jerry

On 5/19/2019 5:03 PM, Jerry Malcolm wrote:

Rainer,

No change with the urandom parm.  I am attaching a portion of
the Catalina log.  The first half shows between 8 and 15
seconds to deploy each app for a single virtual host (there
are no war files, the app is already exploded in the appbase
dir).  I have quite a few virtual hosts with several apps
each.  That initial server start took 21+ minutes. I then
restarted the TC service and got the ~.5 sec start per webapp
shown in the 2nd half of the log below.

Can you refresh me on how to capture the stack dumps you
suggested? It's been a while

Thx.

Jerry

First start of Tomcat after server reboot
---

- --
[C:\domains\.com\webapps\JSPWiki.war] has finished in

[8,579] ms tory [C:\domains\.com\webapps\cis]
irectory [C:\domains\.com\webapps\cis] has finished
in [11,486] ms tory
[C:\domains\.com\webapps\gallery] irectory
[C:\domains\.com\webapps\gallery] has finished in
[9,204] ms tory [C:\domains\.com\webapps\gl]
irectory [C:\domains\.com\webapps\gl] has finished
in [8,469] ms tory
[C:\domains\.com\webapps\idmanager] irectory
[C:\domains\.com\webapps\idmanager] has finished in
[8,689] ms tory
[C:\domains\.com\webapps\itemtrack] irectory
[C:\domains\.com\webapps\itemtrack] has finished in
[6,907] ms tory
[C:\domains\.com\webapps\malcolment] irectory
[C:\domains\.com\webapps\malcolment] has finished
in [8,469] ms tory
[C:\domains\.com\webapps\notebook] irectory
[C:\domains\.com\webapps\notebook] has finished in
[10,189] ms tory [C:\domains\.com\webapps\order]
irectory [C:\domains\.com\webapps\order] has
finished in [8,501] ms tory
[C:\domains\.com\webapps\payment] irectory
[C:\domains\.com\webapps\payment] has finished in
[14,209] ms tory
[C:\domains\.com\webapps\projectmanager] irectory
[C:\domains\.com\webapps\projectmanager] has
finished in [9,018] ms [C:\Tomcat
9.0\conf\Catalina\myridetx.net\manager.xml] ptor [C:\Tomcat
9.0\conf\Catalina\myridetx.net\manager.xml] has finished in
[62] ms

Restart of Tomcat
---

- --
tory [C:\domains\.com\webapps\cis]

irectory [C:\domains\.com\webapps\cis] has finished
in [594] ms tory [C:\domains\.com\webapps\gallery]
irectory [C:\domains\.com\webapps\gallery] has
finished in [547] ms tory
[C:\domains\.com\webapps\gl] irectory
[C:\domains\.com\webapps\gl] has finished in [562]
ms tory [C:\domains\.com\webapps\idmanager]
irectory [C:\domains\.com\webapps\idmanager] has
finished in [578] ms tory
[C:\domains\.com\webapps\itemtrack] irectory
[C:\domains\.com\webapps\itemtrack] has finished in

Re: Massive Startup Time after Server Reboot

2019-05-21 Thread Suvendu Sekhar Mondal
Jerry,


On Tue, May 21, 2019, 10:55 PM Jerry Malcolm  Update I totally disabled Windows Real Time Virus protection.
> Apparently it was 'one' of the problems.  However...
>
> Original startup after reboot (with WIndows Real Time Virus scan) -- ~21
> minutes
>
> With Windows Real Time Virus scan totally disabled immediately after
> reboot -- ~3 minutes
>

Wow!

>
> Second TC startup -- ~35 seconds.
>
> 3 minutes beats 21 minutes, and I guess I can live with it.  But there's
> still something else slowing it down on the first startup after system
> reboot.   I'll see about getting some stack dumps.
>

May I know what is the startup type of Tomcat service? If it is
'automatic', can you please try with 'automatic delayed start'?

>
> Thanks for the help.
>
> Jerry
>
>
> On 5/21/2019 9:55 AM, Christopher Schultz wrote:
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA256
> >
> > Jerry,
> >
> > On 5/20/19 14:05, Jerry Malcolm wrote:
> >> Andre,
> >>
> >> Your theory sounds like a real possibility.  It would explain why
> >> it only blows up the first time after a reboot.  I'll test the
> >> theory tonight during off-peak use hours for the web sites I host.
> > If André's theory is correct, you will probably find that 2-3 months
> > ago the version of your virus scanner was upgraded, and all of the
> > whitelisted applications (like Tomcat) were lost.
> >
> > If that's the case, you can probably re-whitelist Tomcat and get your
> > performance back. At least until the next upgrade.
> >
> > - -chris
> >
> >> On 5/20/2019 3:43 AM, André Warnier (tomcat) wrote:
> >>> On 20.05.2019 00:09, Jerry Malcolm wrote:
>  Just an FYI this server has been in production a little
>  over a year.  This TC load problem only started 2-3 months ago.
>  So 'something' changed to cause this problem to manifest
>  itself. It's been too long to try to correlate a specific
>  server change to the start of this problem. But I just wanted
>  to point out that this problem has NOT been around since day 1
>  on this server.
> >>> Just in case, since this is a Windows server .. 2-3 months ago,
> >>> an update of a virus scanner ? (of the intrusive kind which
> >>> pre-checks each file that wants to be opened) Checking may be
> >>> easy or not, depending on your access : disable the virus scanner
> >>> just the time to start tomcat and check.
> >>>
>  Jerry
> 
>  On 5/19/2019 5:03 PM, Jerry Malcolm wrote:
> > Rainer,
> >
> > No change with the urandom parm.  I am attaching a portion of
> > the Catalina log.  The first half shows between 8 and 15
> > seconds to deploy each app for a single virtual host (there
> > are no war files, the app is already exploded in the appbase
> > dir).  I have quite a few virtual hosts with several apps
> > each.  That initial server start took 21+ minutes. I then
> > restarted the TC service and got the ~.5 sec start per webapp
> > shown in the 2nd half of the log below.
> >
> > Can you refresh me on how to capture the stack dumps you
> > suggested? It's been a while
> >
> > Thx.
> >
> > Jerry
> >
> > First start of Tomcat after server reboot
> > ---
> > - --
> >
> > [C:\domains\.com\webapps\JSPWiki.war] has finished in
> > [8,579] ms tory [C:\domains\.com\webapps\cis]
> > irectory [C:\domains\.com\webapps\cis] has finished
> > in [11,486] ms tory
> > [C:\domains\.com\webapps\gallery] irectory
> > [C:\domains\.com\webapps\gallery] has finished in
> > [9,204] ms tory [C:\domains\.com\webapps\gl]
> > irectory [C:\domains\.com\webapps\gl] has finished
> > in [8,469] ms tory
> > [C:\domains\.com\webapps\idmanager] irectory
> > [C:\domains\.com\webapps\idmanager] has finished in
> > [8,689] ms tory
> > [C:\domains\.com\webapps\itemtrack] irectory
> > [C:\domains\.com\webapps\itemtrack] has finished in
> > [6,907] ms tory
> > [C:\domains\.com\webapps\malcolment] irectory
> > [C:\domains\.com\webapps\malcolment] has finished
> > in [8,469] ms tory
> > [C:\domains\.com\webapps\notebook] irectory
> > [C:\domains\.com\webapps\notebook] has finished in
> > [10,189] ms tory [C:\domains\.com\webapps\order]
> > irectory [C:\domains\.com\webapps\order] has
> > finished in [8,501] ms tory
> > [C:\domains\.com\webapps\payment] irectory
> > [C:\domains\.com\webapps\payment] has finished in
> > [14,209] ms tory
> > [C:\domains\.com\webapps\projectmanager] irectory
> > [C:\domains\.com\webapps\projectmanager] has
> > finished in [9,018] ms [C:\Tomcat
> > 9.0\conf\Catalina\myridetx.net\manager.xml] ptor [C:\Tomcat
> > 9.0\conf\Catalina\myridetx.net\manager.xml] has finished in
> > [62] ms
> >
> > Restart of Tomcat
> > ---
> > - --
> 

Re: Running sudo from a servlet

2019-05-21 Thread Claude Brisson

(responding to myself)

The culprit is the option

    NoNewPrivileges=true

in the file /etc/systemd/system/multi-user.target.wants/tomcat8.service

When changed to false, one must also call 'systemctl daemon-reload' and 
after a tomcat restart, the problem is solved.



  Claude

On 21/05/2019 19:52, Claude Brisson wrote:

Hi all.

I use tomcat 8.5.39 and java oracle 1.8.0_191 on linux (ubuntu 19.04). 
Tomcat was installed by apt-get and runs as a service.


If I open a shell as the tomcat8 user, I can launch a Java program 
which successfully executes a sudo command in a sub-process.


But from a Java servlet, the code fails with this error from the sudo 
executable:


    sudo: effective uid is not 0, is /usr/bin/sudo on a file system 
with the 'nosuid' option set or an NFS file system without root 
privileges?


which means that somehow, the tomcat process was unable or unwilling 
to honor the setuid flag of the sudo command.


Is it a special security measure ?

If yes, is it set in tomcat ? in the JVM ? In Ubuntu's tomcat8 service 
packaging? In systemd config?


And is there any configuration option to relax it?

Thanks,

  Claude



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Running sudo from a servlet

2019-05-21 Thread Claude Brisson

Hi all.

I use tomcat 8.5.39 and java oracle 1.8.0_191 on linux (ubuntu 19.04). 
Tomcat was installed by apt-get and runs as a service.


If I open a shell as the tomcat8 user, I can launch a Java program which 
successfully executes a sudo command in a sub-process.


But from a Java servlet, the code fails with this error from the sudo 
executable:


    sudo: effective uid is not 0, is /usr/bin/sudo on a file system 
with the 'nosuid' option set or an NFS file system without root privileges?


which means that somehow, the tomcat process was unable or unwilling to 
honor the setuid flag of the sudo command.


Is it a special security measure ?

If yes, is it set in tomcat ? in the JVM ? In Ubuntu's tomcat8 service 
packaging? In systemd config?


And is there any configuration option to relax it?

Thanks,

  Claude



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Massive Startup Time after Server Reboot

2019-05-21 Thread Jerry Malcolm
Update I totally disabled Windows Real Time Virus protection.  
Apparently it was 'one' of the problems.  However...


Original startup after reboot (with WIndows Real Time Virus scan) -- ~21 
minutes


With Windows Real Time Virus scan totally disabled immediately after 
reboot -- ~3 minutes


Second TC startup -- ~35 seconds.

3 minutes beats 21 minutes, and I guess I can live with it.  But there's 
still something else slowing it down on the first startup after system 
reboot.   I'll see about getting some stack dumps.


Thanks for the help.

Jerry


On 5/21/2019 9:55 AM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jerry,

On 5/20/19 14:05, Jerry Malcolm wrote:

Andre,

Your theory sounds like a real possibility.  It would explain why
it only blows up the first time after a reboot.  I'll test the
theory tonight during off-peak use hours for the web sites I host.

If André's theory is correct, you will probably find that 2-3 months
ago the version of your virus scanner was upgraded, and all of the
whitelisted applications (like Tomcat) were lost.

If that's the case, you can probably re-whitelist Tomcat and get your
performance back. At least until the next upgrade.

- -chris


On 5/20/2019 3:43 AM, André Warnier (tomcat) wrote:

On 20.05.2019 00:09, Jerry Malcolm wrote:

Just an FYI this server has been in production a little
over a year.  This TC load problem only started 2-3 months ago.
So 'something' changed to cause this problem to manifest
itself. It's been too long to try to correlate a specific
server change to the start of this problem. But I just wanted
to point out that this problem has NOT been around since day 1
on this server.

Just in case, since this is a Windows server .. 2-3 months ago,
an update of a virus scanner ? (of the intrusive kind which
pre-checks each file that wants to be opened) Checking may be
easy or not, depending on your access : disable the virus scanner
just the time to start tomcat and check.


Jerry

On 5/19/2019 5:03 PM, Jerry Malcolm wrote:

Rainer,

No change with the urandom parm.  I am attaching a portion of
the Catalina log.  The first half shows between 8 and 15
seconds to deploy each app for a single virtual host (there
are no war files, the app is already exploded in the appbase
dir).  I have quite a few virtual hosts with several apps
each.  That initial server start took 21+ minutes. I then
restarted the TC service and got the ~.5 sec start per webapp
shown in the 2nd half of the log below.

Can you refresh me on how to capture the stack dumps you
suggested? It's been a while

Thx.

Jerry

First start of Tomcat after server reboot
---

- --



[C:\domains\.com\webapps\JSPWiki.war] has finished in

[8,579] ms tory [C:\domains\.com\webapps\cis]
irectory [C:\domains\.com\webapps\cis] has finished
in [11,486] ms tory
[C:\domains\.com\webapps\gallery] irectory
[C:\domains\.com\webapps\gallery] has finished in
[9,204] ms tory [C:\domains\.com\webapps\gl]
irectory [C:\domains\.com\webapps\gl] has finished
in [8,469] ms tory
[C:\domains\.com\webapps\idmanager] irectory
[C:\domains\.com\webapps\idmanager] has finished in
[8,689] ms tory
[C:\domains\.com\webapps\itemtrack] irectory
[C:\domains\.com\webapps\itemtrack] has finished in
[6,907] ms tory
[C:\domains\.com\webapps\malcolment] irectory
[C:\domains\.com\webapps\malcolment] has finished
in [8,469] ms tory
[C:\domains\.com\webapps\notebook] irectory
[C:\domains\.com\webapps\notebook] has finished in
[10,189] ms tory [C:\domains\.com\webapps\order]
irectory [C:\domains\.com\webapps\order] has
finished in [8,501] ms tory
[C:\domains\.com\webapps\payment] irectory
[C:\domains\.com\webapps\payment] has finished in
[14,209] ms tory
[C:\domains\.com\webapps\projectmanager] irectory
[C:\domains\.com\webapps\projectmanager] has
finished in [9,018] ms [C:\Tomcat
9.0\conf\Catalina\myridetx.net\manager.xml] ptor [C:\Tomcat
9.0\conf\Catalina\myridetx.net\manager.xml] has finished in
[62] ms

Restart of Tomcat
---

- --



tory [C:\domains\.com\webapps\cis]

irectory [C:\domains\.com\webapps\cis] has finished
in [594] ms tory [C:\domains\.com\webapps\gallery]
irectory [C:\domains\.com\webapps\gallery] has
finished in [547] ms tory
[C:\domains\.com\webapps\gl] irectory
[C:\domains\.com\webapps\gl] has finished in [562]
ms tory [C:\domains\.com\webapps\idmanager]
irectory [C:\domains\.com\webapps\idmanager] has
finished in [578] ms tory
[C:\domains\.com\webapps\itemtrack] irectory
[C:\domains\.com\webapps\itemtrack] has finished in
[547] ms tory [C:\domains\.com\webapps\malcolment]
irectory [C:\domains\.com\webapps\malcolment] has
finished in [579] ms tory
[C:\domains\.com\webapps\notebook] irectory
[C:\domains\.com\webapps\notebook] has finished in
[547] ms tory [C:\domains\.com\webapps\order]
irectory [C:\domains\.com\webapps\order] has
finished in 

Re: distinction between resource charset and format octet decoding

2019-05-21 Thread Garret Wilson
Sorry to bring up the non-UTF-8 escaped octets form POST problem again, 
but …


On 1/8/2019 3:57 PM, Mark Thomas wrote:

…
As of Servlet 4.0 there is a specification compliant configuration 
option to change this default to any encoding of your choice. 
Obviously, UTF-8 is one of the options. You can do this by adding the 
following to your web.xml:


UTF-8

If you add it to conf/web.xml it applies to every web application 
deployed to Tomcat.


Tomcat 9 uses this in the examples, manager and host-manager 
applications in place of the SetCharacterEncodingFilter.



As you know I've already updated the Tomcat FAQ with the options for 
forcing Tomcat to interpret form POSTs with any escaped characters using 
UTF-8 octet sequences (as modern browsers send, and as HTML5 requires) 
instead of ISO-8859-1 (as the Servlet 4 spec says).


But the problem is worse with the Spring community. If someone is using 
Spring Boot to create an executable JAR/WAR using embedded tomcat, 
Spring Boot does something to configure Tomcat to send the POSTs 
correctly (that is, as the modern web likes it, not like the Servlet 4 
spec says). Unfortunately, if I use Spring Boot to make a WAR which is 
both a self-contained executing WAR /and/ a WAR deployable on Tomcat, 
when I deploy the WAR on Tomcat the encoded characters are using escaped 
ISO-8859-1 octets, so my web app breaks. Yes, the WAR runs differently 
if using Spring Boot embedded Tomcat or deployed on standalone Tomcat as 
a WAR.


Spring Boot ignores any `web.xml` file. I guess I could create a 
`web.xml` file only for standalone Tomcat, but then this freezes Eclipse 
(as I posted elsewhere) because Eclipse doesn't understand 
``. So like so many things on the web, this 
is a mess.


This is a serious issue, in my opinion. The Servlet 4 specification is 
out of step with everything else in the ecosystem!


Whether Tomcat should ship with this setting present in conf/web.xml 
by default is something that should probably be discussed for Tomcat 
10. Given the current state of the web, there is a reasonable case for 
doing so. I'll add that to the TOMCAT-NEXT discussion list.


Yes, can I just re-second (third?) that motion, and underscore the need 
for this to be changed in Tomcat 10?


Thanks,

Garret



Re: Configuring log format for console output (catalina.out)

2019-05-21 Thread Joan
Thanks a lot for your answer Chris

> > I am trying to forward the logs generated on a server to a
> > centralized log collector (using rsyslog), one of the features I
> > would like to use the ability to group messages by using their
> > timestamp as the start of the message. By reading the documentation
> > at https://tomcat.apache.org/tomcat-9.0-doc/logging.html#Console, I
> > can't see the proper way to  get a common format (preferably with
> > timestamp), or ar tleast save the outputs into three different
> > types in different files?
>
> I think you are being confused by the fact that the default log
> pattern contains a newline character. For example, these are the first
> two entries in my local catalina.out file:
>
> Apr 12, 2019 1:55:03 PM org.apache.coyote.AbstractProtocol init
> INFO: Initializing ProtocolHandler ["ajp-nio-8215"]
> Apr 12, 2019 1:55:03 PM org.apache.tomcat.util.net.NioSelectorPool
> getSharedSelector
> INFO: Using a shared selector for servlet write/read
> Apr 12, 2019 1:55:03 PM org.apache.coyote.AbstractProtocol init
>
> (Apologies for the word-wrapping)
>
> The first entry is [Apr 12, 2019 1:55:03 PM] and the text ends with
> ["ajp-nio-8215"]
>
> The second entry has the same timestmp and the text ends with
> "AbstractProtocol init"
>
> Stack traces are always impossible to handle when looking at the
> resulting file, since they almost always span multiple lines of text
> - -- that is, they have embedded newlines in the message.
>
> Are you asking about how to make sense of the log file, how to send
> log messages to a central server, or how to coalesce log messages by
> timestamp?
>

Rsyslog allows to read multiline messages by matching a regular expression
(see
https://www.rsyslog.com/doc/v8-stable/configuration/modules/imfile.html#startmsg-regex),
this allow the messages to be forwarded to a third party (graylog,
logstash, ..) as a a single message.
So my intention would be to be able to make all the messages to start with
a timestamp (or a defined format)

After your message I undertand that this is a single message (I didn't
realize it) and all the messages in catalina.out are obeying the same
format. Being the next lines a single message, am I right?

19-May-2019 06:25:20.937 INFO [localhost-startStop-1]
> org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned
> for TLDs yet contained no TLDs. Enable debug logging for this logger for a
> comple
> te list of JARs that were scanned but no TLDs were found in them. Skipping
> unneeded JARs during scanning can improve startup time and JSP compilation
> time.
> [ERROR] Unable to find config file.  Creating new servlet engine config
> file: /WEB-INF/server-config.wsdd
> [WARN] Web application uses
> org.apache.axis2.transport.http.AxisAdminServlet; please update web.xml to
> use org.apache.axis2.webapp.AxisAdminServlet instead
> [WARN] Unable to load manifest for StAX implementation at jrt:/java.xml/
> [INFO] Clustering has been disabled
>


Thanks,

Joan

>
>


Re: Massive Startup Time after Server Reboot

2019-05-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jerry,

On 5/20/19 14:05, Jerry Malcolm wrote:
> Andre,
> 
> Your theory sounds like a real possibility.  It would explain why
> it only blows up the first time after a reboot.  I'll test the
> theory tonight during off-peak use hours for the web sites I host.

If André's theory is correct, you will probably find that 2-3 months
ago the version of your virus scanner was upgraded, and all of the
whitelisted applications (like Tomcat) were lost.

If that's the case, you can probably re-whitelist Tomcat and get your
performance back. At least until the next upgrade.

- -chris

> On 5/20/2019 3:43 AM, André Warnier (tomcat) wrote:
>> On 20.05.2019 00:09, Jerry Malcolm wrote:
>>> Just an FYI this server has been in production a little
>>> over a year.  This TC load problem only started 2-3 months ago.
>>> So 'something' changed to cause this problem to manifest
>>> itself. It's been too long to try to correlate a specific 
>>> server change to the start of this problem. But I just wanted
>>> to point out that this problem has NOT been around since day 1
>>> on this server.
>> 
>> Just in case, since this is a Windows server .. 2-3 months ago,
>> an update of a virus scanner ? (of the intrusive kind which
>> pre-checks each file that wants to be opened) Checking may be
>> easy or not, depending on your access : disable the virus scanner
>> just the time to start tomcat and check.
>> 
>>> 
>>> Jerry
>>> 
>>> On 5/19/2019 5:03 PM, Jerry Malcolm wrote:
 Rainer,
 
 No change with the urandom parm.  I am attaching a portion of
 the Catalina log.  The first half shows between 8 and 15
 seconds to deploy each app for a single virtual host (there
 are no war files, the app is already exploded in the appbase 
 dir).  I have quite a few virtual hosts with several apps
 each.  That initial server start took 21+ minutes. I then
 restarted the TC service and got the ~.5 sec start per webapp
 shown in the 2nd half of the log below.
 
 Can you refresh me on how to capture the stack dumps you
 suggested? It's been a while
 
 Thx.
 
 Jerry
 
 First start of Tomcat after server reboot 
 ---
- --

 
[C:\domains\.com\webapps\JSPWiki.war] has finished in
 [8,579] ms tory [C:\domains\.com\webapps\cis] 
 irectory [C:\domains\.com\webapps\cis] has finished
 in [11,486] ms tory
 [C:\domains\.com\webapps\gallery] irectory
 [C:\domains\.com\webapps\gallery] has finished in 
 [9,204] ms tory [C:\domains\.com\webapps\gl] 
 irectory [C:\domains\.com\webapps\gl] has finished
 in [8,469] ms tory
 [C:\domains\.com\webapps\idmanager] irectory
 [C:\domains\.com\webapps\idmanager] has finished in
 [8,689] ms tory
 [C:\domains\.com\webapps\itemtrack] irectory
 [C:\domains\.com\webapps\itemtrack] has finished in
 [6,907] ms tory
 [C:\domains\.com\webapps\malcolment] irectory
 [C:\domains\.com\webapps\malcolment] has finished 
 in [8,469] ms tory
 [C:\domains\.com\webapps\notebook] irectory
 [C:\domains\.com\webapps\notebook] has finished in
 [10,189] ms tory [C:\domains\.com\webapps\order] 
 irectory [C:\domains\.com\webapps\order] has
 finished in [8,501] ms tory
 [C:\domains\.com\webapps\payment] irectory
 [C:\domains\.com\webapps\payment] has finished in 
 [14,209] ms tory
 [C:\domains\.com\webapps\projectmanager] irectory
 [C:\domains\.com\webapps\projectmanager] has 
 finished in [9,018] ms [C:\Tomcat
 9.0\conf\Catalina\myridetx.net\manager.xml] ptor [C:\Tomcat
 9.0\conf\Catalina\myridetx.net\manager.xml] has finished in
 [62] ms
 
 Restart of Tomcat 
 ---
- --

 
tory [C:\domains\.com\webapps\cis]
 irectory [C:\domains\.com\webapps\cis] has finished
 in [594] ms tory [C:\domains\.com\webapps\gallery] 
 irectory [C:\domains\.com\webapps\gallery] has
 finished in [547] ms tory
 [C:\domains\.com\webapps\gl] irectory
 [C:\domains\.com\webapps\gl] has finished in [562]
 ms tory [C:\domains\.com\webapps\idmanager] 
 irectory [C:\domains\.com\webapps\idmanager] has
 finished in [578] ms tory
 [C:\domains\.com\webapps\itemtrack] irectory
 [C:\domains\.com\webapps\itemtrack] has finished in
 [547] ms tory [C:\domains\.com\webapps\malcolment] 
 irectory [C:\domains\.com\webapps\malcolment] has
 finished in [579] ms tory
 [C:\domains\.com\webapps\notebook] irectory
 [C:\domains\.com\webapps\notebook] has finished in
 [547] ms tory [C:\domains\.com\webapps\order] 
 irectory [C:\domains\.com\webapps\order] has
 finished in [531] ms tory
 [C:\domains\.com\webapps\payment] irectory
 [C:\domains\.com\webapps\payment] has finished in 
 [562] ms tory
 

Re: Configuring log format for console output (catalina.out)

2019-05-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Joan,

On 5/21/19 09:11, Joan wrote:
> Hi all,
> 
> I am trying to forward the logs generated on a server to a
> centralized log collector (using rsyslog), one of the features I
> would like to use the ability to group messages by using their
> timestamp as the start of the message. By reading the documentation
> at https://tomcat.apache.org/tomcat-9.0-doc/logging.html#Console, I
> can't see the proper way to  get a common format (preferably with
> timestamp), or ar tleast save the outputs into three different
> types in different files?

I think you are being confused by the fact that the default log
pattern contains a newline character. For example, these are the first
two entries in my local catalina.out file:

Apr 12, 2019 1:55:03 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8215"]
Apr 12, 2019 1:55:03 PM org.apache.tomcat.util.net.NioSelectorPool
getSharedSelector
INFO: Using a shared selector for servlet write/read
Apr 12, 2019 1:55:03 PM org.apache.coyote.AbstractProtocol init

(Apologies for the word-wrapping)

The first entry is [Apr 12, 2019 1:55:03 PM] and the text ends with
["ajp-nio-8215"]

The second entry has the same timestmp and the text ends with
"AbstractProtocol init"

Stack traces are always impossible to handle when looking at the
resulting file, since they almost always span multiple lines of text
- -- that is, they have embedded newlines in the message.

Are you asking about how to make sense of the log file, how to send
log messages to a central server, or how to coalesce log messages by
timestamp?

- -chris
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlzkEO8ACgkQHPApP6U8
pFg8EA/+KsH4JGirKakL+/OxqAz1W7T7MoR2QE9Y1Tk26FL6XI+VITk11gqLegH5
yx3zwmXLS9v2XilppnSvRB9xPd073Uf4v0NPSjCt1vSY7obPHYcRSIuA43QU9Pqb
7pEgxuGn+uUifRRK+DLd6Wcd3IkFo2hfKG/YHFL5McKxqsrEvPsspWU7uLRHoKML
BR1MM5iKbsiBEJfncfyZqeGY2Yq4HOarcp//iv5bC20RgakLxlSjiWAyJqC77PKH
3dy9XaV/VyQpjEQe8/ADt1NqhF6qBVj/KcKeA41AAwL7grxX0R23ZeSQsKJeulgf
jnXcK8mHWXs4Dybu7hhUbkS47whbfW6M3H4ZhGYutsoOB58shzbVR0MUtEYlOBMg
GbpCt5xPW6NZ5LMbEDTMlQW95XBnrLdxe8dFdTo+qgEdSoe3o4mdvGUtrlgAxZlq
Ay28U+/maI84StrScDwfC96chakdaGj/4CxyFwoj+5uVeeiBbglubR1gCghqVjM7
MQWDKrTACmcEu4ZbLy1sgNtBb/xjCYRtp05JrB531E9Py7//f6qprIKjAYOBLcxF
uWDKP204C3UlC3/mQt6Ewd6QzQM0xCXPm0k+6817wf3xIaN/aST4R0kbR0OjkB6F
CfAm8Qf2FVgRHOP4zzKHvm82wjET2FJmcw38do2ki89yml1iKXg=
=UolI
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Usage of Tomcat Logo combined with own logo.

2019-05-21 Thread bernd . schatz
Hi,

We created a library that offers an easy integration in our internal oidc 
infrastructure.
It is based on jaspic so it would work on any application server that support 
it,
But we want to push the use of open source application server like tomcat
Instead of closed source application server.

Therefore we want to advertise with an internal ,,Java Free and Open Source''
Logo combined with a small tomcat logo inside, is this allowed?

The logo will be used in te intranet but will be also visible 
For all suppliers that work for us.

Thx in advance.

-- 
Mit freundlichen Grüßen / Kind Regards/ नमस्ते(Namaste)
Bernd Schatz
ITI/FT - CoC Enterprise Platforms Services (PAI)
HPC Z252
Gebäude VDZ Ost 1.OG
Plieninger Str. 150
70567 Stuttgart

Bernd Schatz
Büro: +49 711 17 41463
Mobile: +49 151 5862 6591
FAX: +49 711 17 7904 1252
mailto:bernd.sch...@daimler.com 
https://matter.i.daimler.com



openpgp-digital-signature.asc
Description: PGP signature


Configuring log format for console output (catalina.out)

2019-05-21 Thread Joan
Hi all,

I am trying to forward the logs generated on a server to a centralized log
collector (using rsyslog), one of the features I would like to use the
ability to group messages by using their timestamp as the start of the
message.
By reading the documentation at
https://tomcat.apache.org/tomcat-9.0-doc/logging.html#Console, I can't see
the proper way to  get a common format (preferably with timestamp), or ar
tleast save the outputs into three different types in different files?

Some of the logs are displayed like this (severity in brackets but no
timestamp)

>
> [WARN] Web application uses
> org.apache.axis2.transport.http.AxisAdminServlet; please update web.xml to
> use org.apache.axis2.webapp.AxisAdminServlet instead
> [INFO] Clustering has been disabled
> [INFO] Deploying module: script-1.6.2 -
> file:/var/lib/tomcat8/webapps/WS_Revisiones/WEB-INF/modules/scripting-1.6.2.mar
>
Stack traces are displayed like this (no severity and no timestamp)

> MultiException stack 1 of 2
> java.lang.NoClassDefFoundError: javax/activation/DataSource
> at java.base/java.lang.Class.getDeclaredConstructors0(Native
> Method)
> at
> java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3137)
> at
> java.base/java.lang.Class.getDeclaredConstructors(Class.java:2357)
> at org.jvnet.hk2.internal.Utilities$3.run(Utilities.java:1306)
> at org.jvnet.hk2.internal.Utilities$3.run(Utilities.java:1302)
> at java.base/java.security.AccessController.doPrivileged(Native
> Method)
>
Also some other are like this (timestamp with ms + severity + context in
brackets

> 21-May-2019 13:03:22.474 INFO [localhost-startStop-1]
> org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned
> for TLDs yet contained no TLDs. Enable debug logging for this logger for a
> complete list of JARs that were scanned but no TLDs were found in them.
> Skipping unneeded JARs during scanning can improve startup time and JSP
> compilation time.
>


Re: Broken links to Logos on http://tomcat.apache.org/legal.html

2019-05-21 Thread Mark Thomas
On 21/05/2019 13:29, bernd.sch...@daimler.com wrote:
> Hi,
> 
> There are broken links to logos on the page
> http://tomcat.apache.org/legal.html
> 
> http://tomcat.apache.org/images/tomcat-power.gif
> http://tomcat.apache.org/images/tomcat.gif
> 
> Who has to be informed to fix it ?

Any committer - so a number of us have seen this.

> Where can I get this logos ?

For now:

https://www.apache.org/foundation/press/kit/poweredBy/pb-tomcat.jpg
https://www.apache.org/logos/#tomcat

Mark

> 
> --
> Mit freundlichen Grüßen / Kind Regards/ नमस्ते(Namaste)
> Bernd Schatz
> ITI/FT - CoC Enterprise Platforms Services (PAI)
> HPC Z252
> Gebäude VDZ Ost 1.OG
> Plieninger Str. 150
> 70567 Stuttgart
> 
> Bernd Schatz
> Büro: +49 711 17 41463
> Mobile: +49 151 5862 6591
> FAX: +49 711 17 7904 1252
> mailto:bernd.sch...@daimler.com
> https://matter.i.daimler.com
> 
> 
> 
> If you are not the addressee, please inform us immediately that you have 
> received this e-mail by mistake, and delete it. We thank you for your support.
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Broken links to Logos on http://tomcat.apache.org/legal.html

2019-05-21 Thread bernd . schatz
Hi,

There are broken links to logos on the page
http://tomcat.apache.org/legal.html

http://tomcat.apache.org/images/tomcat-power.gif
http://tomcat.apache.org/images/tomcat.gif

Who has to be informed to fix it ?
Where can I get this logos ?

--
Mit freundlichen Grüßen / Kind Regards/ नमस्ते(Namaste)
Bernd Schatz
ITI/FT - CoC Enterprise Platforms Services (PAI)
HPC Z252
Gebäude VDZ Ost 1.OG
Plieninger Str. 150
70567 Stuttgart

Bernd Schatz
Büro: +49 711 17 41463
Mobile: +49 151 5862 6591
FAX: +49 711 17 7904 1252
mailto:bernd.sch...@daimler.com
https://matter.i.daimler.com



If you are not the addressee, please inform us immediately that you have 
received this e-mail by mistake, and delete it. We thank you for your support.



AsyncContext to closed connection reports no error??

2019-05-21 Thread Frits Jalvingh
Dear list,

I have a problem with the asynchronous servlet support in Tomcat (on both
9.0.16 and 9.0.20). The issue is as follows.
I have implemented a Servlet which will receive connections from a client
program. The servlet will accept this connection and immediately calls
request.startAsync(request, resp) with it, queues the resulting
AsyncContext and returns.

The idea now is that if the servlet has something to tell that client it
will find the queued AsyncRequest and send a command back to the client
with it using the normal getResponse().getWriter() and complete() calls on
the context. This works like a charm.
However, if I terminate the client program while it has a request pending
the servlet never gets any indication that the client has left. What's even
worse: using the AsyncContext and sending a response works without errors
too - no exceptions are thrown, and the listener added to the
AsyncConnection just reports that everything went fine. No error callback,
onComplete called without any exception in the event.

All other functionality works fine; the only thing that seems to fail is
not getting an error when the AsyncContext is actually not connected
anymore.

I did some debugging into the Tomcat code, and it seems like all of the
code "just works" without ever noticing a problem. It is hard to be sure
because a lot of it runs in different threads and is hard to follow... It
would help already if someone could point me to where Tomcat is supposed to
notice a problem like this (closed remote socket).

Can anyone help to shed some light on this issue?

For info: I'm using the following infra:

Tomcat 9.0.20
Java 11.0.3 (Zulu, OpenJDK)
Ubuntu 18.04

Regards,

Frits


Re: Tomcat Authentication + Spring Security J2EEPreAuthentication

2019-05-21 Thread Michael Osipov

Am 2019-05-20 um 21:35 schrieb Nacho Ganguli:

My last attempt used Spring Security JEE pre-authentication filters. This
works as I would like "provided" that I only use basic auth and tomcat's
default realm (tomcat-users.xml).

As soon as I introduce form-based auth, it does not work and I am prompted
to authenticate a second time.  The log files shows "RunAsManager did not
change Authentication object"

If anyone has some suggestions or can recommend an alternate approach, it
would really help me.


Does form-based auth work w/o Spring Security properly? If yes, there 
must be a bug in security:jee, you should debug that. I had to debug 
this many many times due to a lot of issues with security:jee.

See [1] the attention admonition, you may suffer from one of those.

Michael

[1] http://tomcatspnegoad.sourceforge.net/spring-security.html

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org