I'm getting a -1 value for CPU usage when connecting visual VM to my tomcat server.

2024-09-05 Thread Aditya Kumar
I have enabled JMX in my tomcat server. I use VisualVM to inspect the
tomcat server.

When I look at java.lang->OperatingSystem I'm seeing a -1 value for a few
CPU value readings. This just suddenly happened. I cant think what changes
might have been made, I don't recall any apart from maybe a Windows Update

[image: jmx.png]

The java version is Eclipse Temurin JDK version 17.0.11 build 17
Can anyone explain this or advise on how to debug further?

There was a report here about this issue. I tried going to JDK 18 but this
did not help.
https://bugs.openjdk.org/browse/JDK-8265104


Re: SpringBoot Embedded Tomcat Server RateLimitFilter

2024-03-04 Thread Christopher Schultz

Ved,

On 2/28/24 00:56, Ved wrote:

Hi,
I am using spring boot and wanted to use Rate Limit. I can find it in
package org.apache.catalina.filters; //in embedded tomcat

But this RateLimitFilter is never called. I want to understand when this
filter is called and how I can customize it.


Have you configured the RateLimitFilter at all? If so, how? It's not 
enabled by default.


-chris

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



SpringBoot Embedded Tomcat Server RateLimitFilter

2024-02-27 Thread Ved
Hi,
I am using spring boot and wanted to use Rate Limit. I can find it in
package org.apache.catalina.filters; //in embedded tomcat

But this RateLimitFilter is never called. I want to understand when this
filter is called and how I can customize it.

Regards,
Ved Prakash


Re: connecting tomcat server to eclipse java ee

2023-03-10 Thread stephanie.panah
Thank you! I did not reply Sent from my T-Mobile 5G Device
 Original message From: Mark Thomas  Date: 
3/10/23  1:11 AM  (GMT-08:00) To: users@tomcat.apache.org Subject: Re: 
connecting tomcat server to eclipse java ee This idiot has been unsubscribed 
from the mailing list and blocked from re-subscribing.MarkOn 10/03/2023 03:03, 
Veliz Broncano wrote:> Hi! You are very 
pretty-To
 unsubscribe, e-mail: users-unsubscribe@tomcat.apache.orgFor additional 
commands, e-mail: users-h...@tomcat.apache.org

Re: connecting tomcat server to eclipse java ee

2023-03-10 Thread Mark Thomas
This idiot has been unsubscribed from the mailing list and blocked from 
re-subscribing.


Mark


On 10/03/2023 03:03, Veliz Broncano wrote:

Hi! You are very pretty




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



AW: connecting tomcat server to eclipse java ee

2023-03-09 Thread Thomas Hoffmann (Speed4Trade GmbH)
Hello,

as an alternative, you can also create a normal java debug configuration with 
the main class
org.apache.catalina.startup.Bootstrap

Add all the service parameters to the tab Arguments --> VM-arguments.
As a program argument I use 
-config "\server.xml" start

Add the needed Tomcat jars to the dependencies.

Greetings, Thomas

> -Ursprüngliche Nachricht-
> Von: JIM HENK 
> Gesendet: Freitag, 10. März 2023 07:58
> An: Tomcat Users List 
> Betreff: Re: connecting tomcat server to eclipse java ee
> 
> Well….
> 
> When you see that message, Eclipse has gone through it’s table of Tomcat
> version possibilities known at the time your version of Eclipse was published,
> and hasn't found it.  Must’ve come *after*.
> 
> Therefore, The version of Eclipse you need to use has got to have been 
> released
> *after* the version of Tomcat that you’ve got installed.  That way, it will 
> have
> that version of Tomcat in it’s table of known Tomcat versions it can choose
> from.
> 
> Folks, do you concur, or am I wrong here?
> 
>- Jim Henk
> 
> > On Mar 9, 2023, at 6:36 PM, Stephanie Panah
>  wrote:
> >
> > Help please. I have installed: Java EE, Eclipse and Tomcat.
> > When I try to connect the server, I encounter:
> > Unknown version of Tomcat was specified.
> > I am looking all over. please help
> >
> > Java EE for web developers
> > C:\Users\steph> java -fullversion
> > java full version "17.0.6+9-LTS-190"
> >
> > and
> > Eclipse IDE for Enterprise Java and Web Developers
> > Version: 2022-12 (4.26.0)
> > Build id: 20221201-1913
> >
> > and
> > http://localhost:8080/
> > Apache Tomcat/10.1.7
> > If you're seeing this, you've successfully installed Tomcat.
> > Congratulations!
> > C:\Program Files\Apache Software Foundation\Tomcat 10.1 and Tomcat is
> > running in Services
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org



Re: connecting tomcat server to eclipse java ee

2023-03-09 Thread JIM HENK
Well….

When you see that message, Eclipse has gone through it’s table of Tomcat 
version possibilities known at the time your version of Eclipse was published, 
and hasn't found it.  Must’ve come *after*.

Therefore, The version of Eclipse you need to use has got to have been released 
*after* the version of Tomcat that you’ve got installed.  That way, it will 
have that version of Tomcat in it’s table of known Tomcat versions it can 
choose from.

Folks, do you concur, or am I wrong here?

   - Jim Henk

> On Mar 9, 2023, at 6:36 PM, Stephanie Panah  wrote:
> 
> Help please. I have installed: Java EE, Eclipse and Tomcat.
> When I try to connect the server, I encounter:
> Unknown version of Tomcat was specified.
> I am looking all over. please help
> 
> Java EE for web developers
> C:\Users\steph> java -fullversion
> java full version "17.0.6+9-LTS-190"
> 
> and
> Eclipse IDE for Enterprise Java and Web Developers
> Version: 2022-12 (4.26.0)
> Build id: 20221201-1913
> 
> and
> http://localhost:8080/
> Apache Tomcat/10.1.7
> If you're seeing this, you've successfully installed Tomcat.
> Congratulations!
> C:\Program Files\Apache Software Foundation\Tomcat 10.1
> and Tomcat is running in Services


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



Re: connecting tomcat server to eclipse java ee

2023-03-09 Thread Mark Eggers

Stephanie,

On 3/9/2023 7:06 PM, Stephanie Panah wrote:

I was able to resolve the issue. I found:

https://stackoverflow.com/questions/62764029/unknown-version-of-tomcat-was-specified-with-tomcat-9-0-37
--you need to open the folder once
--It will ask you for permission to enter after which its contents will be
visible to you as well as Eclipse
--after setting up and installing Tomcat, open the folder & then try
connecting from Eclipse
--Instead of changing permissions, try this

I had to change permissions, and that took some jiggling, but I can open
and access the Tomcat folder, now

You may wish to add this to your documentation

And now, when I tried to start the Tomcat server from Eclipse (even though
it is running in Services)
I am seeing: The server cannot be started because one or more of the ports
are invalid. Open the server editor and correct the invalid ports.
I set the admin port to 8005.

After more searching, I stopped the Tomcat server in Services and tried to
start in eclipse.
omgosh, it worked. good grief.

and, thank you,
Stephanie





On Thu, Mar 9, 2023 at 6:36 PM Stephanie Panah 
wrote:



Help please. I have installed: Java EE, Eclipse and Tomcat.
When I try to connect the server, I encounter:
Unknown version of Tomcat was specified.
I am looking all over. please help

Java EE for web developers
C:\Users\steph> java -fullversion
java full version "17.0.6+9-LTS-190"

and
Eclipse IDE for Enterprise Java and Web Developers
Version: 2022-12 (4.26.0)
Build id: 20221201-1913

and
http://localhost:8080/
Apache Tomcat/10.1.7
If you're seeing this, you've successfully installed Tomcat.
Congratulations!
C:\Program Files\Apache Software Foundation\Tomcat 10.1
and Tomcat is running in Services









If you're doing development, you really do not want to run Tomcat as a 
service.


1. Download the appropriate zip file from tomcat.apache.org
2. Unzip it in a place that you have R/W access
3. Add the runtime to Eclipse

in Window->Preferences->Server->Runtime Environments
a. click on the Add button
b. open up the Apache folder
c. browse to the version of Tomcat that you want
d. select it and click on the Next button

e. click on the Browse button and browse to where you unzipped Apache Tomcat
f. select the folder, leave the default names as is
g. click finish

Now, you'll need to create a new server based on the default runtime. 
This is handy, because you can have several servers based on the default 
runtime. You can run them on different ports, have one set up for 
debugging, choose different JREs, etc.


1. Go to Window->Show View
2. Select Other
3. Type in Server in the search text
4. Select Servers
5. Click on the Open button

It will complain that you have no servers configured. I know, you're 
going why? I configured a server runtime environment, so why no server. 
That's because you can have several servers based on the same runtime 
(see above).


So:

a. create a new server - opens up a Define a New Server dialogue.
b. open the Apache folder, and select the desired Tomcat version (same 
as before)

c. give it a unique name in Server name: field
d. The server runtime environment should be populated with the one added 
above

e. click on the Next button
f. this will show you a list of projects to add - since you don't have 
any, just click Finish


Now you should see a new line in the Servers window that describes your 
server. If you double-click on the line, you'll get a nice configuration 
screen.


There are lots of things to tweak. However, you should note the following:

Server Path: .metadata\.plugins\org.eclipse.wst.server.core\tmp0

If you have more than one server, they'll be located in tmp1, tmp2, etc.

If you need to change anything besides the ports for your Tomcat server, 
create the same directory structure that you see in Tomcat under the 
tmpN directory:


bin
conf
lib
logs
temp
webapps
work

Note, you may only need to create what you need, and probably not 
webapps. It's been a while, and I'm a NetBeans person, not an Eclipse 
person.


You can add things like database drivers in the lib subdirectory. You 
should be able to see logs in the logs directory. I recommend using 
log4j2 in your applications (along with commons-logging) and log to the 
${ sys:catalina.base}/logs directory.


You can also modify the launch configuration and add the database driver 
jar that way:


a. click on Open launch configuration
b. select the Classpath tab
c. click on User Entries
d. Click on the Add External JARS.. button
f. Browse to the JAR containing the database driver and add it

You can now start, stop, and control whether or not the Tomcat server is 
launched in debug mode, all from the IDE.


I hope this is not overwhelming. I worked through some of these while 
writing this up, since I'm an Apache NetBeans person. I don't w

Re: connecting tomcat server to eclipse java ee

2023-03-09 Thread Stephanie Panah
I was able to resolve the issue. I found:

https://stackoverflow.com/questions/62764029/unknown-version-of-tomcat-was-specified-with-tomcat-9-0-37
--you need to open the folder once
--It will ask you for permission to enter after which its contents will be
visible to you as well as Eclipse
--after setting up and installing Tomcat, open the folder & then try
connecting from Eclipse
--Instead of changing permissions, try this

I had to change permissions, and that took some jiggling, but I can open
and access the Tomcat folder, now

You may wish to add this to your documentation

And now, when I tried to start the Tomcat server from Eclipse (even though
it is running in Services)
I am seeing: The server cannot be started because one or more of the ports
are invalid. Open the server editor and correct the invalid ports.
I set the admin port to 8005.

After more searching, I stopped the Tomcat server in Services and tried to
start in eclipse.
omgosh, it worked. good grief.

and, thank you,
Stephanie





On Thu, Mar 9, 2023 at 6:36 PM Stephanie Panah 
wrote:

>
> Help please. I have installed: Java EE, Eclipse and Tomcat.
> When I try to connect the server, I encounter:
> Unknown version of Tomcat was specified.
> I am looking all over. please help
>
> Java EE for web developers
> C:\Users\steph> java -fullversion
> java full version "17.0.6+9-LTS-190"
>
> and
> Eclipse IDE for Enterprise Java and Web Developers
> Version: 2022-12 (4.26.0)
> Build id: 20221201-1913
>
> and
> http://localhost:8080/
> Apache Tomcat/10.1.7
> If you're seeing this, you've successfully installed Tomcat.
> Congratulations!
> C:\Program Files\Apache Software Foundation\Tomcat 10.1
> and Tomcat is running in Services
>
>
>
>
>


Re: connecting tomcat server to eclipse java ee

2023-03-09 Thread Veliz Broncano
Hi! You are very pretty

On Thu, Mar 9, 2023, 9:37 PM Stephanie Panah 
wrote:

> Help please. I have installed: Java EE, Eclipse and Tomcat.
> When I try to connect the server, I encounter:
> Unknown version of Tomcat was specified.
> I am looking all over. please help
>
> Java EE for web developers
> C:\Users\steph> java -fullversion
> java full version "17.0.6+9-LTS-190"
>
> and
> Eclipse IDE for Enterprise Java and Web Developers
> Version: 2022-12 (4.26.0)
> Build id: 20221201-1913
>
> and
> http://localhost:8080/
> Apache Tomcat/10.1.7
> If you're seeing this, you've successfully installed Tomcat.
> Congratulations!
> C:\Program Files\Apache Software Foundation\Tomcat 10.1
> and Tomcat is running in Services
>


connecting tomcat server to eclipse java ee

2023-03-09 Thread Stephanie Panah
Help please. I have installed: Java EE, Eclipse and Tomcat.
When I try to connect the server, I encounter:
Unknown version of Tomcat was specified.
I am looking all over. please help

Java EE for web developers
C:\Users\steph> java -fullversion
java full version "17.0.6+9-LTS-190"

and
Eclipse IDE for Enterprise Java and Web Developers
Version: 2022-12 (4.26.0)
Build id: 20221201-1913

and
http://localhost:8080/
Apache Tomcat/10.1.7
If you're seeing this, you've successfully installed Tomcat.
Congratulations!
C:\Program Files\Apache Software Foundation\Tomcat 10.1
and Tomcat is running in Services


RE: Tomcat server not considering Mime Type - Request urgent help!!

2021-01-18 Thread Jonnalagadda, Swathi (External)

Hi Schultz

Please find sample code below
Suffix is there in request so ..

RequestDispatcher rd = context.getRequestDispatcher(sample.xls);
String contentType =((request.getParameter(SUFFIX) 
!=null) && ((request.getParameter(SUFFIX).equalsIgnoreCase("xls" 
?"application/vnd.ms-excel":null; <--- setting explicitly
if (contentType != null)
{
response.setContentType(contentType);
}
rd.forward(request, response);

Thanks
Swathi

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Friday, January 15, 2021 7:41 PM
To: users@tomcat.apache.org
Subject: Re: Tomcat server not considering Mime Type - Request urgent help!!

CAUTION:   This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Swathi,

On 1/15/21 08:41, Jonnalagadda, Swathi (External) wrote:
> My web application is trying to open the xls file by passing the file 
> to request.getDispatcher method. It is supposed open up download 
> dialogue box but it is not doing.
After you get a request dispatcher, what are you doing with it?

> If I set the content-type explicitly to response it is showing up the box.

Please post actual code.

> With Tomcat 7 it was never an issue and it used to consider mimetype 
> that is defined in web.xml but in Tomcat 9 not sure why it is not 
> considering mime-type.

Something seems odd, here. Post your sample code.

-chris

> -Original Message-
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Sent: Friday, January 15, 2021 3:25 AM
> To: users@tomcat.apache.org
> Subject: Re: Tomcat server not considering Mime Type - Request urgent help!!
> 
> CAUTION:   This email originated from outside the organization. Do not click 
> links or open attachments unless you recognize the sender and know the 
> content is safe.
> 
> Swathi,
> 
> On 1/13/21 03:27, Jonnalagadda, Swathi (External) wrote:
>> We could see that when we try to open the xls file separately the 
>> browser shows dialogue box to save it so it is nothing to do with 
>> browser settings
> What is the difference between "open[ing] the XLS file separately" and ... 
> whatever your application is doing instead?
> 
> If you want to force a download, you need to add some response headers 
> otherwise a normal browser will usually try to render the file in the browser 
> window instead of initiating a download.
> 
> The response header you need is "Content-Disposition" and its value can be 
> complex. Here is what I usually do:
> 
> Content-Disposition: attachment; filename="[filename]"; 
> filename*=utf-8''[filename in UTF-8 encoding]
> 
> Note that the above is all on one line and the two single-quotes are not a 
> typo. You will also need to escape any double-quotes in the "filename"
> and escape any semicolons in the utf8-filename.
> 
> You can find more information here as well as other places online:
> https://www.geeksforgeeks.org/http-headers-content-disposition/
> 
> The above reference happens to be particularly thorough, even moreso than 
> Mozilla's (typically very good and complete) documentation for 
> Content-Disposition.
> 
> If your application is not being hosted within a web browser (e.g. it's a 
> mobile application, or an Electron (etc.) application, etc.) then it's 
> entirely up to you to trigger the display of a download dialog when this kind 
> of thing needs to happen.
> 
> -chris
> 
>> -Original Message-
>> From: Mounika Reddy [mailto:spidermai...@gmail.com]
>> Sent: Wednesday, January 13, 2021 3:48 AM
>> To: Tomcat Users List
>> Cc: Mark Thomas
>> Subject: Re: Tomcat server not considering Mime Type - Request urgent help!!
>>
>> CAUTION:   This email originated from outside the organization. Do not click 
>> links or open attachments unless you recognize the sender and know the 
>> content is safe.
>>
>> Pls check http response headers for the request to confirm if it's returning 
>> proper headers.
>>
>> Once they are in place then it may be to do with browser settings not 
>> processing headers.
>>
>>
>>
>> On Tue, Jan 12, 2021, 2:48 PM Jonnalagadda, Swathi (External) < 
>> swathi.jonnalaga...@xerox.com> wrote:
>>
>>> Hi Team
>>>
>>> We have an application deployed in tomcat9.0.38 server which 
>>> generates an xls file dynamically and saves at server end. When we 
&g

Re: Tomcat server not considering Mime Type - Request urgent help!!

2021-01-15 Thread Christopher Schultz

Swathi,

On 1/15/21 08:41, Jonnalagadda, Swathi (External) wrote:

My web application is trying to open the xls file by passing the file
to request.getDispatcher method. It is supposed open up download
dialogue box but it is not doing.

After you get a request dispatcher, what are you doing with it?


If I set the content-type explicitly to response it is showing up the box.


Please post actual code.


With Tomcat 7 it was never an issue and it used to consider mimetype
that is defined in web.xml but in Tomcat 9 not sure why it is not
considering mime-type.


Something seems odd, here. Post your sample code.

-chris


-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net]
Sent: Friday, January 15, 2021 3:25 AM
To: users@tomcat.apache.org
Subject: Re: Tomcat server not considering Mime Type - Request urgent help!!

CAUTION:   This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Swathi,

On 1/13/21 03:27, Jonnalagadda, Swathi (External) wrote:

We could see that when we try to open the xls file separately the
browser shows dialogue box to save it so it is nothing to do with
browser settings

What is the difference between "open[ing] the XLS file separately" and ... 
whatever your application is doing instead?

If you want to force a download, you need to add some response headers 
otherwise a normal browser will usually try to render the file in the browser 
window instead of initiating a download.

The response header you need is "Content-Disposition" and its value can be 
complex. Here is what I usually do:

Content-Disposition: attachment; filename="[filename]"; 
filename*=utf-8''[filename in UTF-8 encoding]

Note that the above is all on one line and the two single-quotes are not a typo. You will 
also need to escape any double-quotes in the "filename"
and escape any semicolons in the utf8-filename.

You can find more information here as well as other places online:
https://www.geeksforgeeks.org/http-headers-content-disposition/

The above reference happens to be particularly thorough, even moreso than 
Mozilla's (typically very good and complete) documentation for 
Content-Disposition.

If your application is not being hosted within a web browser (e.g. it's a 
mobile application, or an Electron (etc.) application, etc.) then it's entirely 
up to you to trigger the display of a download dialog when this kind of thing 
needs to happen.

-chris


-Original Message-
From: Mounika Reddy [mailto:spidermai...@gmail.com]
Sent: Wednesday, January 13, 2021 3:48 AM
To: Tomcat Users List
Cc: Mark Thomas
Subject: Re: Tomcat server not considering Mime Type - Request urgent help!!

CAUTION:   This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Pls check http response headers for the request to confirm if it's returning 
proper headers.

Once they are in place then it may be to do with browser settings not 
processing headers.



On Tue, Jan 12, 2021, 2:48 PM Jonnalagadda, Swathi (External) < 
swathi.jonnalaga...@xerox.com> wrote:


Hi Team

We have an application deployed in tomcat9.0.38 server which
generates an xls file dynamically and saves at server end. When we
try to access the file using application frontend, it is neither
showing up in excel format nor showing up pop up to save the file
instead it is showing the content of xls file in xml format directly on the 
browser.

Below mime type is set both at web.xml of webapplicatio end and as
well as Tomcat9038/conf/web.xml


  xls
  application/vnd.ms-excel
  

Could you please help in resolving the issue ASAP


Thanks
Swathi



-
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


-
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



Re: Tomcat server not considering Mime Type - Request urgent help!!

2021-01-15 Thread Mounika Reddy
As Niranjan said, pls validate the headers first and it may be not the case
in Tomcat7 but there are multiple points which must have updated probably
triggering it. Only way to verify is set Content-Disposition header
accurately and verify if browser can see it

On Fri, Jan 15, 2021, 8:41 AM Jonnalagadda, Swathi (External) <
swathi.jonnalaga...@xerox.com> wrote:

> Hi Chris
>
> My web application is trying to open the xls file by passing the file to
> request.getDispatcher method. It is supposed open up download dialogue box
> but it is not doing.
>
> If I set the content-type explicitly to response it is showing up the box.
>
> With Tomcat 7 it was never an issue and it used to consider mimetype that
> is defined in web.xml but in Tomcat 9 not sure why it is not considering
> mime-type.
>
> Thanks
> Swathi
>
> -Original Message-
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Sent: Friday, January 15, 2021 3:25 AM
> To: users@tomcat.apache.org
> Subject: Re: Tomcat server not considering Mime Type - Request urgent
> help!!
>
> CAUTION:   This email originated from outside the organization. Do not
> click links or open attachments unless you recognize the sender and know
> the content is safe.
>
> Swathi,
>
> On 1/13/21 03:27, Jonnalagadda, Swathi (External) wrote:
> > We could see that when we try to open the xls file separately the
> > browser shows dialogue box to save it so it is nothing to do with
> > browser settings
> What is the difference between "open[ing] the XLS file separately" and ...
> whatever your application is doing instead?
>
> If you want to force a download, you need to add some response headers
> otherwise a normal browser will usually try to render the file in the
> browser window instead of initiating a download.
>
> The response header you need is "Content-Disposition" and its value can be
> complex. Here is what I usually do:
>
> Content-Disposition: attachment; filename="[filename]";
> filename*=utf-8''[filename in UTF-8 encoding]
>
> Note that the above is all on one line and the two single-quotes are not a
> typo. You will also need to escape any double-quotes in the "filename"
> and escape any semicolons in the utf8-filename.
>
> You can find more information here as well as other places online:
> https://www.geeksforgeeks.org/http-headers-content-disposition/
>
> The above reference happens to be particularly thorough, even moreso than
> Mozilla's (typically very good and complete) documentation for
> Content-Disposition.
>
> If your application is not being hosted within a web browser (e.g. it's a
> mobile application, or an Electron (etc.) application, etc.) then it's
> entirely up to you to trigger the display of a download dialog when this
> kind of thing needs to happen.
>
> -chris
>
> > -Original Message-
> > From: Mounika Reddy [mailto:spidermai...@gmail.com]
> > Sent: Wednesday, January 13, 2021 3:48 AM
> > To: Tomcat Users List
> > Cc: Mark Thomas
> > Subject: Re: Tomcat server not considering Mime Type - Request urgent
> help!!
> >
> > CAUTION:   This email originated from outside the organization. Do not
> click links or open attachments unless you recognize the sender and know
> the content is safe.
> >
> > Pls check http response headers for the request to confirm if it's
> returning proper headers.
> >
> > Once they are in place then it may be to do with browser settings not
> processing headers.
> >
> >
> >
> > On Tue, Jan 12, 2021, 2:48 PM Jonnalagadda, Swathi (External) <
> swathi.jonnalaga...@xerox.com> wrote:
> >
> >> Hi Team
> >>
> >> We have an application deployed in tomcat9.0.38 server which
> >> generates an xls file dynamically and saves at server end. When we
> >> try to access the file using application frontend, it is neither
> >> showing up in excel format nor showing up pop up to save the file
> >> instead it is showing the content of xls file in xml format directly on
> the browser.
> >>
> >> Below mime type is set both at web.xml of webapplicatio end and as
> >> well as Tomcat9038/conf/web.xml
> >>
> >> 
> >>  xls
> >>  application/vnd.ms-excel
> >>  
> >>
> >> Could you please help in resolving the issue ASAP
> >>
> >>
> >> Thanks
> >> Swathi
> >>
> >
> > -
> > 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
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>


RE: Tomcat server not considering Mime Type - Request urgent help!!

2021-01-15 Thread Jonnalagadda, Swathi (External)
Hi Chris

My web application is trying to open the xls file by passing the file to 
request.getDispatcher method. It is supposed open up download dialogue box but 
it is not doing.

If I set the content-type explicitly to response it is showing up the box.

With Tomcat 7 it was never an issue and it used to consider mimetype that is 
defined in web.xml but in Tomcat 9 not sure why it is not considering mime-type.

Thanks
Swathi 

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Friday, January 15, 2021 3:25 AM
To: users@tomcat.apache.org
Subject: Re: Tomcat server not considering Mime Type - Request urgent help!!

CAUTION:   This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Swathi,

On 1/13/21 03:27, Jonnalagadda, Swathi (External) wrote:
> We could see that when we try to open the xls file separately the 
> browser shows dialogue box to save it so it is nothing to do with 
> browser settings
What is the difference between "open[ing] the XLS file separately" and ... 
whatever your application is doing instead?

If you want to force a download, you need to add some response headers 
otherwise a normal browser will usually try to render the file in the browser 
window instead of initiating a download.

The response header you need is "Content-Disposition" and its value can be 
complex. Here is what I usually do:

Content-Disposition: attachment; filename="[filename]"; 
filename*=utf-8''[filename in UTF-8 encoding]

Note that the above is all on one line and the two single-quotes are not a 
typo. You will also need to escape any double-quotes in the "filename" 
and escape any semicolons in the utf8-filename.

You can find more information here as well as other places online:
https://www.geeksforgeeks.org/http-headers-content-disposition/

The above reference happens to be particularly thorough, even moreso than 
Mozilla's (typically very good and complete) documentation for 
Content-Disposition.

If your application is not being hosted within a web browser (e.g. it's a 
mobile application, or an Electron (etc.) application, etc.) then it's entirely 
up to you to trigger the display of a download dialog when this kind of thing 
needs to happen.

-chris

> -Original Message-
> From: Mounika Reddy [mailto:spidermai...@gmail.com]
> Sent: Wednesday, January 13, 2021 3:48 AM
> To: Tomcat Users List
> Cc: Mark Thomas
> Subject: Re: Tomcat server not considering Mime Type - Request urgent help!!
> 
> CAUTION:   This email originated from outside the organization. Do not click 
> links or open attachments unless you recognize the sender and know the 
> content is safe.
> 
> Pls check http response headers for the request to confirm if it's returning 
> proper headers.
> 
> Once they are in place then it may be to do with browser settings not 
> processing headers.
> 
> 
> 
> On Tue, Jan 12, 2021, 2:48 PM Jonnalagadda, Swathi (External) < 
> swathi.jonnalaga...@xerox.com> wrote:
> 
>> Hi Team
>>
>> We have an application deployed in tomcat9.0.38 server which 
>> generates an xls file dynamically and saves at server end. When we 
>> try to access the file using application frontend, it is neither 
>> showing up in excel format nor showing up pop up to save the file 
>> instead it is showing the content of xls file in xml format directly on the 
>> browser.
>>
>> Below mime type is set both at web.xml of webapplicatio end and as 
>> well as Tomcat9038/conf/web.xml
>>
>> 
>>  xls
>>  application/vnd.ms-excel
>>  
>>
>> Could you please help in resolving the issue ASAP
>>
>>
>> Thanks
>> Swathi
>>
> 
> -
> 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


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



Re: Tomcat server not considering Mime Type - Request urgent help!!

2021-01-15 Thread tomcat/perl

Hi again.
Sorry for the noise.
The page which you quoted 
(https://www.geeksforgeeks.org/http-headers-content-disposition/), itself contains a 
formal reference to
RFC 5987 (https://tools.ietf.org/html/rfc5987), which formally defines the extended 
"filename*" header parameter below.


On 15.01.2021 11:48, André Warnier (tomcat/perl) wrote:

On 14.01.2021 22:55, Christopher Schultz wrote:
Content-Disposition: attachment; filename="[filename]"; filename*=utf-8''[filename in 
UTF-8 encoding]


Hi Chris.
Do you have any reference for the above ?
(the "utf8''" part is new to me)


-
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



Re: Tomcat server not considering Mime Type - Request urgent help!!

2021-01-15 Thread tomcat/perl

On 14.01.2021 22:55, Christopher Schultz wrote:
Content-Disposition: attachment; filename="[filename]"; filename*=utf-8''[filename in 
UTF-8 encoding]


Hi Chris.
Do you have any reference for the above ?
(the "utf8''" part is new to me)


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



Re: Tomcat server not considering Mime Type - Request urgent help!!

2021-01-14 Thread Christopher Schultz

Swathi,

On 1/13/21 03:27, Jonnalagadda, Swathi (External) wrote:

We could see that when we try to open the xls file separately the
browser shows dialogue box to save it so it is nothing to do with
browser settings
What is the difference between "open[ing] the XLS file separately" and 
... whatever your application is doing instead?


If you want to force a download, you need to add some response headers 
otherwise a normal browser will usually try to render the file in the 
browser window instead of initiating a download.


The response header you need is "Content-Disposition" and its value can 
be complex. Here is what I usually do:


Content-Disposition: attachment; filename="[filename]"; 
filename*=utf-8''[filename in UTF-8 encoding]


Note that the above is all on one line and the two single-quotes are not 
a typo. You will also need to escape any double-quotes in the "filename" 
and escape any semicolons in the utf8-filename.


You can find more information here as well as other places online:
https://www.geeksforgeeks.org/http-headers-content-disposition/

The above reference happens to be particularly thorough, even moreso 
than Mozilla's (typically very good and complete) documentation for 
Content-Disposition.


If your application is not being hosted within a web browser (e.g. it's 
a mobile application, or an Electron (etc.) application, etc.) then it's 
entirely up to you to trigger the display of a download dialog when this 
kind of thing needs to happen.


-chris


-Original Message-
From: Mounika Reddy [mailto:spidermai...@gmail.com]
Sent: Wednesday, January 13, 2021 3:48 AM
To: Tomcat Users List
Cc: Mark Thomas
Subject: Re: Tomcat server not considering Mime Type - Request urgent help!!

CAUTION:   This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Pls check http response headers for the request to confirm if it's returning 
proper headers.

Once they are in place then it may be to do with browser settings not 
processing headers.



On Tue, Jan 12, 2021, 2:48 PM Jonnalagadda, Swathi (External) < 
swathi.jonnalaga...@xerox.com> wrote:


Hi Team

We have an application deployed in tomcat9.0.38 server which generates
an xls file dynamically and saves at server end. When we try to access
the file using application frontend, it is neither showing up in excel
format nor showing up pop up to save the file instead it is showing
the content of xls file in xml format directly on the browser.

Below mime type is set both at web.xml of webapplicatio end and as
well as Tomcat9038/conf/web.xml


 xls
 application/vnd.ms-excel
 

Could you please help in resolving the issue ASAP


Thanks
Swathi



-
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



Re: Tomcat server not considering Mime Type - Request urgent help!!

2021-01-14 Thread Niranjan Rao

What everyone is telling you is browser is not seeing right headers..

You can modify your tomcat settings as well as apache2 settings to log 
outgoing content type header. If tomcat and apache2 headers match, 
problem is in your tomcat side. If there is a mismatch and tomcat is 
sending right headers. then problem is on apache2 side. You can directly 
connect to tomact using curl or even in the browser to bypass apache2 
and see if it works.


How is response returned? How do you set the extension of the file? You 
said file generated dynamically, are you sure your servlet or whatever 
service handler you have there is not sending incorrect header?


I am not sure, but I believe global mime type settings are only for 
static files that tomcat serves. Any dynamically generated content has 
to be managed by response handler. More knowledgeable people here can 
correct me if I am wrong.


Regards,

Niranjan

On 1/14/21 8:59 AM, Jonnalagadda, Swathi (External) wrote:

Could you please elaborate more on this as to where I need to check

From: Mounika Reddy 
Sent: Thursday, January 14, 2021 2:41 AM
To: Tomcat Users List 
Cc: Mark Thomas 
Subject: Re: Tomcat server not considering Mime Type - Request urgent help!!

CAUTION:   This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

If you are via AJP connector, then check if Apache proxy is changing
headers. We have a similar environment and when we set content-type,
clients see the same but possible it must be overriding

On Wed, Jan 13, 2021, 3:14 PM Jonnalagadda, Swathi (External) <
swathi.jonnalaga...@xerox.com> wrote:


This issue is not resolved yet.  The extension of file is clearly .xls but
I see content-type in response header is set to text/html.

Please note that the request initially hits apache2.4 server which is
redirected to tomcat9 server after successful authentication at siteminder.

The connection is configured via ajp connector.

Is there a possibility that the apache server is overwriting the
content-type header in response ?

Please advise.

Thanks
Swathi

-Original Message-
From: Jonnalagadda, Swathi (External) [mailto:
swathi.jonnalaga...@xerox.com]
Sent: Wednesday, January 13, 2021 1:57 PM
To: Tomcat Users List
Cc: Mark Thomas
Subject: RE: Tomcat server not considering Mime Type - Request urgent
help!!

CAUTION:   This email originated from outside the organization. Do not
click links or open attachments unless you recognize the sender and know
the content is safe.

Thank you for the email

We could see that when we try to open the xls file separately the browser
shows dialogue box to save it so it is nothing to do with browser settings

Could you please advise if I am missing out any setting here.

Thanks
Swathi
-Original Message-
From: Mounika Reddy [mailto:spidermai...@gmail.com]
Sent: Wednesday, January 13, 2021 3:48 AM
To: Tomcat Users List
Cc: Mark Thomas
Subject: Re: Tomcat server not considering Mime Type - Request urgent
help!!

CAUTION:   This email originated from outside the organization. Do not
click links or open attachments unless you recognize the sender and know
the content is safe.

Pls check http response headers for the request to confirm if it's
returning proper headers.

Once they are in place then it may be to do with browser settings not
processing headers.



On Tue, Jan 12, 2021, 2:48 PM Jonnalagadda, Swathi (External) <
swathi.jonnalaga...@xerox.com> wrote:


Hi Team

We have an application deployed in tomcat9.0.38 server which generates
an xls file dynamically and saves at server end. When we try to access
the file using application frontend, it is neither showing up in excel
format nor showing up pop up to save the file instead it is showing
the content of xls file in xml format directly on the browser.

Below mime type is set both at web.xml of webapplicatio end and as
well as Tomcat9038/conf/web.xml


 xls
 application/vnd.ms-excel
 

Could you please help in resolving the issue ASAP


Thanks
Swathi




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



Re: Tomcat server not considering Mime Type - Request urgent help!!

2021-01-14 Thread Jonnalagadda, Swathi (External)
Could you please elaborate more on this as to where I need to check

From: Mounika Reddy 
Sent: Thursday, January 14, 2021 2:41 AM
To: Tomcat Users List 
Cc: Mark Thomas 
Subject: Re: Tomcat server not considering Mime Type - Request urgent help!!

CAUTION:   This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

If you are via AJP connector, then check if Apache proxy is changing
headers. We have a similar environment and when we set content-type,
clients see the same but possible it must be overriding

On Wed, Jan 13, 2021, 3:14 PM Jonnalagadda, Swathi (External) <
swathi.jonnalaga...@xerox.com> wrote:

> This issue is not resolved yet.  The extension of file is clearly .xls but
> I see content-type in response header is set to text/html.
>
> Please note that the request initially hits apache2.4 server which is
> redirected to tomcat9 server after successful authentication at siteminder.
>
> The connection is configured via ajp connector.
>
> Is there a possibility that the apache server is overwriting the
> content-type header in response ?
>
> Please advise.
>
> Thanks
> Swathi
>
> -Original Message-
> From: Jonnalagadda, Swathi (External) [mailto:
> swathi.jonnalaga...@xerox.com]
> Sent: Wednesday, January 13, 2021 1:57 PM
> To: Tomcat Users List
> Cc: Mark Thomas
> Subject: RE: Tomcat server not considering Mime Type - Request urgent
> help!!
>
> CAUTION:   This email originated from outside the organization. Do not
> click links or open attachments unless you recognize the sender and know
> the content is safe.
>
> Thank you for the email
>
> We could see that when we try to open the xls file separately the browser
> shows dialogue box to save it so it is nothing to do with browser settings
>
> Could you please advise if I am missing out any setting here.
>
> Thanks
> Swathi
> -Original Message-
> From: Mounika Reddy [mailto:spidermai...@gmail.com]
> Sent: Wednesday, January 13, 2021 3:48 AM
> To: Tomcat Users List
> Cc: Mark Thomas
> Subject: Re: Tomcat server not considering Mime Type - Request urgent
> help!!
>
> CAUTION:   This email originated from outside the organization. Do not
> click links or open attachments unless you recognize the sender and know
> the content is safe.
>
> Pls check http response headers for the request to confirm if it's
> returning proper headers.
>
> Once they are in place then it may be to do with browser settings not
> processing headers.
>
>
>
> On Tue, Jan 12, 2021, 2:48 PM Jonnalagadda, Swathi (External) <
> swathi.jonnalaga...@xerox.com> wrote:
>
> > Hi Team
> >
> > We have an application deployed in tomcat9.0.38 server which generates
> > an xls file dynamically and saves at server end. When we try to access
> > the file using application frontend, it is neither showing up in excel
> > format nor showing up pop up to save the file instead it is showing
> > the content of xls file in xml format directly on the browser.
> >
> > Below mime type is set both at web.xml of webapplicatio end and as
> > well as Tomcat9038/conf/web.xml
> >
> > 
> > xls
> > application/vnd.ms-excel
> > 
> >
> > Could you please help in resolving the issue ASAP
> >
> >
> > Thanks
> > Swathi
> >
>


Re: Tomcat server not considering Mime Type - Request urgent help!!

2021-01-13 Thread Mounika Reddy
If you are via AJP connector, then check if Apache proxy is changing
headers. We have a similar environment and when we set content-type,
clients see the same but possible it must be overriding

On Wed, Jan 13, 2021, 3:14 PM Jonnalagadda, Swathi (External) <
swathi.jonnalaga...@xerox.com> wrote:

> This issue is not resolved yet.  The extension of file is clearly .xls but
> I see content-type in response header is set to text/html.
>
> Please note that the request initially hits apache2.4 server which is
> redirected to tomcat9 server after successful authentication at siteminder.
>
> The connection is configured via ajp connector.
>
> Is there a possibility that the apache server is overwriting the
> content-type header in response ?
>
> Please advise.
>
> Thanks
> Swathi
>
> -Original Message-
> From: Jonnalagadda, Swathi (External) [mailto:
> swathi.jonnalaga...@xerox.com]
> Sent: Wednesday, January 13, 2021 1:57 PM
> To: Tomcat Users List
> Cc: Mark Thomas
> Subject: RE: Tomcat server not considering Mime Type - Request urgent
> help!!
>
> CAUTION:   This email originated from outside the organization. Do not
> click links or open attachments unless you recognize the sender and know
> the content is safe.
>
> Thank you for the email
>
> We could see that when we try to open the xls file separately the browser
> shows dialogue box to save it so it is nothing to do with browser settings
>
> Could you please advise if I am missing out any setting here.
>
> Thanks
> Swathi
> -Original Message-
> From: Mounika Reddy [mailto:spidermai...@gmail.com]
> Sent: Wednesday, January 13, 2021 3:48 AM
> To: Tomcat Users List
> Cc: Mark Thomas
> Subject: Re: Tomcat server not considering Mime Type - Request urgent
> help!!
>
> CAUTION:   This email originated from outside the organization. Do not
> click links or open attachments unless you recognize the sender and know
> the content is safe.
>
> Pls check http response headers for the request to confirm if it's
> returning proper headers.
>
> Once they are in place then it may be to do with browser settings not
> processing headers.
>
>
>
> On Tue, Jan 12, 2021, 2:48 PM Jonnalagadda, Swathi (External) <
> swathi.jonnalaga...@xerox.com> wrote:
>
> > Hi Team
> >
> > We have an application deployed in tomcat9.0.38 server which generates
> > an xls file dynamically and saves at server end. When we try to access
> > the file using application frontend, it is neither showing up in excel
> > format nor showing up pop up to save the file instead it is showing
> > the content of xls file in xml format directly on the browser.
> >
> > Below mime type is set both at web.xml of webapplicatio end and as
> > well as Tomcat9038/conf/web.xml
> >
> > 
> > xls
> > application/vnd.ms-excel
> > 
> >
> > Could you please help in resolving the issue ASAP
> >
> >
> > Thanks
> > Swathi
> >
>


RE: Tomcat server not considering Mime Type - Request urgent help!!

2021-01-13 Thread Jonnalagadda, Swathi (External)
This issue is not resolved yet.  The extension of file is clearly .xls but I 
see content-type in response header is set to text/html. 

Please note that the request initially hits apache2.4 server which is 
redirected to tomcat9 server after successful authentication at siteminder. 

The connection is configured via ajp connector.

Is there a possibility that the apache server is overwriting the content-type 
header in response ?

Please advise.

Thanks
Swathi 

-Original Message-
From: Jonnalagadda, Swathi (External) [mailto:swathi.jonnalaga...@xerox.com] 
Sent: Wednesday, January 13, 2021 1:57 PM
To: Tomcat Users List
Cc: Mark Thomas
Subject: RE: Tomcat server not considering Mime Type - Request urgent help!!

CAUTION:   This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Thank you for the email

We could see that when we try to open the xls file separately the browser shows 
dialogue box to save it so it is nothing to do with browser settings

Could you please advise if I am missing out any setting here.

Thanks
Swathi
-Original Message-
From: Mounika Reddy [mailto:spidermai...@gmail.com]
Sent: Wednesday, January 13, 2021 3:48 AM
To: Tomcat Users List
Cc: Mark Thomas
Subject: Re: Tomcat server not considering Mime Type - Request urgent help!!

CAUTION:   This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Pls check http response headers for the request to confirm if it's returning 
proper headers.

Once they are in place then it may be to do with browser settings not 
processing headers.



On Tue, Jan 12, 2021, 2:48 PM Jonnalagadda, Swathi (External) < 
swathi.jonnalaga...@xerox.com> wrote:

> Hi Team
>
> We have an application deployed in tomcat9.0.38 server which generates 
> an xls file dynamically and saves at server end. When we try to access 
> the file using application frontend, it is neither showing up in excel 
> format nor showing up pop up to save the file instead it is showing 
> the content of xls file in xml format directly on the browser.
>
> Below mime type is set both at web.xml of webapplicatio end and as 
> well as Tomcat9038/conf/web.xml
>
> 
> xls
> application/vnd.ms-excel
> 
>
> Could you please help in resolving the issue ASAP
>
>
> Thanks
> Swathi
>


Re: Tomcat server not considering Mime Type - Request urgent help!!

2021-01-13 Thread Greg Huber
I have found getting browsers to handle objects correctly is problematic 
and needs to be specific to the use case in the html link.




On 13/01/2021 08:27, Jonnalagadda, Swathi (External) wrote:

Thank you for the email

We could see that when we try to open the xls file separately the browser shows 
dialogue box to save it so it is nothing to do with browser settings

Could you please advise if I am missing out any setting here.

Thanks
Swathi
-Original Message-
From: Mounika Reddy [mailto:spidermai...@gmail.com]
Sent: Wednesday, January 13, 2021 3:48 AM
To: Tomcat Users List
Cc: Mark Thomas
Subject: Re: Tomcat server not considering Mime Type - Request urgent help!!

CAUTION:   This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Pls check http response headers for the request to confirm if it's returning 
proper headers.

Once they are in place then it may be to do with browser settings not 
processing headers.



On Tue, Jan 12, 2021, 2:48 PM Jonnalagadda, Swathi (External) < 
swathi.jonnalaga...@xerox.com> wrote:


Hi Team

We have an application deployed in tomcat9.0.38 server which generates
an xls file dynamically and saves at server end. When we try to access
the file using application frontend, it is neither showing up in excel
format nor showing up pop up to save the file instead it is showing
the content of xls file in xml format directly on the browser.

Below mime type is set both at web.xml of webapplicatio end and as
well as Tomcat9038/conf/web.xml


 xls
 application/vnd.ms-excel
 

Could you please help in resolving the issue ASAP


Thanks
Swathi


-
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



RE: Tomcat server not considering Mime Type - Request urgent help!!

2021-01-13 Thread Jonnalagadda, Swathi (External)
Thank you for the email

We could see that when we try to open the xls file separately the browser shows 
dialogue box to save it so it is nothing to do with browser settings

Could you please advise if I am missing out any setting here.

Thanks
Swathi
-Original Message-
From: Mounika Reddy [mailto:spidermai...@gmail.com] 
Sent: Wednesday, January 13, 2021 3:48 AM
To: Tomcat Users List
Cc: Mark Thomas
Subject: Re: Tomcat server not considering Mime Type - Request urgent help!!

CAUTION:   This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Pls check http response headers for the request to confirm if it's returning 
proper headers.

Once they are in place then it may be to do with browser settings not 
processing headers.



On Tue, Jan 12, 2021, 2:48 PM Jonnalagadda, Swathi (External) < 
swathi.jonnalaga...@xerox.com> wrote:

> Hi Team
>
> We have an application deployed in tomcat9.0.38 server which generates 
> an xls file dynamically and saves at server end. When we try to access 
> the file using application frontend, it is neither showing up in excel 
> format nor showing up pop up to save the file instead it is showing 
> the content of xls file in xml format directly on the browser.
>
> Below mime type is set both at web.xml of webapplicatio end and as 
> well as Tomcat9038/conf/web.xml
>
> 
> xls
> application/vnd.ms-excel
> 
>
> Could you please help in resolving the issue ASAP
>
>
> Thanks
> Swathi
>


Re: Tomcat server not considering Mime Type - Request urgent help!!

2021-01-12 Thread Mounika Reddy
Pls check http response headers for the request to confirm if it's
returning proper headers.

Once they are in place then it may be to do with browser settings not
processing headers.



On Tue, Jan 12, 2021, 2:48 PM Jonnalagadda, Swathi (External) <
swathi.jonnalaga...@xerox.com> wrote:

> Hi Team
>
> We have an application deployed in tomcat9.0.38 server which generates an
> xls file dynamically and saves at server end. When we try to access the
> file using application frontend, it is neither showing up in excel format
> nor showing up pop up to save the file instead it is showing the content of
> xls file in xml format directly on the browser.
>
> Below mime type is set both at web.xml of webapplicatio end and as well as
> Tomcat9038/conf/web.xml
>
> 
> xls
> application/vnd.ms-excel
> 
>
> Could you please help in resolving the issue ASAP
>
>
> Thanks
> Swathi
>


Tomcat server not considering Mime Type - Request urgent help!!

2021-01-12 Thread Jonnalagadda, Swathi (External)
Hi Team

We have an application deployed in tomcat9.0.38 server which generates an xls 
file dynamically and saves at server end. When we try to access the file using 
application frontend, it is neither showing up in excel format  nor showing up 
pop up to save the file instead it is showing the content of xls file in xml 
format directly on the browser.

Below mime type is set both at web.xml of webapplicatio end and as well as 
Tomcat9038/conf/web.xml


xls
application/vnd.ms-excel


Could you please help in resolving the issue ASAP


Thanks
Swathi


Re: Tomcat server gets stuck

2020-02-14 Thread James H. H. Lampert
This was not a client box, nor one of our cloud boxes; it's our own 
production box.


Shortly after I posted my query to the List, I was directed to re-IPL 
the system. I initiated the requested restart, and went to lunch.


That worked. The Tomcat server is back up, with all contexts running.

--
JHHL

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



Re: Tomcat server gets stuck

2020-02-14 Thread calder
On Fri, Feb 14, 2020, 15:05 James H. H. Lampert 
wrote:

> Ladies and Gentlemen of the Tomcat List:
>
> We have a situation.
>
> Earlier today, something (we don't know what) caused the Tomcat (7.0.93)
> server on our AS/400 to go crazy, producing a 70G+ catalina.out file,
> and rendering the machine generally unresponsive.
>
> Once I was able to get a terminal session (through a reserved "console"
> Ethernet interface), I forcibly shut down the Tomcat server.
>
> Then, after saving the enormous catalina.out file, I restarted Tomcat,
> and it brought up all contexts but the ROOT (which was having
> "persistence directory" problems, which I've passed on to our Tomcat
> specialists). I tried stopping and restarting that context, with no
> change in its behavior.
>
> But then, I tried shutting down and restarting Tomcat again, and this
> time, it comes up, and opens the port, but no contexts start, not even
> one that's nothing more than a directory with a static web page in it!
>
> Anybody here have any idea what could be going wrong? It seems to get
> stuck on "Deploying web application archive"
>


Is this the client install where y'all upgraded the JVM from 1.7 to 1.8?

Is there a repeating stack trace in the logs? If yes, what is it?And if
you post it, please include the complete stack trace, including any and all
"Caused by" entries


Re: Tomcat server gets stuck

2020-02-14 Thread Mark Thomas
On 14/02/2020 21:04, James H. H. Lampert wrote:
> Ladies and Gentlemen of the Tomcat List:
> 
> We have a situation.
> 
> Earlier today, something (we don't know what) caused the Tomcat (7.0.93)
> server on our AS/400 to go crazy, producing a 70G+ catalina.out file,
> and rendering the machine generally unresponsive.
> 
> Once I was able to get a terminal session (through a reserved "console"
> Ethernet interface), I forcibly shut down the Tomcat server.
> 
> Then, after saving the enormous catalina.out file, I restarted Tomcat,
> and it brought up all contexts but the ROOT (which was having
> "persistence directory" problems, which I've passed on to our Tomcat
> specialists). I tried stopping and restarting that context, with no
> change in its behavior.
> 
> But then, I tried shutting down and restarting Tomcat again, and this
> time, it comes up, and opens the port, but no contexts start, not even
> one that's nothing more than a directory with a static web page in it!
> 
> Anybody here have any idea what could be going wrong? It seems to get
> stuck on "Deploying web application archive" and "validateMarFile."

Quick approach:
Take three thread dumps ~5s apart and compare.

Better approach:
Use a profiler

Probably excessive at this stage:
Configure for remote debugging, attach a debugger and step through the code

Mark

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



Tomcat server gets stuck

2020-02-14 Thread James H. H. Lampert

Ladies and Gentlemen of the Tomcat List:

We have a situation.

Earlier today, something (we don't know what) caused the Tomcat (7.0.93) 
server on our AS/400 to go crazy, producing a 70G+ catalina.out file, 
and rendering the machine generally unresponsive.


Once I was able to get a terminal session (through a reserved "console" 
Ethernet interface), I forcibly shut down the Tomcat server.


Then, after saving the enormous catalina.out file, I restarted Tomcat, 
and it brought up all contexts but the ROOT (which was having 
"persistence directory" problems, which I've passed on to our Tomcat 
specialists). I tried stopping and restarting that context, with no 
change in its behavior.


But then, I tried shutting down and restarting Tomcat again, and this 
time, it comes up, and opens the port, but no contexts start, not even 
one that's nothing more than a directory with a static web page in it!


Anybody here have any idea what could be going wrong? It seems to get 
stuck on "Deploying web application archive" and "validateMarFile."


--
JHHL



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



Re: How to set apache load balancer for send request to 6 tomcat server

2019-12-31 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Giancarlo,

On 12/30/19 12:11, Giancarlo Celli wrote:
> Hi Chris, to avoid any kind of overload, I would like every single
> request to be forwarded to a backend server.

Session stickiness only determines WHICH backend server your request
will be routed to. If your session gets mapped to a server which has
failed, that request will fail-over to another server.

The advantage to sticky-sessions is two-fold:

1. When not clustering and user-sessions are required (i.e. for
login), then sticky-sessions are REQUIRED

2. When clustering sessions, sticky-sessions are also REQUIRED to
ensure that the same session object is being used for all requests,
limiting the possibility of race-conditions. There is no cross-cluster
synchronization to prevent simultaneous access to the same session on
two different nodes.

I can't really see a use-case for NOT using sticky-sessions unless you
have HUGE, bursty-load and the contents of the session aren't very
important. (Or you are using a non-standard session-manager.)

> I attach the files again hoping you can view them correctly. I
> await your suggestions.

A few thoughts:

> worker.node1.ping_mode=P

This will cause a ping to be sent for every request, but no periodic
checks will be made. It probably doesn't matter much, but you may want
to start with ping_mode=A and reduce the frequency if you observe any
performance problems.

> worker.node1.ping_timeout=1

10s is a long time. Do you want to wait 10s for a request to fail-over
to another server?

> worker.node1.lbfactor=1 worker.node1.socket_timeout=30

Same here: 30s is a long time. You may wait 30 seconds for a back-end
server to fail to respond to a request. Or maybe you have some
requests you expect to take as much as 30 seconds?

> worker.node1.connection_pool_timeout=20 
> worker.node1.recover_time=5

>  connectionTimeout="2" redirectPort="8443" />

Good: connectionTimeout == connection_pool_timeout

Everything looks okay to me. Are you having any specific problems, or
are you just asking if everything looks reasonable?

- -chris

> -- Messaggio originale -- Da: "Christopher Schultz"
>  <mailto:ch...@christopherschultz.net>> A: users@tomcat.apache.org
> <mailto:users@tomcat.apache.org> Inviato: 27/12/2019 16:29:28 
> Oggetto: Re: How to set apache load balancer for send request to 6 
> tomcat server
> 
>> Firma ha problemi -BEGIN PGP SIGNED MESSAGE-Hash:
>> SHA256Giancarlo,On 12/23/19 12:45,
>> Giancarlo Celli wrote:> Hi, I need to configure a load
>> balancer with apache connector on a> jelastic server
>> that redirects requests to 6 server workers with> tomcat
>> 7 installed. Atteched you can find extract from httpd.conf> />> and workers.properties. I need to send single request to
>> tomcat> server individually, so I set sticky_session to
>> 0.So you want your clients to switch servers even
>> when they don't have to?> Could you tell me if
>> parameters are configured correctly? Is the> collector 
>> able to handle all requests? Could you give me some>
>> further advice?> > Each tomcat server is
>> configured with the following parameters:> >
>> <Connector port="80" protocol="HTTP/1.1" maxThreads="400" > />> connectionTimeout="2" redirectPort="8443" />> />> > The balancer has the following configuration:
>> Server version:> Apache/2.4.39 (codeit) Server built:
>> Apr 3 2019 18:54:14 > Architecture: 64-bit Server MPM:
>> event threaded: yes> (fixed thread count) forked: yes
>> (variable process count)Your attachments were
>> stripped. Can you please post an example workerand your
>> JkMounts from httpd.conf? We don't need the whole httpd.conf.> />- -chris-BEGIN PGP SIGNATURE-Comment:
>> Using GnuPG with Thunderbird - https://www.enigmail.net/> />> />iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl4GI1cACgkQHPApP6U8>
>> 
/>pFjHPhAAyDpqNcDm5AIe+QcsF/dB0rEfWSrfXY3DFZUjvJVTLfeqhUxS+gKNbHBf> />iXhbxnXiFVMkHqgWxcMlrsQMGK5wWL00HCOrlijGbJYa52QCn2aLFJ6buf5kU+Cy>
>> 
/>SAXOIBbpz4x12QEU6x2LJGAEXa8fMx96xyTXl0SAiWQqQ/EtVw/0y+b5h97Zpej5> />kxR04IyOMDfqyEMVeKUVQNr46yZmscHE3r9Bo49mVqmLjD8a/tzHZybTuFVeW6xj>
>> 
/>lILNuPwBL+cMz5ImqfW3qQUKyKLC6Bo9gdeamIXYg4z/66XwFmBUTP/mcTf0Up67> />rbaJWgg8Si2exZhRJeB5z51hZiEXGWldkBljvwUjevZcjo9dEqvFCY7KtxdkuA/b>
>> 
/>ZWAyxaTJkRvzusJrRItdV6m66q5aLUKehPTeIe5zm0V10Ttfc6qOpncfULQh0d1N> />Ic719F1UKYOecqZXVqJJ+mDHhdMsulvWlV18if29riQe2mu+VUGlkjFYuxgm7TCp>
>> 
/>zKGzdDAI3v/9b5lLtKYqCDaIFjH0MnBjGo+x9gTvpvQRIrdC4

Re: [OT] Re: How to set apache load balancer for send request to 6 tomcat server

2019-12-31 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Zahid,

On 12/27/19 10:33, Zahid Rahman wrote:
> Good,  please expand

Please ask a separate wquestion on the list so we don't hijack this
thread.

- -chris

> On Fri, 27 Dec 2019, 15:27 Christopher Schultz, < 
> ch...@christopherschultz.net> wrote:
> 
> Zahid,
> 
> On 12/23/19 15:19, Zahid Rahman wrote:
>>>> If your backend tomcat servers are running on different
>>>> physical machines therefore with different ip addresses then
>>>> there is nothing wrong with each backend  tomcat server
>>>> listening on same port (80) of each machine. Further to
>>>> mod_jk worker properties file redirection.
>>>> 
>>>> It is pointless in having multiple tomcat instances running
>>>> on same machine , because the kernel will slice and share
>>>> resources as per priority level setting of OS.
> 
> I disagree. There are use-cases for running multiple Tomcat
> instances on the same machine.
> 
>>>> If you don't have heavy user activity expectations   then
>>>> this excercise is pointless.
> 
> ?
> 
> -chris
> 
>>>> On Mon, 23 Dec 2019, 17:45 Giancarlo Celli, 
>>>>  wrote:
>>>> 
>>>>> Hi, I need to configure a load balancer with apache
>>>>> connector on a jelastic server that redirects requests to 6
>>>>> server workers with tomcat 7 installed. Atteched you can
>>>>> find extract from httpd.conf and workers.properties. I need
>>>>> to send single request to tomcat server individually, so I
>>>>> set sticky_session to 0. Could you tell me if parameters
>>>>> are configured correctly? Is the collector able to handle
>>>>> all requests? Could you give me some further advice?
>>>>> 
>>>>> Each tomcat server is configured with the following
>>>>> parameters:
>>>>> 
>>>>> >>>> connectionTimeout="2" redirectPort="8443" />
>>>>> 
>>>>> The balancer has the following configuration: Server
>>>>> version: Apache/2.4.39 (codeit) Server built:   Apr  3 2019
>>>>> 18:54:14 Architecture:   64-bit Server MPM: event
>>>>> threaded: yes (fixed thread count) forked: yes
>>>>> (variable process count)
>>>>> 
>>>>> 
>>>>> Thanks. Best regards.
>>>>> 
>>>>> 
>>>>> --
- ---
>>>>>
>>>>>
>
>>>>> 
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
>> 
>> 
> 
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl4LaYgACgkQHPApP6U8
pFgQ/g//VkvlaYWhD0j7sUfHaPFgClm/cShsvALKF5m833uaMpv/MEyRlNw7338Z
rYzn5XxLTEKA65JmpNEtGK8XxmnH8bq+o/p3a43JO7SeEqVuat34G5DFTm95PHy5
18lI1g4iRdskAINn12t2OB+hgeKyUZmm8wtQl+2IxVd2PJlmz0jQXfAQk/L+410w
Tj0E6NHZ8YIVr7euKLah8S44bbPKIMpmEkU0B+iGXQ3V7D2h6NiTDE6EWpUMcwg3
lbfsGM88UQsaAQYHSZkYCZeMbBEQTL6GP10VtcsYNa/BDo1X2QbX3C5SH7ffKP0z
ZQEBanFmM8qIYjTMwf47AjIwboXKxA/Y5bMvcB1l7sshKYLZOsuPNUH5caCYL9Lc
+6/VJ8eYlhcM1hJAIQ6qMM0fvhfaaNR4HJTsOEQIPSzrT1ctAiyrmxLQKih1qY01
WAaZ0UE/gACYeqmRjGaTPrznBQI6cHKvDoZEdX9kW7pm3MrKaMZ/WeWJpFZiwVUb
QhG/NDqRjHs3hi8X0qqxNWGWhW1KX9YPV5xBacvURdrbeoYysZKsf+qWyFy+vtSI
pefwbzYWZCWiBQ4/RYP+QDkC23iy1k28i0n8X9//s0xbgQBQrjX7fv/Jt7EGbmcX
cd8sR2mr6JUZkb/GSZjhUsFPuelTgskPhKFxy23iz+QtMLv3UqI=
=gVmH
-END PGP SIGNATURE-

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



Re[2]: How to set apache load balancer for send request to 6 tomcat server

2019-12-30 Thread Giancarlo Celli

Hi Chris,
to avoid any kind of overload, I would like every single request to be 
forwarded to a backend server.

I attach the files again hoping you can view them correctly.
I await your suggestions.
Best regards.
Giancarlo


-- Messaggio originale --
Da: "Christopher Schultz" 
A: users@tomcat.apache.org
Inviato: 27/12/2019 16:29:28
Oggetto: Re: How to set apache load balancer for send request to 6 
tomcat server



Firma ha problemi
-BEGIN PGP SIGNED MESSAGE-Hash: SHA256/>Giancarlo,On 12/23/19 12:45, Giancarlo Celli wrote:/>> Hi, I need to configure a load balancer with apache connector on 
a> jelastic server that redirects requests to 6 server workers 
with> tomcat 7 installed. Atteched you can find extract from 
httpd.conf> and workers.properties. I need to send single 
request to tomcat> server individually, so I set 
sticky_session to 0.So you want your clients to switch 
servers even when they don't have to?> Could you tell me 
if parameters are configured correctly? Is the> collector able 
to handle all requests? Could you give me some> further 
advice?> > Each tomcat server is configured with the 
following parameters:> > <Connector port="80" 
protocol="HTTP/1.1" maxThreads="400" > 
connectionTimeout="2" redirectPort="8443" />> />> The balancer has the following configuration: Server version:/>> Apache/2.4.39 (codeit) Server built: Apr 3 2019 18:54:14 />> Architecture: 64-bit Server MPM: event threaded: yes> 
(fixed thread count) forked: yes (variable process count)/>Your attachments were stripped. Can you please post an example 
workerand your JkMounts from httpd.conf? We don't need the whole 
httpd.conf.- -chris-BEGIN PGP SIGNATURE-/>Comment: Using GnuPG with Thunderbird - https://www.enigmail.net//>/>iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl4GI1cACgkQHPApP6U8/>pFjHPhAAyDpqNcDm5AIe+QcsF/dB0rEfWSrfXY3DFZUjvJVTLfeqhUxS+gKNbHBf/>iXhbxnXiFVMkHqgWxcMlrsQMGK5wWL00HCOrlijGbJYa52QCn2aLFJ6buf5kU+Cy/>SAXOIBbpz4x12QEU6x2LJGAEXa8fMx96xyTXl0SAiWQqQ/EtVw/0y+b5h97Zpej5/>kxR04IyOMDfqyEMVeKUVQNr46yZmscHE3r9Bo49mVqmLjD8a/tzHZybTuFVeW6xj/>lILNuPwBL+cMz5ImqfW3qQUKyKLC6Bo9gdeamIXYg4z/66XwFmBUTP/mcTf0Up67/>rbaJWgg8Si2exZhRJeB5z51hZiEXGWldkBljvwUjevZcjo9dEqvFCY7KtxdkuA/b/>ZWAyxaTJkRvzusJrRItdV6m66q5aLUKehPTeIe5zm0V10Ttfc6qOpncfULQh0d1N/>Ic719F1UKYOecqZXVqJJ+mDHhdMsulvWlV18if29riQe2mu+VUGlkjFYuxgm7TCp/>zKGzdDAI3v/9b5lLtKYqCDaIFjH0MnBjGo+x9gTvpvQRIrdC4OGPTiw8W3Urveln/>ZycUWihsb26vqaog7jJn6SLMJ/N8nVyw64Uc/slN3tCAIwHvzpu6dTVBEoXI6Jsx/>29Nqyx6B1tSXrSYXDN0PO7PmpBffS7LDEd1luYXqAtcUilgsb4Q==KK92/>-END PGP SIGNATURE-


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org
worker.list=loadbalancer
worker.maintain=300

worker.node1.port=8009
worker.node1.host=XX.XX.XX.01
worker.node1.type=ajp13
worker.node1.ping_mode=P
worker.node1.ping_timeout=1
worker.node1.lbfactor=1
worker.node1.socket_timeout=30
worker.node1.connection_pool_timeout=20
worker.node1.recover_time=5

worker.node2.reference=worker.node1
worker.node2.host=XX.XX.XX.02

worker.node3.reference=worker.node1
worker.node3.host=XX.XX.XX.03

worker.node4.reference=worker.node1
worker.node4.host=XX.XX.XX.04

worker.node5.reference=worker.node1
worker.node5.host=XX.XX.XX.05

worker.node6.reference=worker.node1
worker.node6.host=XX.XX.XX.06

worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=node1,node2,node3,node4,node5,node6
worker.loadbalancer.sticky_session=0
worker.loadbalancer.method=B

StartServers     1
MinSpareServers    1
MaxSpareServers    3
# ServerLimit     13
ServerLimit     13
# MaxRequestWorkers 13
MaxRequestWorkers 13
MaxConnectionsPerChild     500



StartServers     1
ServerLimit     13
MaxRequestWorkers     25
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxConnectionsPerChild     500



StartServers     2
# ServerLimit     13
ServerLimit     13
MaxRequestWorkers     325
ThreadsPerChild     25
AsyncRequestWorkerFactor   2
MaxConnectionsPerChild     500

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

Re: [OT] Re: How to set apache load balancer for send request to 6 tomcat server

2019-12-27 Thread Zahid Rahman
Good,  please expand

On Fri, 27 Dec 2019, 15:27 Christopher Schultz, <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Zahid,
>
> On 12/23/19 15:19, Zahid Rahman wrote:
> > If your backend tomcat servers are running on different physical
> > machines therefore with different ip addresses then there is
> > nothing wrong with each backend  tomcat server listening on same
> > port (80) of each machine. Further to mod_jk worker properties file
> > redirection.
> >
> > It is pointless in having multiple tomcat instances running on same
> > machine , because the kernel will slice and share resources as per
> > priority level setting of OS.
>
> I disagree. There are use-cases for running multiple Tomcat instances
> on the same machine.
>
> > If you don't have heavy user activity expectations   then this
> > excercise is pointless.
>
> ?
>
> - -chris
>
> > On Mon, 23 Dec 2019, 17:45 Giancarlo Celli,
> >  wrote:
> >
> >> Hi, I need to configure a load balancer with apache connector on
> >> a jelastic server that redirects requests to 6 server workers
> >> with tomcat 7 installed. Atteched you can find extract from
> >> httpd.conf and workers.properties. I need to send single request
> >> to tomcat server individually, so I set sticky_session to 0.
> >> Could you tell me if parameters are configured correctly? Is the
> >> collector able to handle all requests? Could you give me some
> >> further advice?
> >>
> >> Each tomcat server is configured with the following parameters:
> >>
> >>  >> connectionTimeout="2" redirectPort="8443" />
> >>
> >> The balancer has the following configuration: Server version:
> >> Apache/2.4.39 (codeit) Server built:   Apr  3 2019 18:54:14
> >> Architecture:   64-bit Server MPM: event threaded: yes
> >> (fixed thread count) forked: yes (variable process count)
> >>
> >>
> >> Thanks. Best regards.
> >>
> >>
> >> -
> >>
> >>
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> >> For additional commands, e-mail: users-h...@tomcat.apache.org
> >
> -BEGIN PGP SIGNATURE-
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl4GIuwACgkQHPApP6U8
> pFgmQA//aMZLwDbtop83M7HTtM2P8vXzO7Z1cbvu5NA8yvt4IjMBA9WyrJ+XYhDn
> pRHJP2S0LTLmWrZ3n8o2QpdUGkMwWwpnhuHsr1zqzwhIxWtB1tmBoIgkueM92Yk1
> wXOHuy+PRlXGTRkujprb6bwUH2OxGp3Z6w3X1kqdvgJtZ6ZydBFD+eDv0epOSPay
> z3gvFraikSSY6IAf2y3gI/FTMT8kjUmo+M9TnnZ2Lbjmaxg/abmRa1rypcaMLXPf
> DjlQ0SAJtu2lS4wtQphY1beAsP2l/EXlMPaWIy2HbbaTBmZNtevM21OyxsWAdXQH
> SNmPDIC0AycTJfpeeB3tUbAtPVBKUkoOoaMLEkuAp1JdqnrW1KGH71cAvDkdJIBK
> 7b8mXTE07/mVpak4XhIqfdEkTLI+QWpYDIds6xWPYFokNtfevD6ZIBjbtNyqFcgE
> CEFHOkiM9JtzEOLJu24bS6MAbeYx4TnkvcZZF3hd79/Cxbusw2rlTZEvvKSSDXUn
> tWi4/xeTq1o8slmWf+A241qrr4SyHdOR8XVMUT4RvXSCcmBdkh0UDsxaMXLyx/AK
> yg7BxhU8d2OTmOfsFzRMCYZOpw+P+a5zE+3lNkeTbLuIamn9igKm/E7msd/enK4Z
> yHWd7tof+JXHGyhtYsBlr8tM8cm9pS2R02kLHAr34s7t0TjL9D4=
> =qkR+
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: How to set apache load balancer for send request to 6 tomcat server

2019-12-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Giancarlo,

On 12/23/19 12:45, Giancarlo Celli wrote:
> Hi, I need to configure a load balancer with apache connector on a
> jelastic server that redirects requests to 6 server workers with
> tomcat 7 installed. Atteched you can find extract from httpd.conf
> and workers.properties. I need to send single request to tomcat
> server individually, so I set sticky_session to 0.

So you want your clients to switch servers even when they don't have to?

> Could you tell me if parameters are configured correctly? Is the
> collector able to handle all requests? Could you give me some
> further advice?
> 
> Each tomcat server is configured with the following parameters:
> 
>  connectionTimeout="2" redirectPort="8443" />
> 
> The balancer has the following configuration: Server version:
> Apache/2.4.39 (codeit) Server built:   Apr  3 2019 18:54:14 
> Architecture:   64-bit Server MPM: event threaded: yes
> (fixed thread count) forked: yes (variable process count)

Your attachments were stripped. Can you please post an example worker
and your JkMounts from httpd.conf? We don't need the whole httpd.conf.

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

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl4GI1cACgkQHPApP6U8
pFjHPhAAyDpqNcDm5AIe+QcsF/dB0rEfWSrfXY3DFZUjvJVTLfeqhUxS+gKNbHBf
iXhbxnXiFVMkHqgWxcMlrsQMGK5wWL00HCOrlijGbJYa52QCn2aLFJ6buf5kU+Cy
SAXOIBbpz4x12QEU6x2LJGAEXa8fMx96xyTXl0SAiWQqQ/EtVw/0y+b5h97Zpej5
kxR04IyOMDfqyEMVeKUVQNr46yZmscHE3r9Bo49mVqmLjD8a/tzHZybTuFVeW6xj
lILNuPwBL+cMz5ImqfW3qQUKyKLC6Bo9gdeamIXYg4z/66XwFmBUTP/mcTf0Up67
rbaJWgg8Si2exZhRJeB5z51hZiEXGWldkBljvwUjevZcjo9dEqvFCY7KtxdkuA/b
ZWAyxaTJkRvzusJrRItdV6m66q5aLUKehPTeIe5zm0V10Ttfc6qOpncfULQh0d1N
Ic719F1UKYOecqZXVqJJ+mDHhdMsulvWlV18if29riQe2mu+VUGlkjFYuxgm7TCp
zKGzdDAI3v/9b5lLtKYqCDaIFjH0MnBjGo+x9gTvpvQRIrdC4OGPTiw8W3Urveln
ZycUWihsb26vqaog7jJn6SLMJ/N8nVyw64Uc/slN3tCAIwHvzpu6dTVBEoXI6Jsx
29Nqyx6B1tSXrSYXDN0PO7PmpBffS7LDEd1luYXqAtcUilgsb4Q=
=KK92
-END PGP SIGNATURE-

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



[OT] Re: How to set apache load balancer for send request to 6 tomcat server

2019-12-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Zahid,

On 12/23/19 15:19, Zahid Rahman wrote:
> If your backend tomcat servers are running on different physical
> machines therefore with different ip addresses then there is
> nothing wrong with each backend  tomcat server listening on same
> port (80) of each machine. Further to mod_jk worker properties file
> redirection.
> 
> It is pointless in having multiple tomcat instances running on same
> machine , because the kernel will slice and share resources as per
> priority level setting of OS.

I disagree. There are use-cases for running multiple Tomcat instances
on the same machine.

> If you don't have heavy user activity expectations   then this
> excercise is pointless.

?

- -chris

> On Mon, 23 Dec 2019, 17:45 Giancarlo Celli,
>  wrote:
> 
>> Hi, I need to configure a load balancer with apache connector on
>> a jelastic server that redirects requests to 6 server workers
>> with tomcat 7 installed. Atteched you can find extract from
>> httpd.conf and workers.properties. I need to send single request
>> to tomcat server individually, so I set sticky_session to 0. 
>> Could you tell me if parameters are configured correctly? Is the
>> collector able to handle all requests? Could you give me some
>> further advice?
>> 
>> Each tomcat server is configured with the following parameters:
>> 
>> > connectionTimeout="2" redirectPort="8443" />
>> 
>> The balancer has the following configuration: Server version:
>> Apache/2.4.39 (codeit) Server built:   Apr  3 2019 18:54:14 
>> Architecture:   64-bit Server MPM: event threaded: yes
>> (fixed thread count) forked: yes (variable process count)
>> 
>> 
>> Thanks. Best regards.
>> 
>> 
>> -
>>
>> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl4GIuwACgkQHPApP6U8
pFgmQA//aMZLwDbtop83M7HTtM2P8vXzO7Z1cbvu5NA8yvt4IjMBA9WyrJ+XYhDn
pRHJP2S0LTLmWrZ3n8o2QpdUGkMwWwpnhuHsr1zqzwhIxWtB1tmBoIgkueM92Yk1
wXOHuy+PRlXGTRkujprb6bwUH2OxGp3Z6w3X1kqdvgJtZ6ZydBFD+eDv0epOSPay
z3gvFraikSSY6IAf2y3gI/FTMT8kjUmo+M9TnnZ2Lbjmaxg/abmRa1rypcaMLXPf
DjlQ0SAJtu2lS4wtQphY1beAsP2l/EXlMPaWIy2HbbaTBmZNtevM21OyxsWAdXQH
SNmPDIC0AycTJfpeeB3tUbAtPVBKUkoOoaMLEkuAp1JdqnrW1KGH71cAvDkdJIBK
7b8mXTE07/mVpak4XhIqfdEkTLI+QWpYDIds6xWPYFokNtfevD6ZIBjbtNyqFcgE
CEFHOkiM9JtzEOLJu24bS6MAbeYx4TnkvcZZF3hd79/Cxbusw2rlTZEvvKSSDXUn
tWi4/xeTq1o8slmWf+A241qrr4SyHdOR8XVMUT4RvXSCcmBdkh0UDsxaMXLyx/AK
yg7BxhU8d2OTmOfsFzRMCYZOpw+P+a5zE+3lNkeTbLuIamn9igKm/E7msd/enK4Z
yHWd7tof+JXHGyhtYsBlr8tM8cm9pS2R02kLHAr34s7t0TjL9D4=
=qkR+
-END PGP SIGNATURE-

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



Re: Re[2]: How to set apache load balancer for send request to 6 tomcat server

2019-12-24 Thread Zahid Rahman
This is what a typical workers.properties file look like.this is not same
as your configuration

*Workers properties*
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
worker.list=balancer,status

worker.tomcat1.type=ajp13
worker.tomcat1.port=8009
worker.tomcat1.host=localhost

worker.tomcat2.type=ajp13
worker.tomcat2.port=8010
worker.tomcat2.host=localhost

worker.tomcat3.type=ajp13
worker.tomcat3.port=8011
worker.tomcat3.host=localhost


worker.balancer.type=lb
worker.balancer.balance_workers=tomcat1,tomcat2,tomcat3

worker.status.type=status

On Tue, 24 Dec 2019, 09:17 Giancarlo Celli, 
wrote:

> Thanks for the reply.
> More than anything else my question is to know if the configuration
> parameters of the various threads, connections, etc. they are set up well
> or if they could somehow down the service.
> And if you recommend any changes to optimize the service itself.
> He again attached the files with the extracts of the configurations
> Thanks.
> Best regards.
> Giancarlo
>
>
> -- Messaggio originale --
> Da: "Zahid Rahman" 
> A: "Tomcat Users List" ; "Giancarlo Celli" <
> giancarlo.ce...@flottaweb.com>
> Inviato: 23/12/2019 23:56:41
> Oggetto: Re: How to set apache load balancer for send request to 6 tomcat
> server
>
> If you wish we can work the problem , piece by piece through logical
> construction of the solution.
>
>
>
> On Mon, 23 Dec 2019, 17:45 Giancarlo Celli,  >
> wrote:
>
>
> Hi,
> I need to configure a load balancer with apache connector on a jelastic
> server that redirects requests to 6 server workers with tomcat 7 installed.
> Atteched you can find extract from httpd.conf and workers.properties.
> I need to send single request to tomcat server individually, so I set
> sticky_session to 0.
> Could you tell me if parameters are configured correctly?
> Is the collector able to handle all requests?
> Could you give me some further advice?
>
> Each tomcat server is configured with the following parameters:
>
>  maxThreads="400"
> connectionTimeout="2"
> redirectPort="8443" />
>
> The balancer has the following configuration:
> Server version: Apache/2.4.39 (codeit)
> Server built: Apr 3 2019 18:54:14
> Architecture: 64-bit
> Server MPM: event
> threaded: yes (fixed thread count)
> forked: yes (variable process count)
>
>
> Thanks.
> Best regards.
>
>
> -
> 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


Re: Re[2]: How to set apache load balancer for send request to 6 tomcat server

2019-12-24 Thread Zahid Rahman
Load balancing Algorithms

https://youtu.be/iqOTT7_7qXY

On Tue, 24 Dec 2019, 10:06 Zahid Rahman,  wrote:

> There is a really great series of videos on this subject. He is
> referencing tomcat Apache website.
> If you speak German
>
> https://youtu.be/mQKZ8-EfBHU
>
> On Tue, 24 Dec 2019, 09:17 Giancarlo Celli, 
> wrote:
>
>> Thanks for the reply.
>> More than anything else my question is to know if the configuration
>> parameters of the various threads, connections, etc. they are set up well
>> or if they could somehow down the service.
>> And if you recommend any changes to optimize the service itself.
>> He again attached the files with the extracts of the configurations
>> Thanks.
>> Best regards.
>> Giancarlo
>>
>>
>> -- Messaggio originale --
>> Da: "Zahid Rahman" 
>> A: "Tomcat Users List" ; "Giancarlo Celli" <
>> giancarlo.ce...@flottaweb.com>
>> Inviato: 23/12/2019 23:56:41
>> Oggetto: Re: How to set apache load balancer for send request to 6 tomcat
>> server
>>
>> If you wish we can work the problem , piece by piece through logical
>> construction of the solution.
>>
>>
>>
>> On Mon, 23 Dec 2019, 17:45 Giancarlo Celli, <
>> giancarlo.ce...@flottaweb.com>
>> wrote:
>>
>>
>> Hi,
>> I need to configure a load balancer with apache connector on a jelastic
>> server that redirects requests to 6 server workers with tomcat 7
>> installed.
>> Atteched you can find extract from httpd.conf and workers.properties.
>> I need to send single request to tomcat server individually, so I set
>> sticky_session to 0.
>> Could you tell me if parameters are configured correctly?
>> Is the collector able to handle all requests?
>> Could you give me some further advice?
>>
>> Each tomcat server is configured with the following parameters:
>>
>> > maxThreads="400"
>> connectionTimeout="2"
>> redirectPort="8443" />
>>
>> The balancer has the following configuration:
>> Server version: Apache/2.4.39 (codeit)
>> Server built: Apr 3 2019 18:54:14
>> Architecture: 64-bit
>> Server MPM: event
>> threaded: yes (fixed thread count)
>> forked: yes (variable process count)
>>
>>
>> Thanks.
>> Best regards.
>>
>>
>> -
>> 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
>
>


Re: Re[2]: How to set apache load balancer for send request to 6 tomcat server

2019-12-24 Thread Zahid Rahman
There is a really great series of videos on this subject. He is referencing
tomcat Apache website.
If you speak German

https://youtu.be/mQKZ8-EfBHU

On Tue, 24 Dec 2019, 09:17 Giancarlo Celli, 
wrote:

> Thanks for the reply.
> More than anything else my question is to know if the configuration
> parameters of the various threads, connections, etc. they are set up well
> or if they could somehow down the service.
> And if you recommend any changes to optimize the service itself.
> He again attached the files with the extracts of the configurations
> Thanks.
> Best regards.
> Giancarlo
>
>
> -- Messaggio originale --
> Da: "Zahid Rahman" 
> A: "Tomcat Users List" ; "Giancarlo Celli" <
> giancarlo.ce...@flottaweb.com>
> Inviato: 23/12/2019 23:56:41
> Oggetto: Re: How to set apache load balancer for send request to 6 tomcat
> server
>
> If you wish we can work the problem , piece by piece through logical
> construction of the solution.
>
>
>
> On Mon, 23 Dec 2019, 17:45 Giancarlo Celli,  >
> wrote:
>
>
> Hi,
> I need to configure a load balancer with apache connector on a jelastic
> server that redirects requests to 6 server workers with tomcat 7 installed.
> Atteched you can find extract from httpd.conf and workers.properties.
> I need to send single request to tomcat server individually, so I set
> sticky_session to 0.
> Could you tell me if parameters are configured correctly?
> Is the collector able to handle all requests?
> Could you give me some further advice?
>
> Each tomcat server is configured with the following parameters:
>
>  maxThreads="400"
> connectionTimeout="2"
> redirectPort="8443" />
>
> The balancer has the following configuration:
> Server version: Apache/2.4.39 (codeit)
> Server built: Apr 3 2019 18:54:14
> Architecture: 64-bit
> Server MPM: event
> threaded: yes (fixed thread count)
> forked: yes (variable process count)
>
>
> Thanks.
> Best regards.
>
>
> -
> 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


Re[2]: How to set apache load balancer for send request to 6 tomcat server

2019-12-24 Thread Giancarlo Celli

Thanks for the reply.
More than anything else my question is to know if the configuration 
parameters of the various threads, connections, etc. they are set up 
well or if they could somehow down the service.

And if you recommend any changes to optimize the service itself.
He again attached the files with the extracts of the configurations
Thanks.
Best regards.
Giancarlo


-- Messaggio originale --
Da: "Zahid Rahman" 
A: "Tomcat Users List" ; "Giancarlo Celli" 


Inviato: 23/12/2019 23:56:41
Oggetto: Re: How to set apache load balancer for send request to 6 
tomcat server



If you wish we can work the problem , piece by piece through logical
construction of the solution.



On Mon, 23 Dec 2019, 17:45 Giancarlo Celli, 
wrote:


 Hi,
 I need to configure a load balancer with apache connector on a jelastic
 server that redirects requests to 6 server workers with tomcat 7 installed.
 Atteched you can find extract from httpd.conf and workers.properties.
 I need to send single request to tomcat server individually, so I set
 sticky_session to 0.
 Could you tell me if parameters are configured correctly?
 Is the collector able to handle all requests?
 Could you give me some further advice?

 Each tomcat server is configured with the following parameters:

 

 The balancer has the following configuration:
 Server version: Apache/2.4.39 (codeit)
 Server built:   Apr  3 2019 18:54:14
 Architecture:   64-bit
 Server MPM: event
   threaded: yes (fixed thread count)
 forked: yes (variable process count)


 Thanks.
 Best regards.


 -
 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

Re: How to set apache load balancer for send request to 6 tomcat server

2019-12-23 Thread Zahid Rahman
If you wish we can work the problem , piece by piece through logical
construction of the solution.



On Mon, 23 Dec 2019, 17:45 Giancarlo Celli, 
wrote:

> Hi,
> I need to configure a load balancer with apache connector on a jelastic
> server that redirects requests to 6 server workers with tomcat 7 installed.
> Atteched you can find extract from httpd.conf and workers.properties.
> I need to send single request to tomcat server individually, so I set
> sticky_session to 0.
> Could you tell me if parameters are configured correctly?
> Is the collector able to handle all requests?
> Could you give me some further advice?
>
> Each tomcat server is configured with the following parameters:
>
> maxThreads="400"
>connectionTimeout="2"
>redirectPort="8443" />
>
> The balancer has the following configuration:
> Server version: Apache/2.4.39 (codeit)
> Server built:   Apr  3 2019 18:54:14
> Architecture:   64-bit
> Server MPM: event
>   threaded: yes (fixed thread count)
> forked: yes (variable process count)
>
>
> Thanks.
> Best regards.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org


Re: How to set apache load balancer for send request to 6 tomcat server

2019-12-23 Thread Zahid Rahman
If your backend tomcat servers are running on different physical machines
therefore with different ip addresses then there is nothing wrong with each
backend  tomcat server listening on same port (80) of each machine. Further
to mod_jk worker properties file redirection.

It is pointless in having multiple tomcat instances running on same machine
, because the kernel will slice and share resources as per priority level
setting of OS.

If you don't have heavy user activity expectations   then this excercise is
pointless.


On Mon, 23 Dec 2019, 17:45 Giancarlo Celli, 
wrote:

> Hi,
> I need to configure a load balancer with apache connector on a jelastic
> server that redirects requests to 6 server workers with tomcat 7 installed.
> Atteched you can find extract from httpd.conf and workers.properties.
> I need to send single request to tomcat server individually, so I set
> sticky_session to 0.
> Could you tell me if parameters are configured correctly?
> Is the collector able to handle all requests?
> Could you give me some further advice?
>
> Each tomcat server is configured with the following parameters:
>
> maxThreads="400"
>connectionTimeout="2"
>redirectPort="8443" />
>
> The balancer has the following configuration:
> Server version: Apache/2.4.39 (codeit)
> Server built:   Apr  3 2019 18:54:14
> Architecture:   64-bit
> Server MPM: event
>   threaded: yes (fixed thread count)
> forked: yes (variable process count)
>
>
> Thanks.
> Best regards.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org


Re: How to set apache load balancer for send request to 6 tomcat server

2019-12-23 Thread Zahid Rahman
Your home page is in Italian
https://www.flottaweb.com/en/

While your login page is in English
https://www.flottaweb.com/en/login/


On Mon, 23 Dec 2019, 17:45 Giancarlo Celli, 
wrote:

> Hi,
> I need to configure a load balancer with apache connector on a jelastic
> server that redirects requests to 6 server workers with tomcat 7 installed.
> Atteched you can find extract from httpd.conf and workers.properties.
> I need to send single request to tomcat server individually, so I set
> sticky_session to 0.
> Could you tell me if parameters are configured correctly?
> Is the collector able to handle all requests?
> Could you give me some further advice?
>
> Each tomcat server is configured with the following parameters:
>
> maxThreads="400"
>connectionTimeout="2"
>redirectPort="8443" />
>
> The balancer has the following configuration:
> Server version: Apache/2.4.39 (codeit)
> Server built:   Apr  3 2019 18:54:14
> Architecture:   64-bit
> Server MPM: event
>   threaded: yes (fixed thread count)
> forked: yes (variable process count)
>
>
> Thanks.
> Best regards.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org


How to set apache load balancer for send request to 6 tomcat server

2019-12-23 Thread Giancarlo Celli

Hi,
I need to configure a load balancer with apache connector on a jelastic 
server that redirects requests to 6 server workers with tomcat 7 
installed.

Atteched you can find extract from httpd.conf and workers.properties.
I need to send single request to tomcat server individually, so I set 
sticky_session to 0.

Could you tell me if parameters are configured correctly?
Is the collector able to handle all requests?
Could you give me some further advice?

Each tomcat server is configured with the following parameters:



The balancer has the following configuration:
Server version: Apache/2.4.39 (codeit)
Server built:   Apr  3 2019 18:54:14
Architecture:   64-bit
Server MPM: event
  threaded: yes (fixed thread count)
forked: yes (variable process count)


Thanks.
Best regards.

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

Re: [E] Re: Official documentation for running an embedded Tomcat server

2019-11-25 Thread Bauer, Margaret M (Peggy)
Ease of deployment and build in the AWS world.

On Mon, Nov 25, 2019 at 3:56 PM Behrang Saeedzadeh 
wrote:

> For an example use case, see Spring Boot. It can use an embedded Tomcat and
> build an executable Uber Jar. Then you can start your Web app by running
> java -jar app.jar.
>
> On Tue, 26 Nov. 2019, 2:29 am Mladen Adamović, 
> wrote:
>
> > I wonder why somebody would want to run "embedded Tomcat" and what it
> > actually means?
> > I'm working professionally in software engineering since 2003 and I'm
> > puzzled.
> >
> > From looking into that article, it seems that Java app starts Tomcat, why
> > somebody would want that?
> >
> >
> > On Sun, Nov 24, 2019 at 12:27 AM Behrang Saeedzadeh  >
> > wrote:
> >
> > > I will create a PR if I find the time to write one.
> > >
> > > On Sat, Nov 23, 2019 at 9:40 PM Mark Thomas  wrote:
> > >
> > > > On 23/11/2019 08:17, Behrang Saeedzadeh wrote:
> > > > > Hi all,
> > > > >
> > > > > Are there any official docs for how to run Tomcat as an embedded
> > > server?
> > > > > Searching returns some results such as
> > > > >
> > > >
> > >
> >
> https://urldefense.proofpoint.com/v2/url?u=https-3A__devcenter.heroku.com_articles_create-2Da-2Djava-2Dweb-2Dapplication-2Dusing-2Dembedded-2Dtomcat&d=DwIFaQ&c=udBTRvFvXC5Dhqg7UHpJlPps3mZ3LRxpb6__0PomBTQ&r=JYuCIQ8r7H-c_yYFTZ4gdv4goO0lCCtidMRmNza4zoA&m=wnrcnb8haPnDfVwSRvz9Cm28Kj7ACYEr8ZF0JTdMDLM&s=RoC8ts62eTgtf8yZNCja1R0TFRfhZHsoFF5x7IIPqsM&e=
> > > > > but I haven't seen any official docs.
> > > > >
> > > > > Are there any?
> > > >
> > > >
> > >
> >
> https://urldefense.proofpoint.com/v2/url?u=http-3A__tomcat.apache.org_tomcat-2D9.0-2Ddoc_api_org_apache_catalina_startup_Tomcat.html&d=DwIFaQ&c=udBTRvFvXC5Dhqg7UHpJlPps3mZ3LRxpb6__0PomBTQ&r=JYuCIQ8r7H-c_yYFTZ4gdv4goO0lCCtidMRmNza4zoA&m=wnrcnb8haPnDfVwSRvz9Cm28Kj7ACYEr8ZF0JTdMDLM&s=S1eZ7tY4G6jD32KhDWaVir7gfQaATAOrJ4qlUGGy5iY&e=
> > > >
> > > > is the closest thing we have but I suspect parts of it are out of
> date.
> > > > The unit tests are a good source of samples of how to use it.
> > > >
> > > > Care to contribute a how-to page for the docs?
> > > >
> > > > Mark
> > > >
> > > > -
> > > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > > > For additional commands, e-mail: users-h...@tomcat.apache.org
> > > >
> > > >
> > >
> >
>


-- 
*Peggy Bauer*
CAO Production Support
214-770-1782


Re: Official documentation for running an embedded Tomcat server

2019-11-25 Thread Behrang Saeedzadeh
For an example use case, see Spring Boot. It can use an embedded Tomcat and
build an executable Uber Jar. Then you can start your Web app by running
java -jar app.jar.

On Tue, 26 Nov. 2019, 2:29 am Mladen Adamović, 
wrote:

> I wonder why somebody would want to run "embedded Tomcat" and what it
> actually means?
> I'm working professionally in software engineering since 2003 and I'm
> puzzled.
>
> From looking into that article, it seems that Java app starts Tomcat, why
> somebody would want that?
>
>
> On Sun, Nov 24, 2019 at 12:27 AM Behrang Saeedzadeh 
> wrote:
>
> > I will create a PR if I find the time to write one.
> >
> > On Sat, Nov 23, 2019 at 9:40 PM Mark Thomas  wrote:
> >
> > > On 23/11/2019 08:17, Behrang Saeedzadeh wrote:
> > > > Hi all,
> > > >
> > > > Are there any official docs for how to run Tomcat as an embedded
> > server?
> > > > Searching returns some results such as
> > > >
> > >
> >
> https://devcenter.heroku.com/articles/create-a-java-web-application-using-embedded-tomcat
> > > > but I haven't seen any official docs.
> > > >
> > > > Are there any?
> > >
> > >
> >
> http://tomcat.apache.org/tomcat-9.0-doc/api/org/apache/catalina/startup/Tomcat.html
> > >
> > > is the closest thing we have but I suspect parts of it are out of date.
> > > The unit tests are a good source of samples of how to use it.
> > >
> > > Care to contribute a how-to page for the docs?
> > >
> > > Mark
> > >
> > > -
> > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > > For additional commands, e-mail: users-h...@tomcat.apache.org
> > >
> > >
> >
>


Re: [OT] Official documentation for running an embedded Tomcat server

2019-11-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Mladen,

On 11/25/19 10:28, Mladen Adamović wrote:
> I wonder why somebody would want to run "embedded Tomcat" and what
> it actually means?

It means that the application starts the servlet container, not the
other way around.

> I'm working professionally in software engineering since 2003 and
> I'm puzzled.
> 
> From looking into that article, it seems that Java app starts
> Tomcat, why somebody would want that?

I think if you don't understand why anyone would want to do that, then
it would be hard to understand :)

Perhaps the focus of the application is not servlet-related, but there
is a portion where it makes sense to have a servlet container running.
The application uses Tomcat as an embedded servlet container in that cas
e.

Also, many containerized environments favor a single application
entry-point. Instead of installing the servlet container (really the
application, here), then some other associated bits (which happens to
be your application) and then launching the application (Tomcat), you
install a single application and execute it. The application uses
Tomcat as an embedded servlet container basically to bootstrap itself.

Finally, in either of the above scenarios, it's possible that you want
to fetch your servlet container configuration from some kind of
centralized place (e.g. Kubernetes in the case of clustered
containerization, perhaps some other mechanism in other cases). Tomcat
itself isn't really good at loading its configuration from arbitrary
places, even though it's possible to e.g. load remotely, etc. Instead,
the application starts, locates its configuration, then launches
Tomcat with that configuration. It's easier for the application to
understand the nuances of that environment, locating its
configuration, etc. than it would be to add layers of plug-ins, etc.
to Tomcat to accomplish the same thing.

Hope that helps,
- -chris

> On Sun, Nov 24, 2019 at 12:27 AM Behrang Saeedzadeh
>  wrote:
> 
>> I will create a PR if I find the time to write one.
>> 
>> On Sat, Nov 23, 2019 at 9:40 PM Mark Thomas 
>> wrote:
>> 
>>> On 23/11/2019 08:17, Behrang Saeedzadeh wrote:
 Hi all,
 
 Are there any official docs for how to run Tomcat as an
 embedded
>> server?
 Searching returns some results such as
 
>>> 
>> https://devcenter.heroku.com/articles/create-a-java-web-application-u
sing-embedded-tomcat

>> 
but I haven't seen any official docs.
 
 Are there any?
>>> 
>>> 
>> http://tomcat.apache.org/tomcat-9.0-doc/api/org/apache/catalina/start
up/Tomcat.html
>>>
>>>
>> 
is the closest thing we have but I suspect parts of it are out of date.
>>> The unit tests are a good source of samples of how to use it.
>>> 
>>> Care to contribute a how-to page for the docs?
>>> 
>>> Mark
>>> 
>>> 
- -
>>>
>>> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>> 
>>> 
>> 
> 
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl3b/fQACgkQHPApP6U8
pFhVDA//R2/SivLy/r69lwzgCo3DL3H3Q3PW7TK4hcaGfiTxH7YX4VyVKxHD3YWl
hnncdwbQDJM1nsDpq6hLIs0kZ6yz+B/b6yDBgqkeu7mDo/gqpTRZHgpGEBst3t97
5t+Fxl5txHL4Fx3eO/R6IGu9JnDHr/9cpXVNq/t10b8D/Vf3k6IXx/aBBuPhdxRX
iVLJFmO3uVe/w19PKMCgdLlfF1zRQwDkzASEviOepn+AY9tpZidy0MjMkZmPsSIs
dszlLSlUWjuLYWre2tIg2DF2GAwX02JDCVlgk68U120XMjWVlR8usnSdaeg8fTKd
4s2VO64z3s9umSIXFnexP3Nv4BX4Nm2wn4j3vOZSz3W/jTu8kJlr3rUt6gSSBHc4
4guhg5uWeS67bpOovgIxVHDL3CX83oC2WIhd7U/iTH8Xcf23hI/6EWNc9BalvAs7
j27WTFOlVFx45TeUoHJ82KjEulvvRb/zyeopytrymXAPBBzaVGslmgOCn5lZoG0k
DH3kmPyVeVYdP2frcTNyTVvcQuGZ4fiNFoYwcDE7RXi9t+98T+AI5poREiZXryZ4
OzEptdybzb3yJ2di2MipvdYZ9erxAwMLpMIAAboPQ+YE3wzmMlu3iAReTvjNnc11
0FwRycrjtQy/ZbmDzr6hBldUoOttkTyeN/VbSFGAQqBcNBW5X9A=
=tcwE
-END PGP SIGNATURE-

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



Re: Official documentation for running an embedded Tomcat server

2019-11-25 Thread Mladen Adamović
I wonder why somebody would want to run "embedded Tomcat" and what it
actually means?
I'm working professionally in software engineering since 2003 and I'm
puzzled.

>From looking into that article, it seems that Java app starts Tomcat, why
somebody would want that?


On Sun, Nov 24, 2019 at 12:27 AM Behrang Saeedzadeh 
wrote:

> I will create a PR if I find the time to write one.
>
> On Sat, Nov 23, 2019 at 9:40 PM Mark Thomas  wrote:
>
> > On 23/11/2019 08:17, Behrang Saeedzadeh wrote:
> > > Hi all,
> > >
> > > Are there any official docs for how to run Tomcat as an embedded
> server?
> > > Searching returns some results such as
> > >
> >
> https://devcenter.heroku.com/articles/create-a-java-web-application-using-embedded-tomcat
> > > but I haven't seen any official docs.
> > >
> > > Are there any?
> >
> >
> http://tomcat.apache.org/tomcat-9.0-doc/api/org/apache/catalina/startup/Tomcat.html
> >
> > is the closest thing we have but I suspect parts of it are out of date.
> > The unit tests are a good source of samples of how to use it.
> >
> > Care to contribute a how-to page for the docs?
> >
> > Mark
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> >
> >
>


Re: Official documentation for running an embedded Tomcat server

2019-11-23 Thread Behrang Saeedzadeh
I will create a PR if I find the time to write one.

On Sat, Nov 23, 2019 at 9:40 PM Mark Thomas  wrote:

> On 23/11/2019 08:17, Behrang Saeedzadeh wrote:
> > Hi all,
> >
> > Are there any official docs for how to run Tomcat as an embedded server?
> > Searching returns some results such as
> >
> https://devcenter.heroku.com/articles/create-a-java-web-application-using-embedded-tomcat
> > but I haven't seen any official docs.
> >
> > Are there any?
>
> http://tomcat.apache.org/tomcat-9.0-doc/api/org/apache/catalina/startup/Tomcat.html
>
> is the closest thing we have but I suspect parts of it are out of date.
> The unit tests are a good source of samples of how to use it.
>
> Care to contribute a how-to page for the docs?
>
> Mark
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Official documentation for running an embedded Tomcat server

2019-11-23 Thread Mark Thomas
On 23/11/2019 08:17, Behrang Saeedzadeh wrote:
> Hi all,
> 
> Are there any official docs for how to run Tomcat as an embedded server?
> Searching returns some results such as
> https://devcenter.heroku.com/articles/create-a-java-web-application-using-embedded-tomcat
> but I haven't seen any official docs.
> 
> Are there any?
http://tomcat.apache.org/tomcat-9.0-doc/api/org/apache/catalina/startup/Tomcat.html

is the closest thing we have but I suspect parts of it are out of date.
The unit tests are a good source of samples of how to use it.

Care to contribute a how-to page for the docs?

Mark

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



Official documentation for running an embedded Tomcat server

2019-11-23 Thread Behrang Saeedzadeh
Hi all,

Are there any official docs for how to run Tomcat as an embedded server?
Searching returns some results such as
https://devcenter.heroku.com/articles/create-a-java-web-application-using-embedded-tomcat
but I haven't seen any official docs.

Are there any?

Thanks in advance,
Behrang


it takes very long for Tomcat Server to start etc

2019-09-25 Thread Karen Goh
Hi experts,

Recently, the Tomcat server - version 9.0.24 for Windows 10 is acting very 
strangely.  It takes very very long for it to start.

Furthermore, I have problem in using it for debug in Eclipse.

Usually, I will start the server before right click on the jsp page that I want 
to debug.

The VM argument as follows:
-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=y

The JVM will start but when the web page appear, it will say that the port -the 
configuration port along with the other ports - Tomcat admin port and ACP port 
are in used.

I tried to kill it but the problem will appear again and again.

Using stackoverflow as reference, I have put in this line in the run 
configuration
Djava.security.egd=file:/dev/urandom
but no help.

I have deleted the Tomcat and re-installed new instances but no help.

Please advise what can I do to let Tomcat run again and be able to do debug 
again normally.

Thanks for your help!

Karen

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



Re: Use relative path in Java code hosted in tomcat server.

2019-09-20 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Kaushal,

On 9/19/19 13:06, Kaushal Shriyan wrote:
> I am adding the below absolute path in java code and compiled in a
> war file and uploaded in tomcat 9.0.24 servlet/jsp container.
> 
> file=createPDF("/opt/tomcat9/webapps/statementspdf/"+accountId+stateme
ntId+".pdf",
>>
> 
statementsEntityATOS);
> 
> 
> Is there a way to use relative path instead of absolute path to
> store all pdf files in /opt/tomcat9/webapps/statementspdf/
> directory. Any examples to help me understand it better. For 
> example
> file=createPDF("../webapps/statementspdf/"+accountId+statementId+".pdf
",
>
> 
statementsEntityATOS);
> 
> Thanks in advance and i look forward to hearing from you

Sure, there is a way. What are you doing with that file reference? It
impacts what the recommended answer will be.

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

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl2FPfoACgkQHPApP6U8
pFijRg/+NbjGzwRtbDb1rDIZdxCeqmwMvjnCVfLpY1yoszWxmAH4qFghzFy39JcV
DEKLgMLvpReWBXDr4R5+cth5hRiPnIouFZkuRJyQiOVwHZLB98dXwgBBv0HXiPKF
Uw7IYcv1oHIN/wBdYQyfbqoRxcCATjRAz14/NXMzLKYJk1FT8O1YNvk5MljRPVI7
CdydjSaWiIX/LVuPNyxo1tmfKrhLdfW+nxyi/WUKyAUZ2RPBQZwpFmXNOOWmB6Br
e3U9SLlgq01yUkph8bW5PlJxPTm+ISShBT8i4SwwzsB4I8GywDxURZVUuVEPvG+G
N7dU+ivAK9CCDiITT+gx33YnWvl3WmnICoxmjIiM0SEEZWRrWof9lXYucIDpjZSd
lHzmjBzaRsQBTDbfbupBDdS3eImheC6sO44H9qd44yvuihjKR4iaVHVNnYRBzoWh
DS7VZbRKiMoOB0Fbsk1ygrseHFwjvFQHiIkyFrBEJsdaFq/GF0w9AGSyiUFGuWJT
LzQ8MKSB91/lhIuwKLcxH/7TeXJT0EgkwrVt8WmzR7RCQ8QTRTBuCGzp6DvE8D7/
o54gHyYk2kvTyNRzhjnZL2jhU2kkI1dNccuTHO2y2sH6P2tgf5Qh88CdmKVc8E08
o3Kd8W+JLpIS5Luu2w7gWT9O5J5KA2UtAn4X9Wjw60bSNV5zd3M=
=CuUe
-END PGP SIGNATURE-

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



Use relative path in Java code hosted in tomcat server.

2019-09-19 Thread Kaushal Shriyan
Hi,

I am adding the below absolute path in java code and compiled in a war file
and uploaded in tomcat 9.0.24 servlet/jsp container.

file=createPDF("/opt/tomcat9/webapps/statementspdf/"+accountId+statementId+".pdf",
> statementsEntityATOS);


 Is there a way to use relative path instead of absolute path to store all
pdf files in /opt/tomcat9/webapps/statementspdf/ directory. Any examples to
help me understand it better.
For
example file=createPDF("../webapps/statementspdf/"+accountId+statementId+".pdf",
statementsEntityATOS);

Thanks in advance and i look forward to hearing from you

Best Regards,

Kaushal


Re: Embedded Tomcat server starts but unable to connect via browser on mobile phone.

2019-09-12 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Linus,

On 9/12/19 09:33, LINUS FERNANDES wrote:
> I have set up an embedded Tomcat server program on Arch Linux on
> Termux using OpenJDK version 12.

What version of Tomcat?

> However, I am unable to connect to the server using the browser.
> The same WAR file with a web.xml works fine on Jetty.
> 
> Could you point me in the right direction?

You are probably missing a call to Tomcat.getConnector() to create a
default connector.

https://stackoverflow.com/questions/48998387/code-works-with-embedded-ap
ache-tomcat-8-but-not-with-9-whats-changed/49011424#49011424

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

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl16hfgACgkQHPApP6U8
pFjUshAAhft5Xl8JHEn1mR//jMUIczh6IwLzytyXFV4XahSFXxsKDSP2YdIJT0Pi
OeWckF+toejXvlpZ8D2tNjqJeyMJwAijVn9EqVacz/uxXmXCpXUAAfBqqwwwVCwg
uzhWwf1E7CFtXL+jG9YtEcoRWKxXbL2Jsr3zNW1jPlMH/3vdi3jgUtidshn4iovG
q99JUNrMIfHVDafd9n6KDR3jzVBMUBrMHy2nO3G9bw2wVeaFHXv2rgXT5hzTe8oD
w5O3DztKnEIY6LhKILmkrDRBFs6zT1oUX5XDdQmtpzoFfzDzvP6I0EhoUr8aLhOi
f8W35Y1R0gAd0XG1KhwNlNXXwVtKztYGVAtwkhvzwTt5XCM2nDjRt4wpakw5XkoX
VBJBrhn0X5D/iICrU0TbnJqHwfmoTpwji0ISTfVSCzmy2V36sfVE0ud/DhlxIEhO
CWBTpsYlBrRs2/kpeskqzsDQ/XxdVU6vZ34YfbYmJHdK3UBkCeo8wdK4CgrN4pTb
7pyY0u9tNZPMnpkyaPtauB2GSlMGdEGRHtIOXZpJU0mUmvQ5OAXGprAFnx6Vif2I
TL+GWFv/yLn8AVB/Jp2wRDeplCmz6Qt2aoaH+KpfDC7vvNC3F+OtOdLVsH9ipPEV
lXH1C2xtFaUuNqi/Q+a0Qj3HGgwTSYc0TjB6oRXDiuAutSQL2DI=
=MBh6
-END PGP SIGNATURE-

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



Embedded Tomcat server starts but unable to connect via browser on mobile phone.

2019-09-12 Thread LINUS FERNANDES
I have set up an embedded Tomcat server program on Arch Linux on Termux
using OpenJDK version 12.

However, I am unable to connect to the server using the browser. The same
WAR file with a web.xml works fine on Jetty.

Could you point me in the right direction?

The Java class is as follows:

package launch;

import java.text.MessageFormat;
import java.util.logging.Logger;
import org.apache.catalina.Context;
import org.apache.catalina.LifecycleException;
import org.apache.catalina.WebResourceRoot;
import org.apache.catalina.startup.Tomcat;
import org.apache.catalina.webresources.DirResourceSet;
import org.apache.catalina.webresources.StandardRoot;

@SuppressWarnings("PMD.ShortClassName")
public final class Main {
  private static final Logger LOGGER =
Logger.getLogger(Main.class.getName());
  private static final String WORKING_DIR =
  System.getProperty("java.io.tmpdir") + "/webapps";

  private Main() {
throw new IllegalStateException("Private constructor");
  }

  public static void main(String[] args) {
try {

  Tomcat tomcat = new Tomcat();

  // The port that we should run on can be set into an environment
variable
  // Look for that variable and default to 8080 if it isn't there.
  String webPort = System.getenv("PORT");
  if (webPort == null || webPort.isEmpty()) {
webPort = "8080";
  }
  System.out.println(webPort);
  tomcat.setSilent(false);
  tomcat.setPort(Integer.valueOf(webPort));
  tomcat.setBaseDir(WORKING_DIR);
  tomcat.getHost().setAppBase(WORKING_DIR);
  tomcat.getHost().setAutoDeploy(true);
  tomcat.getHost().setDeployOnStartup(true);


  System.out.println(System.getProperty("catalina.home"));
  System.out.println(System.getProperty("catalina.base"));

  String userDir = System.getProperty("user.dir");
  String webappDirLocation = userDir + "/dist/Webapps-2.0.0.war";


tomcat.getHost().getAppBaseFile().mkdir();
  // Ensure that the webapps directory exists

  Context appContext =
  tomcat.addWebapp(tomcat.getHost(), "/Webapp", webappDirLocation);
  appContext.setParentClassLoader(
  Thread.currentThread().getContextClassLoader());
  WebResourceRoot resources = new StandardRoot(appContext);
  resources.addPreResources(
  new DirResourceSet(resources, "/WEB-INF/classes", "", "/"));
  appContext.setResources(resources);
  tomcat.start();
  LOGGER.info(() -> {
return MessageFormat.format("Deployed {0} as {1}",
appContext.getBaseName(),
appContext.getBaseName());
  });
  tomcat.getServer().await();
} catch (LifecycleException lce) {
  System.err.println(lce);
}
  }
}

The web.xml is as follows. It's probably irrelevant.


http://java.sun.com/xml/ns/javaee "
 xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance "
 xsi:schemaLocation=" http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd "
 version="3.0">
  
FirstServlet
servlets.FirstServlet
  
  
DbServlet
servlets.DbServlet
  
  
GetPreferences
servlets.GetPreferences
  
  
Checkout
servlets.Checkout
  
  
AdderServlet
servlets.AdderServlet
  
  
PersonalServlet
servlets.PersonalServlet
  
  
Selection
servlets.Selection
  
  
ShowSum
servlets.ShowSum
  
  
Weight
servlets.Weight
  
  
FirstServlet
/FirstServlet
  
  
Checkout
/Checkout
  
  
DbServlet
/DbServlet
  
  
PersonalServlet
/PersonalServlet
  
  
AdderServlet
/AdderServlet
  
  
GetPreferences
/GetPreferences
  
  
Selection
/Selection
  
  
ShowSum
/ShowSum
  
  
Weight
/Weight
  
  
index.html
  


The project is hosted at
https://github.com/Fernal73/LearnJava/tree/master/Webapps

Regards,
Linus Fernandes.


RE: Tomcat Server Using 100% CPU

2019-08-09 Thread Eric Robinson
   0.0.0.0:*   LISTEN  
30166/java
tcp0  0 0.0.0.0:42922   0.0.0.0:*   LISTEN  
8597/java
tcp0  0 0.0.0.0:34340.0.0.0:*   LISTEN  
17313/java
tcp0  0 0.0.0.0:65060.0.0.0:*   LISTEN  
4447/java
tcp0  0 0.0.0.0:36778   0.0.0.0:*   LISTEN  
300/java
tcp0  0 0.0.0.0:64750.0.0.0:*   LISTEN  
7261/java
tcp0  0 0.0.0.0:35787   0.0.0.0:*   LISTEN  
19622/java
tcp0  0 0.0.0.0:46795   0.0.0.0:*   LISTEN  
3673/java
tcp0  0 0.0.0.0:32110.0.0.0:*   LISTEN  
30166/java
tcp0  0 0.0.0.0:34360.0.0.0:*   LISTEN  
31863/java
tcp0  0 0.0.0.0:31160.0.0.0:*   LISTEN  
29948/java
tcp0  0 0.0.0.0:65090.0.0.0:*   LISTEN  
9462/java
tcp0  0 0.0.0.0:64770.0.0.0:*   LISTEN  
7678/java
tcp0  0 0.0.0.0:39885   0.0.0.0:*   LISTEN  
4447/java
tcp0  0 0.0.0.0:33581   0.0.0.0:*   LISTEN  
300/java
tcp0  0 0.0.0.0:64780.0.0.0:*   LISTEN  
8027/java

-Original Message-
From: André Warnier (tomcat) 
Sent: Thursday, August 8, 2019 3:53 PM
To: users@tomcat.apache.org
Subject: Re: Tomcat Server Using 100% CPU

On 08.08.2019 20:08, Eric Robinson wrote:
> Utkarsh and John, thank you for your feedback.
>
> Since everything was originally on Windows, and we built a new Linux server 
> with fresh tomcat installs, and the only thing we moved over from the old 
> Windows servers was the tomcat application folder itself, and the 100% CPU 
> problem persisted, I can't imagine what else could be causing it except the 
> tomcats, but I'm open to ideas.
>
> When it happens, all the tomcats start using high CPU at the same time. See 
> the following top output.
>
> top - 11:06:44 up 1 day,  6:59,  7 users,  load average: 36.85, 32.67, 34.89
> Tasks: 245 total,   4 running, 241 sleeping,   0 stopped,   0 zombie
> %Cpu(s): 80.7 us, 13.5 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  5.7
> si,  0.0 st KiB Mem : 48132572 total, 11677420 free,  5572688 used, 30882464 
> buff/cache
> KiB Swap: 15626236 total, 15584324 free,41912 used. 41859232 avail Mem
>
>PID USER  PR  NIVIRTRESSHR S  %CPU %MEM TIME+ COMMAND
> 19379 site211   20   0 3529072 447444  24632 S 120.4  0.9   3:37.19 java
> 20092 site555   20   0 2530376 375500  24496 S  72.4  0.8   2:01.44 java
> 21077 site450   20   0 2530292 298260  24292 S  69.6  0.6   1:10.92 java
> 20378 site436   20   0 3262200 347160  24096 S  68.3  0.7   2:47.26 java
> 19957 site522   20   0 2596856 373532  24364 S  52.0  0.8   2:37.13 java
> 19537 site396   20   0 2862724 386860  23820 S  51.1  0.8   2:34.25 java
> 19228 site116   20   0 3595652 490032  24640 S  50.5  1.0   5:03.28 java
> 20941 site456   20   0 2596996 338740  24488 S  49.2  0.7   1:32.89 java
> 20789 site354   20   0 2596920 327612  24480 S  42.9  0.7   1:30.47 java
> 20657 site327   20   0 3123004 346308  24540 S  41.4  0.7   1:50.97 java
> 20524 site203   20   0 2458376 340400  25416 S  39.8  0.7   1:48.01 java
> 19675 site487   20   0 2530296 390948  24408 S  35.7  0.8   2:37.95 java
> 20233 site535   20   0 2530292 324112  24360 S  32.9  0.7   1:54.31 java
> 19809 site514   20   0 2530216 400308  24340 S  25.7  0.8   2:35.97 java
> 44 root  20   0   0  0  0 R  19.1  0.0 159:46.15 
> ksoftirqd/7
>   3926 root  20   0  208512  22668   4128 S  16.9  0.0 242:45.07 iotop
>   2036 root  20   0   0  0  0 R  13.2  0.0   1:38.31 
> kworker/7:0
>
> I'll check the localhost_access logs and see if something suspicious stands 
> out.
>

Access logs is the first thing to look at of course (just in case you are 
subject to some DoS attack), but other things of interest :
1) what is "the webapp" in question ? Any reason to suspect it may have been 
been hijacked, to do something it is not supposed to do ? does the webapp allow 
for clients to upload "things" to the server (files, documents, images,..) ?
2) if you look at the tomcat logs, do you recognise all the webapps which get 
deployed when tomcat starts ? Or is there an alien there ?
3) if you run "top" again, then enter a "c" in the console, it will show more 
details about the "java" command it is running.
Similarly, doing a "ps -ef" command and comparing the result (by PID) with the 
top output, may give more details.
That would show (us) at least the startup paramet

RE: Tomcat Server Using 100% CPU

2019-08-09 Thread Eric Robinson
Paul --

I've only used jconsole and thread dumps before. Never used jstack. I'll look 
into it.


On Thu, 08 Aug 2019, 20:22 Coty Sutherland,  wrote:

> I'd suggest writing a small script to loop about 10 times and capture
> top and thread dumps with jstack at the same time, then wait a few
> seconds then repeat. After that you can grab the pid/tid from the top
> output and compare that with your thread dump to see exactly what the
> thread is doing for the iteration/duration you specify.
>
> Other questions that I haven't seen asked, how long does the CPU usage
> persist? Is it only at startup or does it randomly start after some uptime?
> Have your webapps or dependencies changed around the time the issue
> started? Do the working and nonworking servers run the same webapps
> with the same workload?
>
> On Thu, Aug 8, 2019 at 2:09 PM Eric Robinson 
> wrote:
>
> > Utkarsh and John, thank you for your feedback.
> >
> > Since everything was originally on Windows, and we built a new Linux
> > server with fresh tomcat installs, and the only thing we moved over
> > from the old Windows servers was the tomcat application folder
> > itself, and the 100% CPU problem persisted, I can't imagine what
> > else could be causing it except the tomcats, but I'm open to ideas.
> >
> > When it happens, all the tomcats start using high CPU at the same time.
> > See the following top output.
> >
> > top - 11:06:44 up 1 day,  6:59,  7 users,  load average: 36.85,
> > 32.67,
> > 34.89
> > Tasks: 245 total,   4 running, 241 sleeping,   0 stopped,   0 zombie
> > %Cpu(s): 80.7 us, 13.5 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  5.7
> > si,
> > 0.0 st
> > KiB Mem : 48132572 total, 11677420 free,  5572688 used, 30882464
> buff/cache
> > KiB Swap: 15626236 total, 15584324 free,41912 used. 41859232 avail
> Mem
> >
> >   PID USER  PR  NIVIRTRESSHR S  %CPU %MEM TIME+
> COMMAND
> > 19379 site211   20   0 3529072 447444  24632 S 120.4  0.9   3:37.19 java
> > 20092 site555   20   0 2530376 375500  24496 S  72.4  0.8   2:01.44 java
> > 21077 site450   20   0 2530292 298260  24292 S  69.6  0.6   1:10.92 java
> > 20378 site436   20   0 3262200 347160  24096 S  68.3  0.7   2:47.26 java
> > 19957 site522   20   0 2596856 373532  24364 S  52.0  0.8   2:37.13 java
> > 19537 site396   20   0 2862724 386860  23820 S  51.1  0.8   2:34.25 java
> > 19228 site116   20   0 3595652 490032  24640 S  50.5  1.0   5:03.28 java
> > 20941 site456   20   0 2596996 338740  24488 S  49.2  0.7   1:32.89 java
> > 20789 site354   20   0 2596920 327612  24480 S  42.9  0.7   1:30.47 java
> > 20657 site327   20   0 3123004 346308  24540 S  41.4  0.7   1:50.97 java
> > 20524 site203   20   0 2458376 340400  25416 S  39.8  0.7   1:48.01 java
> > 19675 site487   20   0 2530296 390948  24408 S  35.7  0.8   2:37.95 java
> > 20233 site535   20   0 2530292 324112  24360 S  32.9  0.7   1:54.31 java
> > 19809 site514   20   0 2530216 400308  24340 S  25.7  0.8   2:35.97 java
> >44 root  20   0   0  0  0 R  19.1  0.0 159:46.15
> > ksoftirqd/7
> >  3926 root  20   0  208512  22668   4128 S  16.9  0.0 242:45.07 iotop
> >  2036 root  20   0       0  0  0 R  13.2  0.0   1:38.31
> > kworker/7:0
> >
> > I'll check the localhost_access logs and see if something suspicious
> > stands out.
> >
> > --Eric
> >
> >
> > -Original Message-
> > From: Utkarsh Dave 
> > Sent: Thursday, August 8, 2019 12:33 PM
> > To: Tomcat Users List 
> > Subject: Re: Tomcat Server Using 100% CPU
> >
> > Did you reviewed the localhost_access log file. Which
> > web-application is using tomcat the most ?
> >
> > On Thu, Aug 8, 2019 at 9:53 AM Eric Robinson
> > 
> > wrote:
> >
> > > We have a farm of VMs, each running multiple instances of tomcat
> > > (up to 80 instances per server). Everything has been running fine
> > > for years, but recently one server has started nailing the CPU to
> > > 100%
> > utilization.
> > >
> > > We have tried:
> > >
> > >
> > >   *   Different versions of tomcat and JDK
> > >   *   Doubling the resources to 16 cores and 56 GB RAM
> > >   *   Moving the VM to different physical server
> > >   *   Rebuilding the tomcat instances on a brand new VM using Windows
> > > Server 2019
> > >   *   Rebuilding the tomcat instances on a brand new VM using Red Hat
> > > Enterprise Linux 7.5
> > >
> > > Nothing has worked. N

RE: Tomcat Server Using 100% CPU

2019-08-09 Thread Eric Robinson
Coty --

There is a normal period of high CPU right after startup, but that's expected. 
However, it usually peaks well after startup (minutes or hours) and then it 
stays that way, sometimes all night. When it happens, all the tomcats (about 20 
of them) running show high CPU, like 20-50% each.

I can write a script to loop and output top and thread dumps. Should I do it 
for all running instances or just for a selected target instance?

--Eric

-Original Message-
From: Coty Sutherland 
Sent: Thursday, August 8, 2019 1:22 PM
To: Tomcat Users List 
Subject: Re: Tomcat Server Using 100% CPU

I'd suggest writing a small script to loop about 10 times and capture top and 
thread dumps with jstack at the same time, then wait a few seconds then repeat. 
After that you can grab the pid/tid from the top output and compare that with 
your thread dump to see exactly what the thread is doing for the 
iteration/duration you specify.

Other questions that I haven't seen asked, how long does the CPU usage persist? 
Is it only at startup or does it randomly start after some uptime?
Have your webapps or dependencies changed around the time the issue started? Do 
the working and nonworking servers run the same webapps with the same workload?

On Thu, Aug 8, 2019 at 2:09 PM Eric Robinson 
wrote:

> Utkarsh and John, thank you for your feedback.
>
> Since everything was originally on Windows, and we built a new Linux
> server with fresh tomcat installs, and the only thing we moved over
> from the old Windows servers was the tomcat application folder itself,
> and the 100% CPU problem persisted, I can't imagine what else could be
> causing it except the tomcats, but I'm open to ideas.
>
> When it happens, all the tomcats start using high CPU at the same time.
> See the following top output.
>
> top - 11:06:44 up 1 day,  6:59,  7 users,  load average: 36.85, 32.67,
> 34.89
> Tasks: 245 total,   4 running, 241 sleeping,   0 stopped,   0 zombie
> %Cpu(s): 80.7 us, 13.5 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  5.7
> si,
> 0.0 st
> KiB Mem : 48132572 total, 11677420 free,  5572688 used, 30882464 buff/cache
> KiB Swap: 15626236 total, 15584324 free,41912 used. 41859232 avail Mem
>
>   PID USER  PR  NIVIRTRESSHR S  %CPU %MEM TIME+ COMMAND
> 19379 site211   20   0 3529072 447444  24632 S 120.4  0.9   3:37.19 java
> 20092 site555   20   0 2530376 375500  24496 S  72.4  0.8   2:01.44 java
> 21077 site450   20   0 2530292 298260  24292 S  69.6  0.6   1:10.92 java
> 20378 site436   20   0 3262200 347160  24096 S  68.3  0.7   2:47.26 java
> 19957 site522   20   0 2596856 373532  24364 S  52.0  0.8   2:37.13 java
> 19537 site396   20   0 2862724 386860  23820 S  51.1  0.8   2:34.25 java
> 19228 site116   20   0 3595652 490032  24640 S  50.5  1.0   5:03.28 java
> 20941 site456   20   0 2596996 338740  24488 S  49.2  0.7   1:32.89 java
> 20789 site354   20   0 2596920 327612  24480 S  42.9  0.7   1:30.47 java
> 20657 site327   20   0 3123004 346308  24540 S  41.4  0.7   1:50.97 java
> 20524 site203   20   0 2458376 340400  25416 S  39.8  0.7   1:48.01 java
> 19675 site487   20   0 2530296 390948  24408 S  35.7  0.8   2:37.95 java
> 20233 site535   20   0 2530292 324112  24360 S  32.9  0.7   1:54.31 java
> 19809 site514   20   0 2530216 400308  24340 S  25.7  0.8   2:35.97 java
>44 root  20   0   0  0  0 R  19.1  0.0 159:46.15
> ksoftirqd/7
>  3926 root  20   0  208512  22668   4128 S  16.9  0.0 242:45.07 iotop
>  2036 root  20   0   0  0  0 R  13.2  0.0   1:38.31
> kworker/7:0
>
> I'll check the localhost_access logs and see if something suspicious
> stands out.
>
> --Eric
>
>
> -Original Message-
> From: Utkarsh Dave 
> Sent: Thursday, August 8, 2019 12:33 PM
> To: Tomcat Users List 
> Subject: Re: Tomcat Server Using 100% CPU
>
> Did you reviewed the localhost_access log file. Which web-application
> is using tomcat the most ?
>
> On Thu, Aug 8, 2019 at 9:53 AM Eric Robinson 
> wrote:
>
> > We have a farm of VMs, each running multiple instances of tomcat (up
> > to 80 instances per server). Everything has been running fine for
> > years, but recently one server has started nailing the CPU to 100%
> utilization.
> >
> > We have tried:
> >
> >
> >   *   Different versions of tomcat and JDK
> >   *   Doubling the resources to 16 cores and 56 GB RAM
> >   *   Moving the VM to different physical server
> >   *   Rebuilding the tomcat instances on a brand new VM using Windows
> > Server 2019
> >   *   Rebuilding the tomcat instances on a brand new VM using Red Hat
> > Enterprise Linux 7.5
> >
> > Nothing has worked. No matter where we run the tomcats, they driv

RE: Tomcat Server Using 100% CPU

2019-08-08 Thread Eric Robinson
André, Paul, and Coty, you've all provided some great next steps. I'll 
investigate further and be back in touch!

--Eric

-Original Message-
From: André Warnier (tomcat) 
Sent: Thursday, August 8, 2019 3:53 PM
To: users@tomcat.apache.org
Subject: Re: Tomcat Server Using 100% CPU

On 08.08.2019 20:08, Eric Robinson wrote:
> Utkarsh and John, thank you for your feedback.
>
> Since everything was originally on Windows, and we built a new Linux server 
> with fresh tomcat installs, and the only thing we moved over from the old 
> Windows servers was the tomcat application folder itself, and the 100% CPU 
> problem persisted, I can't imagine what else could be causing it except the 
> tomcats, but I'm open to ideas.
>
> When it happens, all the tomcats start using high CPU at the same time. See 
> the following top output.
>
> top - 11:06:44 up 1 day,  6:59,  7 users,  load average: 36.85, 32.67, 34.89
> Tasks: 245 total,   4 running, 241 sleeping,   0 stopped,   0 zombie
> %Cpu(s): 80.7 us, 13.5 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  5.7
> si,  0.0 st KiB Mem : 48132572 total, 11677420 free,  5572688 used, 30882464 
> buff/cache
> KiB Swap: 15626236 total, 15584324 free,41912 used. 41859232 avail Mem
>
>PID USER  PR  NIVIRTRESSHR S  %CPU %MEM TIME+ COMMAND
> 19379 site211   20   0 3529072 447444  24632 S 120.4  0.9   3:37.19 java
> 20092 site555   20   0 2530376 375500  24496 S  72.4  0.8   2:01.44 java
> 21077 site450   20   0 2530292 298260  24292 S  69.6  0.6   1:10.92 java
> 20378 site436   20   0 3262200 347160  24096 S  68.3  0.7   2:47.26 java
> 19957 site522   20   0 2596856 373532  24364 S  52.0  0.8   2:37.13 java
> 19537 site396   20   0 2862724 386860  23820 S  51.1  0.8   2:34.25 java
> 19228 site116   20   0 3595652 490032  24640 S  50.5  1.0   5:03.28 java
> 20941 site456   20   0 2596996 338740  24488 S  49.2  0.7   1:32.89 java
> 20789 site354   20   0 2596920 327612  24480 S  42.9  0.7   1:30.47 java
> 20657 site327   20   0 3123004 346308  24540 S  41.4  0.7   1:50.97 java
> 20524 site203   20   0 2458376 340400  25416 S  39.8  0.7   1:48.01 java
> 19675 site487   20   0 2530296 390948  24408 S  35.7  0.8   2:37.95 java
> 20233 site535   20   0 2530292 324112  24360 S  32.9  0.7   1:54.31 java
> 19809 site514   20   0 2530216 400308  24340 S  25.7  0.8   2:35.97 java
> 44 root  20   0   0  0  0 R  19.1  0.0 159:46.15 
> ksoftirqd/7
>   3926 root  20   0  208512  22668   4128 S  16.9  0.0 242:45.07 iotop
>   2036 root  20   0   0  0  0 R  13.2  0.0   1:38.31 
> kworker/7:0
>
> I'll check the localhost_access logs and see if something suspicious stands 
> out.
>

Access logs is the first thing to look at of course (just in case you are 
subject to some DoS attack), but other things of interest :
1) what is "the webapp" in question ? Any reason to suspect it may have been 
been hijacked, to do something it is not supposed to do ? does the webapp allow 
for clients to upload "things" to the server (files, documents, images,..) ?
2) if you look at the tomcat logs, do you recognise all the webapps which get 
deployed when tomcat starts ? Or is there an alien there ?
3) if you run "top" again, then enter a "c" in the console, it will show more 
details about the "java" command it is running.
Similarly, doing a "ps -ef" command and comparing the result (by PID) with the 
top output, may give more details.
That would show (us) at least the startup parameters of your tomcat(s).
4) speaking as a faithful Tomcat Committer, we always like to repeat that in 
99% of the cases it turns out that the problem is with the webapp, not with 
Tomcat. The fact that in your case, you have changed about everything except 
the webapp, and the problem persists, would only tend to increase that 
suspicion..
So, can the webapp do any logging that would show what it's doing, while it is 
happily slurping all your CPU time ?
6) does the tomcat error log show anything of interest ?
7) under Linux as root, enter : netstat --tcp -pan | grep LISTEN (Shows all TCP 
ports your server is listening to, and which PID/processes control these ports).
Anything unexpected there ? worse : anything unexpected which would match the 
PID of one of your tomcats ?

André


> --Eric
>
>
> -Original Message-
> From: Utkarsh Dave 
> Sent: Thursday, August 8, 2019 12:33 PM
> To: Tomcat Users List 
> Subject: Re: Tomcat Server Using 100% CPU
>
> Did you reviewed the localhost_access log file. Which web-application is 
> using tomcat the most ?
>
> On Thu, Aug 8, 2019 at 9:53 AM Eric Robinson 
> wrote:
>
>> We have a farm of VMs, each running multiple instances of tomcat (up
>> to 80 instan

Re: Tomcat Server Using 100% CPU

2019-08-08 Thread tomcat

On 08.08.2019 20:08, Eric Robinson wrote:

Utkarsh and John, thank you for your feedback.

Since everything was originally on Windows, and we built a new Linux server 
with fresh tomcat installs, and the only thing we moved over from the old 
Windows servers was the tomcat application folder itself, and the 100% CPU 
problem persisted, I can't imagine what else could be causing it except the 
tomcats, but I'm open to ideas.

When it happens, all the tomcats start using high CPU at the same time. See the 
following top output.

top - 11:06:44 up 1 day,  6:59,  7 users,  load average: 36.85, 32.67, 34.89
Tasks: 245 total,   4 running, 241 sleeping,   0 stopped,   0 zombie
%Cpu(s): 80.7 us, 13.5 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  5.7 si,  0.0 st
KiB Mem : 48132572 total, 11677420 free,  5572688 used, 30882464 buff/cache
KiB Swap: 15626236 total, 15584324 free,41912 used. 41859232 avail Mem

   PID USER  PR  NIVIRTRESSHR S  %CPU %MEM TIME+ COMMAND
19379 site211   20   0 3529072 447444  24632 S 120.4  0.9   3:37.19 java
20092 site555   20   0 2530376 375500  24496 S  72.4  0.8   2:01.44 java
21077 site450   20   0 2530292 298260  24292 S  69.6  0.6   1:10.92 java
20378 site436   20   0 3262200 347160  24096 S  68.3  0.7   2:47.26 java
19957 site522   20   0 2596856 373532  24364 S  52.0  0.8   2:37.13 java
19537 site396   20   0 2862724 386860  23820 S  51.1  0.8   2:34.25 java
19228 site116   20   0 3595652 490032  24640 S  50.5  1.0   5:03.28 java
20941 site456   20   0 2596996 338740  24488 S  49.2  0.7   1:32.89 java
20789 site354   20   0 2596920 327612  24480 S  42.9  0.7   1:30.47 java
20657 site327   20   0 3123004 346308  24540 S  41.4  0.7   1:50.97 java
20524 site203   20   0 2458376 340400  25416 S  39.8  0.7   1:48.01 java
19675 site487   20   0 2530296 390948  24408 S  35.7  0.8   2:37.95 java
20233 site535   20   0 2530292 324112  24360 S  32.9  0.7   1:54.31 java
19809 site514   20   0 2530216 400308  24340 S  25.7  0.8   2:35.97 java
44 root  20   0   0  0  0 R  19.1  0.0 159:46.15 ksoftirqd/7
  3926 root  20   0  208512  22668   4128 S  16.9  0.0 242:45.07 iotop
  2036 root  20   0   0  0  0 R  13.2  0.0   1:38.31 kworker/7:0

I'll check the localhost_access logs and see if something suspicious stands out.



Access logs is the first thing to look at of course (just in case you are 
subject to some
DoS attack), but other things of interest :
1) what is "the webapp" in question ? Any reason to suspect it may have been been 
hijacked, to do something it is not supposed to do ? does the webapp allow for clients to 
upload "things" to the server (files, documents, images,..) ?
2) if you look at the tomcat logs, do you recognise all the webapps which get deployed 
when tomcat starts ? Or is there an alien there ?
3) if you run "top" again, then enter a "c" in the console, it will show more details 
about the "java" command it is running.
Similarly, doing a "ps -ef" command and comparing the result (by PID) with the top output, 
may give more details.

That would show (us) at least the startup parameters of your tomcat(s).
4) speaking as a faithful Tomcat Committer, we always like to repeat that in 99% of the 
cases it turns out that the problem is with the webapp, not with Tomcat. The fact that in 
your case, you have changed about everything except the webapp, and the problem persists, 
would only tend to increase that suspicion..
So, can the webapp do any logging that would show what it's doing, while it is happily 
slurping all your CPU time ?

6) does the tomcat error log show anything of interest ?
7) under Linux as root, enter : netstat --tcp -pan | grep LISTEN
(Shows all TCP ports your server is listening to, and which PID/processes control these 
ports).
Anything unexpected there ? worse : anything unexpected which would match the PID of one 
of your tomcats ?


André



--Eric


-Original Message-
From: Utkarsh Dave 
Sent: Thursday, August 8, 2019 12:33 PM
To: Tomcat Users List 
Subject: Re: Tomcat Server Using 100% CPU

Did you reviewed the localhost_access log file. Which web-application is using 
tomcat the most ?

On Thu, Aug 8, 2019 at 9:53 AM Eric Robinson 
wrote:


We have a farm of VMs, each running multiple instances of tomcat (up
to 80 instances per server). Everything has been running fine for
years, but recently one server has started nailing the CPU to 100% utilization.

We have tried:


   *   Different versions of tomcat and JDK
   *   Doubling the resources to 16 cores and 56 GB RAM
   *   Moving the VM to different physical server
   *   Rebuilding the tomcat instances on a brand new VM using Windows
Server 2019
   *   Rebuilding the tomcat instances on a brand new VM using Red Hat
Enterprise Linux 7.5

Nothing has worked. No matter where we run the tomcats, they drive CPU
up to 100%. Meanwhile the other six serve

Re: Tomcat Server Using 100% CPU

2019-08-08 Thread Paul Carter-Brown
Please post a jstack of the pid 10 seconds apart. That will reveal all.

On Thu, 08 Aug 2019, 20:22 Coty Sutherland,  wrote:

> I'd suggest writing a small script to loop about 10 times and capture top
> and thread dumps with jstack at the same time, then wait a few seconds then
> repeat. After that you can grab the pid/tid from the top output and compare
> that with your thread dump to see exactly what the thread is doing for the
> iteration/duration you specify.
>
> Other questions that I haven't seen asked, how long does the CPU usage
> persist? Is it only at startup or does it randomly start after some uptime?
> Have your webapps or dependencies changed around the time the issue
> started? Do the working and nonworking servers run the same webapps with
> the same workload?
>
> On Thu, Aug 8, 2019 at 2:09 PM Eric Robinson 
> wrote:
>
> > Utkarsh and John, thank you for your feedback.
> >
> > Since everything was originally on Windows, and we built a new Linux
> > server with fresh tomcat installs, and the only thing we moved over from
> > the old Windows servers was the tomcat application folder itself, and the
> > 100% CPU problem persisted, I can't imagine what else could be causing it
> > except the tomcats, but I'm open to ideas.
> >
> > When it happens, all the tomcats start using high CPU at the same time.
> > See the following top output.
> >
> > top - 11:06:44 up 1 day,  6:59,  7 users,  load average: 36.85, 32.67,
> > 34.89
> > Tasks: 245 total,   4 running, 241 sleeping,   0 stopped,   0 zombie
> > %Cpu(s): 80.7 us, 13.5 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  5.7 si,
> > 0.0 st
> > KiB Mem : 48132572 total, 11677420 free,  5572688 used, 30882464
> buff/cache
> > KiB Swap: 15626236 total, 15584324 free,41912 used. 41859232 avail
> Mem
> >
> >   PID USER  PR  NIVIRTRESSHR S  %CPU %MEM TIME+
> COMMAND
> > 19379 site211   20   0 3529072 447444  24632 S 120.4  0.9   3:37.19 java
> > 20092 site555   20   0 2530376 375500  24496 S  72.4  0.8   2:01.44 java
> > 21077 site450   20   0 2530292 298260  24292 S  69.6  0.6   1:10.92 java
> > 20378 site436   20   0 3262200 347160  24096 S  68.3  0.7   2:47.26 java
> > 19957 site522   20   0 2596856 373532  24364 S  52.0  0.8   2:37.13 java
> > 19537 site396   20   0 2862724 386860  23820 S  51.1  0.8   2:34.25 java
> > 19228 site116   20   0 3595652 490032  24640 S  50.5  1.0   5:03.28 java
> > 20941 site456   20   0 2596996 338740  24488 S  49.2  0.7   1:32.89 java
> > 20789 site354   20   0 2596920 327612  24480 S  42.9  0.7   1:30.47 java
> > 20657 site327   20   0 3123004 346308  24540 S  41.4  0.7   1:50.97 java
> > 20524 site203   20   0 2458376 340400  25416 S  39.8  0.7   1:48.01 java
> > 19675 site487   20   0 2530296 390948  24408 S  35.7  0.8   2:37.95 java
> > 20233 site535   20   0 2530292 324112  24360 S  32.9  0.7   1:54.31 java
> > 19809 site514   20   0 2530216 400308  24340 S  25.7  0.8   2:35.97 java
> >44 root  20   0   0  0  0 R  19.1  0.0 159:46.15
> > ksoftirqd/7
> >  3926 root  20   0  208512  22668   4128 S  16.9  0.0 242:45.07 iotop
> >  2036 root  20   0   0  0  0 R  13.2  0.0   1:38.31
> > kworker/7:0
> >
> > I'll check the localhost_access logs and see if something suspicious
> > stands out.
> >
> > --Eric
> >
> >
> > -Original Message-
> > From: Utkarsh Dave 
> > Sent: Thursday, August 8, 2019 12:33 PM
> > To: Tomcat Users List 
> > Subject: Re: Tomcat Server Using 100% CPU
> >
> > Did you reviewed the localhost_access log file. Which web-application is
> > using tomcat the most ?
> >
> > On Thu, Aug 8, 2019 at 9:53 AM Eric Robinson 
> > wrote:
> >
> > > We have a farm of VMs, each running multiple instances of tomcat (up
> > > to 80 instances per server). Everything has been running fine for
> > > years, but recently one server has started nailing the CPU to 100%
> > utilization.
> > >
> > > We have tried:
> > >
> > >
> > >   *   Different versions of tomcat and JDK
> > >   *   Doubling the resources to 16 cores and 56 GB RAM
> > >   *   Moving the VM to different physical server
> > >   *   Rebuilding the tomcat instances on a brand new VM using Windows
> > > Server 2019
> > >   *   Rebuilding the tomcat instances on a brand new VM using Red Hat
> > > Enterprise Linux 7.5
> > >
> > > Nothing has worked. No matter where we run the tomcats, they drive CPU
> > > up to 100%. Mean

Re: Tomcat Server Using 100% CPU

2019-08-08 Thread Coty Sutherland
I'd suggest writing a small script to loop about 10 times and capture top
and thread dumps with jstack at the same time, then wait a few seconds then
repeat. After that you can grab the pid/tid from the top output and compare
that with your thread dump to see exactly what the thread is doing for the
iteration/duration you specify.

Other questions that I haven't seen asked, how long does the CPU usage
persist? Is it only at startup or does it randomly start after some uptime?
Have your webapps or dependencies changed around the time the issue
started? Do the working and nonworking servers run the same webapps with
the same workload?

On Thu, Aug 8, 2019 at 2:09 PM Eric Robinson 
wrote:

> Utkarsh and John, thank you for your feedback.
>
> Since everything was originally on Windows, and we built a new Linux
> server with fresh tomcat installs, and the only thing we moved over from
> the old Windows servers was the tomcat application folder itself, and the
> 100% CPU problem persisted, I can't imagine what else could be causing it
> except the tomcats, but I'm open to ideas.
>
> When it happens, all the tomcats start using high CPU at the same time.
> See the following top output.
>
> top - 11:06:44 up 1 day,  6:59,  7 users,  load average: 36.85, 32.67,
> 34.89
> Tasks: 245 total,   4 running, 241 sleeping,   0 stopped,   0 zombie
> %Cpu(s): 80.7 us, 13.5 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  5.7 si,
> 0.0 st
> KiB Mem : 48132572 total, 11677420 free,  5572688 used, 30882464 buff/cache
> KiB Swap: 15626236 total, 15584324 free,41912 used. 41859232 avail Mem
>
>   PID USER  PR  NIVIRTRESSHR S  %CPU %MEM TIME+ COMMAND
> 19379 site211   20   0 3529072 447444  24632 S 120.4  0.9   3:37.19 java
> 20092 site555   20   0 2530376 375500  24496 S  72.4  0.8   2:01.44 java
> 21077 site450   20   0 2530292 298260  24292 S  69.6  0.6   1:10.92 java
> 20378 site436   20   0 3262200 347160  24096 S  68.3  0.7   2:47.26 java
> 19957 site522   20   0 2596856 373532  24364 S  52.0  0.8   2:37.13 java
> 19537 site396   20   0 2862724 386860  23820 S  51.1  0.8   2:34.25 java
> 19228 site116   20   0 3595652 490032  24640 S  50.5  1.0   5:03.28 java
> 20941 site456   20   0 2596996 338740  24488 S  49.2  0.7   1:32.89 java
> 20789 site354   20   0 2596920 327612  24480 S  42.9  0.7   1:30.47 java
> 20657 site327   20   0 3123004 346308  24540 S  41.4  0.7   1:50.97 java
> 20524 site203   20   0 2458376 340400  25416 S  39.8  0.7   1:48.01 java
> 19675 site487   20   0 2530296 390948  24408 S  35.7  0.8   2:37.95 java
> 20233 site535   20   0 2530292 324112  24360 S  32.9  0.7   1:54.31 java
> 19809 site514   20   0 2530216 400308  24340 S  25.7  0.8   2:35.97 java
>44 root  20   0   0  0  0 R  19.1  0.0 159:46.15
> ksoftirqd/7
>  3926 root  20   0  208512  22668   4128 S  16.9  0.0 242:45.07 iotop
>  2036 root  20   0   0  0  0 R  13.2  0.0   1:38.31
> kworker/7:0
>
> I'll check the localhost_access logs and see if something suspicious
> stands out.
>
> --Eric
>
>
> -Original Message-
> From: Utkarsh Dave 
> Sent: Thursday, August 8, 2019 12:33 PM
> To: Tomcat Users List 
> Subject: Re: Tomcat Server Using 100% CPU
>
> Did you reviewed the localhost_access log file. Which web-application is
> using tomcat the most ?
>
> On Thu, Aug 8, 2019 at 9:53 AM Eric Robinson 
> wrote:
>
> > We have a farm of VMs, each running multiple instances of tomcat (up
> > to 80 instances per server). Everything has been running fine for
> > years, but recently one server has started nailing the CPU to 100%
> utilization.
> >
> > We have tried:
> >
> >
> >   *   Different versions of tomcat and JDK
> >   *   Doubling the resources to 16 cores and 56 GB RAM
> >   *   Moving the VM to different physical server
> >   *   Rebuilding the tomcat instances on a brand new VM using Windows
> > Server 2019
> >   *   Rebuilding the tomcat instances on a brand new VM using Red Hat
> > Enterprise Linux 7.5
> >
> > Nothing has worked. No matter where we run the tomcats, they drive CPU
> > up to 100%. Meanwhile the other six servers are still running fine.
> > They all run the same canned tomcat applications.
> >
> > We would appreciate some guidance on getting to the bottom of this
> problem.
> >
> > --Eric
> >
> >
> > Disclaimer : This email and any files transmitted with it are
> > confidential and intended solely for intended recipients. If you are
> > not the named addressee you should not disseminate, distribute, copy or
> alter this email.
> > Any views or opinions presented in this email are solely those of th

RE: Tomcat Server Using 100% CPU

2019-08-08 Thread Eric Robinson
Utkarsh and John, thank you for your feedback.

Since everything was originally on Windows, and we built a new Linux server 
with fresh tomcat installs, and the only thing we moved over from the old 
Windows servers was the tomcat application folder itself, and the 100% CPU 
problem persisted, I can't imagine what else could be causing it except the 
tomcats, but I'm open to ideas.

When it happens, all the tomcats start using high CPU at the same time. See the 
following top output.

top - 11:06:44 up 1 day,  6:59,  7 users,  load average: 36.85, 32.67, 34.89
Tasks: 245 total,   4 running, 241 sleeping,   0 stopped,   0 zombie
%Cpu(s): 80.7 us, 13.5 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  5.7 si,  0.0 st
KiB Mem : 48132572 total, 11677420 free,  5572688 used, 30882464 buff/cache
KiB Swap: 15626236 total, 15584324 free,41912 used. 41859232 avail Mem

  PID USER  PR  NIVIRTRESSHR S  %CPU %MEM TIME+ COMMAND
19379 site211   20   0 3529072 447444  24632 S 120.4  0.9   3:37.19 java
20092 site555   20   0 2530376 375500  24496 S  72.4  0.8   2:01.44 java
21077 site450   20   0 2530292 298260  24292 S  69.6  0.6   1:10.92 java
20378 site436   20   0 3262200 347160  24096 S  68.3  0.7   2:47.26 java
19957 site522   20   0 2596856 373532  24364 S  52.0  0.8   2:37.13 java
19537 site396   20   0 2862724 386860  23820 S  51.1  0.8   2:34.25 java
19228 site116   20   0 3595652 490032  24640 S  50.5  1.0   5:03.28 java
20941 site456   20   0 2596996 338740  24488 S  49.2  0.7   1:32.89 java
20789 site354   20   0 2596920 327612  24480 S  42.9  0.7   1:30.47 java
20657 site327   20   0 3123004 346308  24540 S  41.4  0.7   1:50.97 java
20524 site203   20   0 2458376 340400  25416 S  39.8  0.7   1:48.01 java
19675 site487   20   0 2530296 390948  24408 S  35.7  0.8   2:37.95 java
20233 site535   20   0 2530292 324112  24360 S  32.9  0.7   1:54.31 java
19809 site514   20   0 2530216 400308  24340 S  25.7  0.8   2:35.97 java
   44 root  20   0   0  0  0 R  19.1  0.0 159:46.15 ksoftirqd/7
 3926 root  20   0  208512  22668   4128 S  16.9  0.0 242:45.07 iotop
 2036 root  20   0   0  0  0 R  13.2  0.0   1:38.31 kworker/7:0

I'll check the localhost_access logs and see if something suspicious stands out.

--Eric


-Original Message-
From: Utkarsh Dave 
Sent: Thursday, August 8, 2019 12:33 PM
To: Tomcat Users List 
Subject: Re: Tomcat Server Using 100% CPU

Did you reviewed the localhost_access log file. Which web-application is using 
tomcat the most ?

On Thu, Aug 8, 2019 at 9:53 AM Eric Robinson 
wrote:

> We have a farm of VMs, each running multiple instances of tomcat (up
> to 80 instances per server). Everything has been running fine for
> years, but recently one server has started nailing the CPU to 100% 
> utilization.
>
> We have tried:
>
>
>   *   Different versions of tomcat and JDK
>   *   Doubling the resources to 16 cores and 56 GB RAM
>   *   Moving the VM to different physical server
>   *   Rebuilding the tomcat instances on a brand new VM using Windows
> Server 2019
>   *   Rebuilding the tomcat instances on a brand new VM using Red Hat
> Enterprise Linux 7.5
>
> Nothing has worked. No matter where we run the tomcats, they drive CPU
> up to 100%. Meanwhile the other six servers are still running fine.
> They all run the same canned tomcat applications.
>
> We would appreciate some guidance on getting to the bottom of this problem.
>
> --Eric
>
>
> Disclaimer : This email and any files transmitted with it are
> confidential and intended solely for intended recipients. If you are
> not the named addressee you should not disseminate, distribute, copy or alter 
> this email.
> Any views or opinions presented in this email are solely those of the
> author and might not represent those of Physician Select Management.
> Warning: Although Physician Select Management has taken reasonable
> precautions to ensure no viruses are present in this email, the
> company cannot accept responsibility for any loss or damage arising
> from the use of this email or attachments.
>
Disclaimer : This email and any files transmitted with it are confidential and 
intended solely for intended recipients. If you are not the named addressee you 
should not disseminate, distribute, copy or alter this email. Any views or 
opinions presented in this email are solely those of the author and might not 
represent those of Physician Select Management. Warning: Although Physician 
Select Management has taken reasonable precautions to ensure no viruses are 
present in this email, the company cannot accept responsibility for any loss or 
damage arising from the use of this email or attachments.

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



Re: Tomcat Server Using 100% CPU

2019-08-08 Thread Utkarsh Dave
Did you reviewed the localhost_access log file. Which web-application is
using tomcat the most ?

On Thu, Aug 8, 2019 at 9:53 AM Eric Robinson 
wrote:

> We have a farm of VMs, each running multiple instances of tomcat (up to 80
> instances per server). Everything has been running fine for years, but
> recently one server has started nailing the CPU to 100% utilization.
>
> We have tried:
>
>
>   *   Different versions of tomcat and JDK
>   *   Doubling the resources to 16 cores and 56 GB RAM
>   *   Moving the VM to different physical server
>   *   Rebuilding the tomcat instances on a brand new VM using Windows
> Server 2019
>   *   Rebuilding the tomcat instances on a brand new VM using Red Hat
> Enterprise Linux 7.5
>
> Nothing has worked. No matter where we run the tomcats, they drive CPU up
> to 100%. Meanwhile the other six servers are still running fine. They all
> run the same canned tomcat applications.
>
> We would appreciate some guidance on getting to the bottom of this problem.
>
> --Eric
>
>
> Disclaimer : This email and any files transmitted with it are confidential
> and intended solely for intended recipients. If you are not the named
> addressee you should not disseminate, distribute, copy or alter this email.
> Any views or opinions presented in this email are solely those of the
> author and might not represent those of Physician Select Management.
> Warning: Although Physician Select Management has taken reasonable
> precautions to ensure no viruses are present in this email, the company
> cannot accept responsibility for any loss or damage arising from the use of
> this email or attachments.
>


RE: Tomcat Server Using 100% CPU

2019-08-08 Thread John.E.Gregg
Eric,

> -Original Message-
> From: Eric Robinson 
> Sent: Thursday, August 08, 2019 11:53 AM
> To: users@tomcat.apache.org
> Subject: Tomcat Server Using 100% CPU
> 
> We have a farm of VMs, each running multiple instances of tomcat (up to 80
> instances per server). Everything has been running fine for years, but
> recently one server has started nailing the CPU to 100% utilization.
> 
> We have tried:
> 
> 
>   *   Different versions of tomcat and JDK
>   *   Doubling the resources to 16 cores and 56 GB RAM
>   *   Moving the VM to different physical server
>   *   Rebuilding the tomcat instances on a brand new VM using Windows
> Server 2019
>   *   Rebuilding the tomcat instances on a brand new VM using Red Hat
> Enterprise Linux 7.5
> 
> Nothing has worked. No matter where we run the tomcats, they drive CPU
> up to 100%. Meanwhile the other six servers are still running fine. They all
> run the same canned tomcat applications.
> 
> We would appreciate some guidance on getting to the bottom of this
> problem.
> 
> --Eric
> 
> 

Are you sure that it's the Tomcat process that is using the CPU?  If so, take 
several thread dumps about 5 seconds apart.  On Linux, use kill -3 
tomcatpidhere.  They will go to catalina.out.  You'll probably need a developer 
to interpret them.



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



Tomcat Server Using 100% CPU

2019-08-08 Thread Eric Robinson
We have a farm of VMs, each running multiple instances of tomcat (up to 80 
instances per server). Everything has been running fine for years, but recently 
one server has started nailing the CPU to 100% utilization.

We have tried:


  *   Different versions of tomcat and JDK
  *   Doubling the resources to 16 cores and 56 GB RAM
  *   Moving the VM to different physical server
  *   Rebuilding the tomcat instances on a brand new VM using Windows Server 
2019
  *   Rebuilding the tomcat instances on a brand new VM using Red Hat 
Enterprise Linux 7.5

Nothing has worked. No matter where we run the tomcats, they drive CPU up to 
100%. Meanwhile the other six servers are still running fine. They all run the 
same canned tomcat applications.

We would appreciate some guidance on getting to the bottom of this problem.

--Eric


Disclaimer : This email and any files transmitted with it are confidential and 
intended solely for intended recipients. If you are not the named addressee you 
should not disseminate, distribute, copy or alter this email. Any views or 
opinions presented in this email are solely those of the author and might not 
represent those of Physician Select Management. Warning: Although Physician 
Select Management has taken reasonable precautions to ensure no viruses are 
present in this email, the company cannot accept responsibility for any loss or 
damage arising from the use of this email or attachments.


Re: where to look for $CATALINA_BASE/conf/ in Tomcat Server ?

2019-06-05 Thread Michael Kolenda
i recently did a JASPIC plugin for OIDC.

ended writing a simple authorization class that returned user roles based
on the request/Principal instead of trying to add JACC

arjan tijms guide is what i used for the most part

but you're right there is no decent Tomcat tutorial yet




On Wed, Jun 5, 2019, 8:43 AM Mark Thomas  wrote:

> On 05/06/2019 07:14, Karen Goh wrote:
> > Hi,
> >
> > I am trying to do JASPIC follows by JACC using Java Servlet and JSP and
> maybe REST with PostgresQL
> >
> >
> https://www.byteslounge.com/tutorials/jaas-authentication-in-tomcat-example
> >
> > However, I have difficulty in locating the $Catablina_base in the
> external tomcat server I am using in Eclipse.
> >
> > Also, I went to check out the hosting company side, I can't find
> Catalina_base at all also.
>
> For an explanation of $CATALINA_BASE
> http://tomcat.apache.org/tomcat-9.0-doc/RUNNING.txt
>
> Unless you have deliberately split them $CATALINA_BASE == $CATALINA_HOME
>
> Generally, $CATALINA_BASE/conf is where you will find your server.xml file.
>
> > I hope someone can tell me exactly where to put the jaas.config file for
> the JAAS to work.
> >
> > Another thing is about JASPIC.
> >
> > I can't find alot of tutorial regarding JASPIC.
>
> It isn't that widely used. It has potential but hasn't really caught on.
>
> > There is this guy Arjan Tijms which poses quite a fair bit of infor but
> I guess my Java skills is still not good enough to understand the mechanism
> of how things work.
> >
> > I am currently testing things out using Tomcat 9.0.4.
>
> I'd strongly recommend you update to the latest 9.0.x release.
>
> > And how does JASPIC + JACC fit into the scheme of salt based password
> verification.
> >
> > Hope someone can give me some hints how to go about securely password
> the simplest possible way based on JASPIC and JACC.  Thanks.
>
> Why use JASPIC and JACC. Note Tomcat doesn't provide a JACC implementation.
>
> Perhaps take a step back. Describe the problem you are trying to solve
> and maybe we can provide some pointers on how to best solve it with Tomcat.
>
> Mark
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: where to look for $CATALINA_BASE/conf/ in Tomcat Server ?

2019-06-05 Thread Mark Thomas
On 05/06/2019 07:14, Karen Goh wrote:
> Hi,
> 
> I am trying to do JASPIC follows by JACC using Java Servlet and JSP and maybe 
> REST with PostgresQL
> 
> https://www.byteslounge.com/tutorials/jaas-authentication-in-tomcat-example
> 
> However, I have difficulty in locating the $Catablina_base in the external 
> tomcat server I am using in Eclipse.
> 
> Also, I went to check out the hosting company side, I can't find 
> Catalina_base at all also.

For an explanation of $CATALINA_BASE
http://tomcat.apache.org/tomcat-9.0-doc/RUNNING.txt

Unless you have deliberately split them $CATALINA_BASE == $CATALINA_HOME

Generally, $CATALINA_BASE/conf is where you will find your server.xml file.

> I hope someone can tell me exactly where to put the jaas.config file for the 
> JAAS to work.
> 
> Another thing is about JASPIC.
> 
> I can't find alot of tutorial regarding JASPIC.

It isn't that widely used. It has potential but hasn't really caught on.

> There is this guy Arjan Tijms which poses quite a fair bit of infor but I 
> guess my Java skills is still not good enough to understand the mechanism of 
> how things work.
> 
> I am currently testing things out using Tomcat 9.0.4.

I'd strongly recommend you update to the latest 9.0.x release.

> And how does JASPIC + JACC fit into the scheme of salt based password 
> verification.  
> 
> Hope someone can give me some hints how to go about securely password the 
> simplest possible way based on JASPIC and JACC.  Thanks.

Why use JASPIC and JACC. Note Tomcat doesn't provide a JACC implementation.

Perhaps take a step back. Describe the problem you are trying to solve
and maybe we can provide some pointers on how to best solve it with Tomcat.

Mark

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



where to look for $CATALINA_BASE/conf/ in Tomcat Server ?

2019-06-04 Thread Karen Goh
Hi,

I am trying to do JASPIC follows by JACC using Java Servlet and JSP and maybe 
REST with PostgresQL

https://www.byteslounge.com/tutorials/jaas-authentication-in-tomcat-example

However, I have difficulty in locating the $Catablina_base in the external 
tomcat server I am using in Eclipse.

Also, I went to check out the hosting company side, I can't find Catalina_base 
at all also.

I hope someone can tell me exactly where to put the jaas.config file for the 
JAAS to work.

Another thing is about JASPIC.

I can't find alot of tutorial regarding JAPIC.

There is this guy Arjan Tijms which poses quite a fair bit of infor but I guess 
my Java skills is still not good enough to understand the mechanism of how 
things work.

I am currently testing things out using Tomcat 9.0.4.

And how does JASPIC + JACC fit into the scheme of salt based password 
verification.  

Hope someone can give me some hints how to go about securely password the 
simplest possible way based on JASPIC and JACC.  Thanks.

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



Re: Does Tomcat server printout System.out.print infor?

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

Karen,

On 5/14/19 07:45, Karen Goh wrote:
> On Tue, 5/14/19, Christopher Schultz 
> wrote: On 5/11/19 22:39, Karen Goh wrote:
>> Currently, I am uploading a new .war file up to my hosting 
>> company.
>> 
>>> However, I am puzzled how things work and would like to check
>>> what is the norm out there. They are using httpd apache server
>>> and tomcat.>> Basically, I have subscribed a private Tomcat
>>> server so I get an instance of Tomcat server - 8.0.27.
> 
>> That version is no longer supported by the "vendor" (Apache). You
>>  should tell your hosting company that you want a supported
>> version if they are going to charge you for it :)
> 
> May I know what version should I go for ?

I would ask for 8.5.40 (or close) or 9.0.19 (or close). Those are the
two currently support versions undergoing active development. Tomcat
7.0.x is still supported, but not much work is being done there anymore.

>> What kind of access do you have for the server? If you have shell
>>  access, you can probably get the logs. Using System.out.println
>> is not a great idea as it's pretty inflexible. It's better to use
>> a "proper" logging system where you can specify the log file
>> name, etc.
> 
> I do have access to the Catalina log.

Good.

> The technical support guy just told me that they have put in the 
> logging jar for me in their Tomcat server!

That shouldn't be necessary. System.out.println usually goes to
catalina.out, so you should already be all set. It's possible to
redirect it on a per-context basis, but then it just goes into another
file, also in the logs/ directory. Do you have any other log files in
there alongside catalina.out?


>> If you are using container-managed authentication (which is what
>>  Tomcat Realms provide), then you have to trust the hosting 
>> provider. There is no way to prevent the hosting provider from 
>> seeing any secrets you have in that configuration.
> 
> I am now mulling if I should use JWT.  In this case, I can skip
> the Realm configuration in tomcat right ?

I have no experience with JWT. But if you don't trust your hosting
provider, how can you trust them not to intercept your traffic, look
at your databases, etc.? Your realm configuration is the least of your
worries.

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

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlza7p0ACgkQHPApP6U8
pFjFuRAAuxbPAYClfZ24LuVwgWG4xlfAYww1ni7SPFr2wPXbUcQgB0ThPzYAegL6
3gA4Lzbx6u+ZTfVHdZr8AYCkudf0oBh9UoLU/7DHQTtgchsyUCVkIS3dNILlJlR0
4MG21YWcFNzzEIQ+N1jsupLZoojyd+vbzKdyNjCdPKzWbF3XVSfK8vhn+PEOGQPV
eECPXtLslZqyiFpUHNBZm/lnnXvlH/3qV0Mjqe4GWSVS33NGAdJQRIWvQjxKi3rY
TnBLspyb0PFUWZo4OwVTa8bkM7MLsMn6RhdrPWy1vIl34Jy8GkS+azO5MgYjVpCZ
VWb+tFHNP4hcnFii0JsX5q5Ugb+F8WhugjzTvbJiQ0Rq9xCO0NRVcF6GJxnoD9NI
8EkB/uHfwI0DJCDl33azl8CoomNQ0Btnf+yIMNi4MVux8H76dXjzUDne1gASmNgi
zuO/rDLSQ+0f4f1tflZV89KiwXvSMea3dNw9tRQ2vKQ0kdhp8fQ/oF7QHFURjFeM
+OEWKfIz+DEmCbI20TqENutTLFb6YeTpVDVkiB2uih1LoXMkccoZFOgKKYARJDev
x0qw3AX/PhHTPtBIaokJAQT1fWTcboD4FHHHLiQ8FpKTAjPHFzkOwoSUFEsiAXYM
M3mdX40l5TrPnBvYRHons8gvVlmfIgA0p+1sbD0ngOpDEd7iA4k=
=/ZG2
-END PGP SIGNATURE-

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



Re: Does Tomcat server printout System.out.print infor?

2019-05-14 Thread Karen Goh



On Tue, 5/14/19, Christopher Schultz  wrote:

 Subject: Re: Does Tomcat server printout System.out.print infor?
 To: users@tomcat.apache.org
 Date: Tuesday, May 14, 2019, 5:37 AM
 
 -BEGIN PGP SIGNED
 MESSAGE-
 Hash: SHA256
 
 Karen,
 
 On 5/11/19 22:39, Karen Goh wrote:
 > Currently, I am uploading a new .war file
 up to my hosting
 > company.
 > 
 > However, I am
 puzzled how things work and would like to check what
 > is the norm out there.
 > 
 > They are using httpd
 apache server and tomcat.
 > 
 > Basically, I have subscribed a private
 Tomcat server so I get an 
 > instance of
 Tomcat server - 8.0.27.
 That version is no
 longer supported by the "vendor" (Apache). You
 should tell your hosting company that you want
 a supported version if
 they are going to
 charge you for it :)
 
May I know what version should I go for ?
 >
 But, the re-start of server is not in my control.
 > 
 > I would like to know
 if this is the normal environment in a web
 > hosting company ?
 
 Inconvenient, perhaps, but not necessarily out
 of the ordinary.
 
 >
 Another thing is that, in my newly uploaded war file, I
 don't get
 > to see any
 System.out.println infor in my code, which I believe it 
 > should be printed out, as per my last log
 file indication in the
 > web hosting
 company.
 
 If it's
 "their" instance and not yours, then you probably
 won't see
 that. What kind of access do
 you have for the server? If you have
 shell
 access, you can probably get the logs. Using
 System.out.println
 is not a great idea as
 it's pretty inflexible. It's better to use a
 "proper" logging system where you can
 specify the log file name, etc.
 
I do have access to the Catalina log.
The technical support guy just told me that they have put in the logging jar 
for me in their Tomcat server!
 > What they told me is "Only if there
 is system level operation. For 
 >
 example, unloading/reloading a war file would have
 logged."
 > 
 > So,
 please help me know if it is not possible to see 
 > system.out.print infor as what I have put
 in the code in my java 
 > class ?
 > 
 > Another thing is
 that I am going to put in the Tomcat Realm for the
 >  log-in module and I am wondering where
 is the privacy since I do
 > not have the
 full control over Tomcat in this web hosting
 > environment ?
 
 If you are using container-managed
 authentication (which is what
 Tomcat Realms
 provide), then you have to trust the hosting provider.
 There is no way to prevent the hosting provider
 from seeing any
 secrets you have in that
 configuration.

I am now mulling if I should use JWT.  In this case, I can skip the Realm 
configuration in tomcat right ?
 
 - -chris
 -BEGIN PGP SIGNATURE-
 Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
 
 iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlzZ450ACgkQHPApP6U8
 pFi/EhAAhVS64ib8GzAl6PNLISm/rYeZ765eFg9eqRwCpPnss6ZuW/kD9moznKhN
 cj17X84itq3VihkRV+S/xnVM8TZ7OG71dwyhgrQUDcixuU9F37GVF16K5/gqHrF1
 cu5QrMWw9oPFIEUWEi3jaUJF233Jm9y5IgHCyyieAbcDiCm5Gl9NVd1opQHWBkKZ
 YqH0xGVGxADAf9QiFnkmX5ZEq2REaGr6sV5b2oKgQCKv2iEoCvWxFYuyqG1iIbz1
 wgbHqOy/adSdqvN704HcMaLTB7sfWBppp5RQyzN4Pz0Dx45845JRTWEdZpZ+YTop
 1Xa1NhkYd/MqV+VZoi0Ivd+pvva5cGKR4zPFKXW9KRFw3Gl+cLoQPlyXxN8k3yZv
 PDCDlRqAFoAZakJ6BC4HHarAPJzRWGPON1UWhtXR7VdLXCRhcLcMMZg1UX3n9HJ+
 ycw3haS99/0GPs1kMLNZ2Jk0QGf7v/lrU84PDQG8l27hJ8p4lJ4TqwxqMR0Nx9Uv
 iTpGodreOFJ+FXDegxYZNyrnOyOAuVl6Qi3iTz5bphuUa0FLrcX8pSJIt5PtgEFj
 qr71idqFeagCbbDJw/CtqchhEsTLyvfTFoNcTD2C5xuoG/Bo113/SKi4ffWTagxz
 y+nNPdRaKZ+dR+JotM37+7BYKxtNGnabaNT4nMUT04pHOdCmPSw=
 =kD0S
 -END PGP
 SIGNATURE-
 
 -
 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



Re: Does Tomcat server printout System.out.print infor?

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

Karen,

On 5/11/19 22:39, Karen Goh wrote:
> Currently, I am uploading a new .war file up to my hosting
> company.
> 
> However, I am puzzled how things work and would like to check what
> is the norm out there.
> 
> They are using httpd apache server and tomcat.
> 
> Basically, I have subscribed a private Tomcat server so I get an 
> instance of Tomcat server - 8.0.27.
That version is no longer supported by the "vendor" (Apache). You
should tell your hosting company that you want a supported version if
they are going to charge you for it :)

> But, the re-start of server is not in my control.
> 
> I would like to know if this is the normal environment in a web
> hosting company ?

Inconvenient, perhaps, but not necessarily out of the ordinary.

> Another thing is that, in my newly uploaded war file, I don't get
> to see any System.out.println infor in my code, which I believe it 
> should be printed out, as per my last log file indication in the
> web hosting company.

If it's "their" instance and not yours, then you probably won't see
that. What kind of access do you have for the server? If you have
shell access, you can probably get the logs. Using System.out.println
is not a great idea as it's pretty inflexible. It's better to use a
"proper" logging system where you can specify the log file name, etc.

> What they told me is "Only if there is system level operation. For 
> example, unloading/reloading a war file would have logged."
> 
> So, please help me know if it is not possible to see 
> system.out.print infor as what I have put in the code in my java 
> class ?
> 
> Another thing is that I am going to put in the Tomcat Realm for the
>  log-in module and I am wondering where is the privacy since I do
> not have the full control over Tomcat in this web hosting
> environment ?

If you are using container-managed authentication (which is what
Tomcat Realms provide), then you have to trust the hosting provider.
There is no way to prevent the hosting provider from seeing any
secrets you have in that configuration.

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

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlzZ450ACgkQHPApP6U8
pFi/EhAAhVS64ib8GzAl6PNLISm/rYeZ765eFg9eqRwCpPnss6ZuW/kD9moznKhN
cj17X84itq3VihkRV+S/xnVM8TZ7OG71dwyhgrQUDcixuU9F37GVF16K5/gqHrF1
cu5QrMWw9oPFIEUWEi3jaUJF233Jm9y5IgHCyyieAbcDiCm5Gl9NVd1opQHWBkKZ
YqH0xGVGxADAf9QiFnkmX5ZEq2REaGr6sV5b2oKgQCKv2iEoCvWxFYuyqG1iIbz1
wgbHqOy/adSdqvN704HcMaLTB7sfWBppp5RQyzN4Pz0Dx45845JRTWEdZpZ+YTop
1Xa1NhkYd/MqV+VZoi0Ivd+pvva5cGKR4zPFKXW9KRFw3Gl+cLoQPlyXxN8k3yZv
PDCDlRqAFoAZakJ6BC4HHarAPJzRWGPON1UWhtXR7VdLXCRhcLcMMZg1UX3n9HJ+
ycw3haS99/0GPs1kMLNZ2Jk0QGf7v/lrU84PDQG8l27hJ8p4lJ4TqwxqMR0Nx9Uv
iTpGodreOFJ+FXDegxYZNyrnOyOAuVl6Qi3iTz5bphuUa0FLrcX8pSJIt5PtgEFj
qr71idqFeagCbbDJw/CtqchhEsTLyvfTFoNcTD2C5xuoG/Bo113/SKi4ffWTagxz
y+nNPdRaKZ+dR+JotM37+7BYKxtNGnabaNT4nMUT04pHOdCmPSw=
=kD0S
-END PGP SIGNATURE-

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



Re: Does Tomcat server printout System.out.print infor?

2019-05-12 Thread John Dale
It is pretty normal.  If you don't want to deal with the systems
administration of your server, you can lease a tomcat instance and
deploy your war file.   A host will typically help you with some of
the configuration and management, and notify you if you have deployed
some naughty code that is consuming server resources.  This is
somewhere in between a WUSIWUG and a fill cloud server instance of,
say, Linux.

On 5/11/19, Karen Goh  wrote:
> Hello experts,
>
> Currently, I am uploading a new .war file up to my hosting company.
>
> However, I am puzzled how things work and would like to check what is the
> norm out there.
>
> They are using httpd apache server and tomcat.
>
> Basically, I have subscribed a private Tomcat server so I get an instance of
> Tomcat server - 8.0.27.
>
> But, the re-start of server is not in my control.
>
> I would like to know if this is the normal environment in a web hosting
> company ?
>
> Another thing is that, in my newly uploaded war file, I don't get to see any
> System.out.println infor in my code, which I believe it should be printed
> out, as per my last log file indication in the web hosting company.
>
> What they told me is
> "Only if there is system level operation. For example, unloading/reloading a
> war file would have logged."
>
> So, please help me know if it is not possible to see system.out.print infor
> as what I have put in the code in my java class ?
>
> Another thing is that I am going to put in the Tomcat Realm for the log-in
> module and I am wondering where is the privacy since I do not have the full
> control over Tomcat in this web hosting environment ?
>
> Thanks & regards,
> Karen
>
>
> -
> 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



Re: Does Tomcat server printout System.out.print infor?

2019-05-11 Thread Karen Goh



On Sun, 5/12/19, Jason Wee  wrote:

 Subject: Re: Does Tomcat server printout System.out.print infor?
 To: "Tomcat Users List" , "Karen Goh" 

 Date: Sunday, May 12, 2019, 10:52 AM
 
 default tomcat , when you print,
 logging should goes to catalina.out.
 In any
 case, check logging.properties in tomcat directory on where
 the
 logging configured.
 
 as for realm, it can be configure in the
 context element, which mean
 in the
 META-INF/context.xml, see
 https://tomcat.apache.org/tomcat-8.0-doc/realm-howto.html#Configuring_a_Realm

Thanks for your fast response.
I went to the URL link but there is no concrete example as to how to set the 
Realm inside context.xml.

Could you kindly point me to some examples that I can follow ?

Furthermore, my web host directory setting is like this:

tomcat
---> conf
---> Catalina -> this will open up with server.xml, tomcat-users.xml, web.xml 
-> websitename.com
->test1.websitename.com
->test2.websitename.com
logs

How do I enable the logging in this case to show my system.out.println infor ?

and the META-INF/context.xml do you mean in my web app before I make it into 
ROOT.WAR I have to do the configuration before I built it into ROOT.war so 
there is no need for me to touch anything on the web host directory right ?

 
 On Sun, May 12, 2019 at 10:40 AM Karen Goh
 
 wrote:
 >
 > Hello
 experts,
 >
 >
 Currently, I am uploading a new .war file up to my hosting
 company.
 >
 > However,
 I am puzzled how things work and would like to check what is
 the norm out there.
 >
 > They are using httpd apache server and
 tomcat.
 >
 > Basically,
 I have subscribed a private Tomcat server so I get an
 instance of Tomcat server - 8.0.27.
 >
 > But, the re-start of server is not in my
 control.
 >
 > I would
 like to know if this is the normal environment in a web
 hosting company ?
 >
 >
 Another thing is that, in my newly uploaded war file, I
 don't get to see any System.out.println infor in my
 code, which I believe it should be printed out, as per my
 last log file indication in the web hosting company.
 >
 > What they told me
 is
 > "Only if there is system level
 operation. For example, unloading/reloading a war file would
 have logged."
 >
 >
 So, please help me know if it is not possible to see
 system.out.print infor as what I have put in the code in my
 java class ?
 >
 >
 Another thing is that I am going to put in the Tomcat Realm
 for the log-in module and I am wondering where is the
 privacy since I do not have the full control over Tomcat in
 this web hosting environment ?
 >
 > Thanks & regards,
 >
 Karen
 >
 >
 >
 -
 > 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



Re: Does Tomcat server printout System.out.print infor?

2019-05-11 Thread Jason Wee
default tomcat , when you print, logging should goes to catalina.out.
In any case, check logging.properties in tomcat directory on where the
logging configured.

as for realm, it can be configure in the context element, which mean
in the META-INF/context.xml, see
https://tomcat.apache.org/tomcat-8.0-doc/realm-howto.html#Configuring_a_Realm

On Sun, May 12, 2019 at 10:40 AM Karen Goh  wrote:
>
> Hello experts,
>
> Currently, I am uploading a new .war file up to my hosting company.
>
> However, I am puzzled how things work and would like to check what is the 
> norm out there.
>
> They are using httpd apache server and tomcat.
>
> Basically, I have subscribed a private Tomcat server so I get an instance of 
> Tomcat server - 8.0.27.
>
> But, the re-start of server is not in my control.
>
> I would like to know if this is the normal environment in a web hosting 
> company ?
>
> Another thing is that, in my newly uploaded war file, I don't get to see any 
> System.out.println infor in my code, which I believe it should be printed 
> out, as per my last log file indication in the web hosting company.
>
> What they told me is
> "Only if there is system level operation. For example, unloading/reloading a 
> war file would have logged."
>
> So, please help me know if it is not possible to see system.out.print infor 
> as what I have put in the code in my java class ?
>
> Another thing is that I am going to put in the Tomcat Realm for the log-in 
> module and I am wondering where is the privacy since I do not have the full 
> control over Tomcat in this web hosting environment ?
>
> Thanks & regards,
> Karen
>
>
> -
> 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



Does Tomcat server printout System.out.print infor?

2019-05-11 Thread Karen Goh
Hello experts,

Currently, I am uploading a new .war file up to my hosting company.

However, I am puzzled how things work and would like to check what is the norm 
out there.

They are using httpd apache server and tomcat.  

Basically, I have subscribed a private Tomcat server so I get an instance of 
Tomcat server - 8.0.27.

But, the re-start of server is not in my control.  

I would like to know if this is the normal environment in a web hosting company 
?

Another thing is that, in my newly uploaded war file, I don't get to see any 
System.out.println infor in my code, which I believe it should be printed out, 
as per my last log file indication in the web hosting company.

What they told me is 
"Only if there is system level operation. For example, unloading/reloading a 
war file would have logged."

So, please help me know if it is not possible to see system.out.print infor as 
what I have put in the code in my java class ?

Another thing is that I am going to put in the Tomcat Realm for the log-in 
module and I am wondering where is the privacy since I do not have the full 
control over Tomcat in this web hosting environment ?

Thanks & regards,
Karen


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



Re: One tomcat server with different webapps on different ports?

2018-11-25 Thread Geraldo Netto
Hello Richard/Friends,

Maybe you could check 2 things
- the iptables to handle the incoming connections (eg: redirect
between ports and, block connections if the ip is accessing for a
specific port)
- httpd/nginx as reverse proxies for caching and other fancy stuff

Please note that I'm suggesting based on your info and once i'm not a
specialist, I might be saying some no sense
Maybe some more experienced might clarify/help
Digital Ocean has tons of interesting tutorials in that matter:
https://www.digitalocean.com/community/tutorials


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On Sun, 25 Nov 2018 at 11:03,  wrote:
>
> On 2018-11-24 23:25, Geraldo Netto wrote:
> > Hello Richard/Friends,
> >
> > I might be wrong, but I guess the best approach would be to use apache
> > httpd or nginx as a reverse proxy and leave tomcat alone
> >
> >
> > Kind Regards,
> >
> > Geraldo Netto
> > Sapere Aude => Non dvcor, dvco
> > http://exdev.sf.net/
> >
> > On Sun, 25 Nov 2018 at 00:05,  wrote:
> >>
> >> Tomcat/9.0.13
> >>
> >>
> >> I'd like to have my webapps generally on 443, but the manager and
> >> host-manager on some other port, say 444.
> >>
> >> My reason for doing that would be that I could then use linux's
> >> iptables
> >> to restrict access to 444 to a few known addresses, but anyone could
> >> access 443.
> >>
> >> I would of course want to use the manager application on 444 to manage
> >> the applications visible on 443.
> >>
> >> Is this possible?
> >>
> >>
> >> Richard
> >>
> >> -
>
>
> Hi Geraldo.
>
> How would that help?
>
> Can I have different virtual hosts in Apache get their content from
> different webapps in Tomcat?
>
> Richard
>
>
>
>
>
> -
> 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



Re: One tomcat server with different webapps on different ports?

2018-11-25 Thread richard

On 2018-11-24 23:25, Geraldo Netto wrote:

Hello Richard/Friends,

I might be wrong, but I guess the best approach would be to use apache
httpd or nginx as a reverse proxy and leave tomcat alone


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On Sun, 25 Nov 2018 at 00:05,  wrote:


Tomcat/9.0.13


I'd like to have my webapps generally on 443, but the manager and
host-manager on some other port, say 444.

My reason for doing that would be that I could then use linux's 
iptables

to restrict access to 444 to a few known addresses, but anyone could
access 443.

I would of course want to use the manager application on 444 to manage
the applications visible on 443.

Is this possible?


Richard

-



Hi Geraldo.

How would that help?

Can I have different virtual hosts in Apache get their content from 
different webapps in Tomcat?


Richard





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



Re: One tomcat server with different webapps on different ports?

2018-11-25 Thread Mark Thomas
On November 24, 2018 11:05:33 PM UTC, rich...@xentu.com wrote:
>Tomcat/9.0.13
>
>
>I'd like to have my webapps generally on 443, but the manager and 
>host-manager on some other port, say 444.
>
>My reason for doing that would be that I could then use linux's
>iptables 
>to restrict access to 444 to a few known addresses, but anyone could 
>access 443.
>
>I would of course want to use the manager application on 444 to manage 
>the applications visible on 443.
>
>Is this possible?

Not with Tomcat alone.

However, there is an alternative solution available. You could use the 
RemoteAddrValve to limit access. Tomcat comes with this configured to limit 
access to localhost.

Mark

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



Re: One tomcat server with different webapps on different ports?

2018-11-24 Thread Geraldo Netto
Hello Richard/Friends,

I might be wrong, but I guess the best approach would be to use apache
httpd or nginx as a reverse proxy and leave tomcat alone


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On Sun, 25 Nov 2018 at 00:05,  wrote:
>
> Tomcat/9.0.13
>
>
> I'd like to have my webapps generally on 443, but the manager and
> host-manager on some other port, say 444.
>
> My reason for doing that would be that I could then use linux's iptables
> to restrict access to 444 to a few known addresses, but anyone could
> access 443.
>
> I would of course want to use the manager application on 444 to manage
> the applications visible on 443.
>
> Is this possible?
>
>
> Richard
>
> -
> 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



One tomcat server with different webapps on different ports?

2018-11-24 Thread richard

Tomcat/9.0.13


I'd like to have my webapps generally on 443, but the manager and 
host-manager on some other port, say 444.


My reason for doing that would be that I could then use linux's iptables 
to restrict access to 444 to a few known addresses, but anyone could 
access 443.


I would of course want to use the manager application on 444 to manage 
the applications visible on 443.


Is this possible?


Richard

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



Re: Any one using Tomcat Server Side Include (SSI) support?

2018-06-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Mark,

On 6/26/18 1:48 PM, Mark Thomas wrote:
> Hi,
> 
> I'm currently working on an old bug to improve the SSI support in
> Tomcat [1]. Note that the original bug dates back to 2010.
> 
> I'm going to fix [1] if I can. SSI support is part of the current 
> release and the functionality is missing.
> 
> However, I got to wondering just how many folks are actually using
> SSI. Does it make sense to deprecate SSI support in 9.0.x and
> remove it in 10.0.x? It isn't a big deal to maintain support if it
> is required but neither do I think we should continue to maintain
> somethign no-one needs.
> 
> So, is anyone using SSI in Tomcat?

+1 to deprecate-and-remove

SSI is:

1. little used
2. easy to configure insecurely
3. more conveniently-configured using another component (e.g. httpd)
4. better-implemented as a servlet/JSP/whatever

I think the Internet moved-on from SSIs around 2001. It's time Tomcat
did as well. I wouldn't object to a Tomcat sub-project for SSIs or
even a non-Apache GitHub project to implement SSIs as a set of
container-agnostic Filter/Servlet implementations or whatever.

But I don't think it belongs in the container code anymore.

- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlsygXwACgkQHPApP6U8
pFgI1xAAp6+tZ/1BlkO2/gDd+Sm9N68dYXbxoQFp7cIMlfX6L57d9KlboVotMncT
4Ax5hUeVkzgGuJQvFCvSVlNvwQppv+jfpf9GIRfXLIjMj/OTNhqGOASDv9PQGXTn
RrOIMqwJy2AME8MNOJKuqo2ugbWp6PA+Dqq9W14ffa7ng5UGwfXUhlPEuD5g7R0Z
X0mVzJ+dUwaFDDrCW44xDCZtFDU6RaP4YaA4aBfjZTEkW5Al9bT3ul4C0jHAW2BU
3rNfLxhj89ywDp6JAP2mD6FmZL3F+QUk3FUxPD/SAcBXQwNweEsvkGvOq+5k5aUi
ycWkbbbFh5IIQ6ZkEmq5XG4RDCwwN3NEg3rnOpeF0f/tnYs/jEbtnHV2ZYa6NzMG
GTzwyijkA6UQ5s4LVTWy3zP8TARgXh2e+t24TClrQnrjYTFepFdcPr4G8kxAz/x+
LEsLsEJRmzkMDDzyyV5Ae8qyoIm7w+4RrzprV+fHbn/ksTxQxweXOEBy6nncix1G
VMYsNstvXwMNGE0EEmboUZ2Ovvd+qY5i/zw0NYTcsUyLcZ/sTVujwatg3drBhvd3
nJhCgQgnS+bTbqlWlRgs0JnvGS6CZ4J2nLwOwz2rI7MzMgxCL6d8xWR5BS+3lb34
FQRYLskm+Ltm64DnrEyjtuWfUH5TcY2D8A0OS+RMhf/mFAijfYc=
=vuWi
-END PGP SIGNATURE-

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



Any one using Tomcat Server Side Include (SSI) support?

2018-06-26 Thread Mark Thomas
Hi,

I'm currently working on an old bug to improve the SSI support in Tomcat
[1]. Note that the original bug dates back to 2010.

I'm going to fix [1] if I can. SSI support is part of the current
release and the functionality is missing.

However, I got to wondering just how many folks are actually using SSI.
Does it make sense to deprecate SSI support in 9.0.x and remove it in
10.0.x? It isn't a big deal to maintain support if it is required but
neither do I think we should continue to maintain somethign no-one needs.

So, is anyone using SSI in Tomcat?

Mark



[1] https://bz.apache.org/bugzilla/show_bug.cgi?id=53387

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



Re: application goes down after restart the tomcat server 8.29 or restart the OS

2018-06-08 Thread Loai Abdallatif
Thanks Chris, you input  appreciated

On Fri, Jun 8, 2018 at 10:31 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Loai,
>
> On 6/7/18 5:26 PM, Loai Abdallatif wrote:
> > thanks Chris, yes the apps are dependent on each others
>
> Sounds like you need to loosen that requirement.
>
> Try techniques such as "lazy initialization", or even
> automated-retries if something isn't up the first time to try to
> connect to it.
>
> Good luck,
> - -chris
>
> > On Thu, Jun 7, 2018 at 5:12 PM, Christopher Schultz <
> > ch...@christopherschultz.net> wrote:
> >
> > Loai,
> >
> > On 6/6/18 4:32 PM, Loai Abdallatif wrote:
>  Dear Colleagues I have HR application deployed on two tomcat
>  workers , but when I restart the tomcat instance or restart
>  the OS , then the application failed to start and just works
>  if I re-deploy the application again , please advise
> >
> > My guess is that your application relies on load-order of
> > applications being initialized, and when one of the dependencies
> > isn't running, the application cannot start.
> >
> > If that's the case, you need to make sure that your applications
> > can tolerate unavailability of any dependencies during startup.
> >
> > -chris
> >>
> >> -
> >>
> >>
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> >> For additional commands, e-mail: users-h...@tomcat.apache.org
> >>
> >>
> >
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlsa2ZIACgkQHPApP6U8
> pFhrWxAAs0YJgtBYpX/t0CMh2g57T6hHGMy8GDX1PnWIK4soJq+O9AXsecq9tdsj
> 9DQZ1zd1Bp4CeXQAy5JkUqcBD72TRArcly/4LUxQTNrftoPCnwK6kbyNYm3ftljE
> a07we37pAOXqxsaUyzlASQidq0uBhQVGzx4Q6UdhRKunsT95ddJUDBTlGJjV8qTa
> IoNpyzW11DSOPrYyZqFEq1nHwwkqpIuGUGOdNTWtS+O5i5g06YX1Et3Q7Gbpc9b7
> YsXALyYQ5o9K7Crq9qglPXukOqsKWnmX0oy7fhkFwrBYdQlV8STCzsGgh87bc1gx
> ltSA75pZ1gt/hqjQAXZwCpCb9PLvY6mDCpB6THou19QgMu4LwNTyxZRo4DlSBx5b
> +5PDkFO+MUISq7qfvjc6Qggn1RZ9KQF1PlwL7COcdjwwW3lLo7uRf9f4sQgT8IvT
> rzg4pSRPMJPRCngkoK6CrFnwCa4qO9esCsXAOBwpsSswSm/0lI5FfqQyaeCOynwT
> F1oCMWie99SE+xZo+iTgnxnxGJE+bJ3bJfw8xWw9Op9OCN3RHRS9MjPW6w+8hYUV
> slooqpR2b9+jzAjhefh/ewEJB9nE+8vi8keBJaIXqgQMh6w+jdE5NpqRJdCk64S2
> hORTO0+NTE84oMdkKPuA5EKg+NDcApWhalSJn4sphjhTSNBqtSE=
> =mpVz
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: application goes down after restart the tomcat server 8.29 or restart the OS

2018-06-08 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Loai,

On 6/7/18 5:26 PM, Loai Abdallatif wrote:
> thanks Chris, yes the apps are dependent on each others

Sounds like you need to loosen that requirement.

Try techniques such as "lazy initialization", or even
automated-retries if something isn't up the first time to try to
connect to it.

Good luck,
- -chris

> On Thu, Jun 7, 2018 at 5:12 PM, Christopher Schultz < 
> ch...@christopherschultz.net> wrote:
> 
> Loai,
> 
> On 6/6/18 4:32 PM, Loai Abdallatif wrote:
 Dear Colleagues I have HR application deployed on two tomcat 
 workers , but when I restart the tomcat instance or restart
 the OS , then the application failed to start and just works
 if I re-deploy the application again , please advise
> 
> My guess is that your application relies on load-order of
> applications being initialized, and when one of the dependencies
> isn't running, the application cannot start.
> 
> If that's the case, you need to make sure that your applications
> can tolerate unavailability of any dependencies during startup.
> 
> -chris
>> 
>> -
>>
>> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>> 
>> 
> 
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlsa2ZIACgkQHPApP6U8
pFhrWxAAs0YJgtBYpX/t0CMh2g57T6hHGMy8GDX1PnWIK4soJq+O9AXsecq9tdsj
9DQZ1zd1Bp4CeXQAy5JkUqcBD72TRArcly/4LUxQTNrftoPCnwK6kbyNYm3ftljE
a07we37pAOXqxsaUyzlASQidq0uBhQVGzx4Q6UdhRKunsT95ddJUDBTlGJjV8qTa
IoNpyzW11DSOPrYyZqFEq1nHwwkqpIuGUGOdNTWtS+O5i5g06YX1Et3Q7Gbpc9b7
YsXALyYQ5o9K7Crq9qglPXukOqsKWnmX0oy7fhkFwrBYdQlV8STCzsGgh87bc1gx
ltSA75pZ1gt/hqjQAXZwCpCb9PLvY6mDCpB6THou19QgMu4LwNTyxZRo4DlSBx5b
+5PDkFO+MUISq7qfvjc6Qggn1RZ9KQF1PlwL7COcdjwwW3lLo7uRf9f4sQgT8IvT
rzg4pSRPMJPRCngkoK6CrFnwCa4qO9esCsXAOBwpsSswSm/0lI5FfqQyaeCOynwT
F1oCMWie99SE+xZo+iTgnxnxGJE+bJ3bJfw8xWw9Op9OCN3RHRS9MjPW6w+8hYUV
slooqpR2b9+jzAjhefh/ewEJB9nE+8vi8keBJaIXqgQMh6w+jdE5NpqRJdCk64S2
hORTO0+NTE84oMdkKPuA5EKg+NDcApWhalSJn4sphjhTSNBqtSE=
=mpVz
-END PGP SIGNATURE-

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



Re: application goes down after restart the tomcat server 8.29 or restart the OS

2018-06-07 Thread Loai Abdallatif
thanks Chris, yes the apps are dependent on each others

On Thu, Jun 7, 2018 at 5:12 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Loai,
>
> On 6/6/18 4:32 PM, Loai Abdallatif wrote:
> > Dear Colleagues I have HR application deployed on two tomcat
> > workers , but when I restart the tomcat instance or restart the OS
> > , then the application failed to start and just works if I
> > re-deploy the application again , please advise
>
> My guess is that your application relies on load-order of applications
> being initialized, and when one of the dependencies isn't running, the
> application cannot start.
>
> If that's the case, you need to make sure that your applications can
> tolerate unavailability of any dependencies during startup.
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlsZPTAACgkQHPApP6U8
> pFh0YRAAkCcE1TdQP9lMVtqHmsS3h80xgsxhKYXjeEKB19XRtEdT6IWbaggr6zDv
> QQKaNR6ewb3BOsO3Dokp9rZT8/iITVnJL0ni/9zXm3Ahc9q+2t9rQD2EhPFPsoOr
> +MeGgfE8LLRKUCq/75XuDo5wA28uaOyD9gVu1P9sdR9SBo2+ysNTXZfzS6haIF6H
> wtnRDlmfSJT4XR5PtDeC+yJjkQkNzGJIr5RxqDY6IqL+s7dE4yLakrsHpno5BgU5
> CPPU3PCUjixwf+XDDE3fnC5Gl/RsL2MSSrgEK8/+IIWJYVpTSKP2lPHWZFYTVNl/
> WrVLZz6B3rk613LwIRmZfmTcUOTYca7i7BDuSDihQkcR+O4kIFizSdGvnuUu4+9X
> LM6UDbBFcmeN9qB83fCU0ixju4zlAkZMlLKgZtDvh45V5I4CPdSZxQzK1kwz6ZU0
> AO8haplvGnUkZSSwJyaYSoMYDkaYOGHSWY1sXLaOCPomFPuiWiRZvp3Ny3K5EOjC
> +aEiOX1Twr1X6GdnNJpheXu4ojS6CUZIgqupgXIrX81MnRbtOcKxFiYIaFtFyFWU
> xNX+tyr6xcA+6Tkm0fn/lhsLLj5HI5L3saESyNFbgauArWeicU31EWCN3jXQaN3W
> dtyDbSJoJvJ5fPcgPvd+DT5zKQ2tX8MAz/zF3KiIfUNiT7PhZQI=
> =nNJ3
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: application goes down after restart the tomcat server 8.29 or restart the OS

2018-06-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Loai,

On 6/6/18 4:32 PM, Loai Abdallatif wrote:
> Dear Colleagues I have HR application deployed on two tomcat
> workers , but when I restart the tomcat instance or restart the OS
> , then the application failed to start and just works if I
> re-deploy the application again , please advise

My guess is that your application relies on load-order of applications
being initialized, and when one of the dependencies isn't running, the
application cannot start.

If that's the case, you need to make sure that your applications can
tolerate unavailability of any dependencies during startup.

- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlsZPTAACgkQHPApP6U8
pFh0YRAAkCcE1TdQP9lMVtqHmsS3h80xgsxhKYXjeEKB19XRtEdT6IWbaggr6zDv
QQKaNR6ewb3BOsO3Dokp9rZT8/iITVnJL0ni/9zXm3Ahc9q+2t9rQD2EhPFPsoOr
+MeGgfE8LLRKUCq/75XuDo5wA28uaOyD9gVu1P9sdR9SBo2+ysNTXZfzS6haIF6H
wtnRDlmfSJT4XR5PtDeC+yJjkQkNzGJIr5RxqDY6IqL+s7dE4yLakrsHpno5BgU5
CPPU3PCUjixwf+XDDE3fnC5Gl/RsL2MSSrgEK8/+IIWJYVpTSKP2lPHWZFYTVNl/
WrVLZz6B3rk613LwIRmZfmTcUOTYca7i7BDuSDihQkcR+O4kIFizSdGvnuUu4+9X
LM6UDbBFcmeN9qB83fCU0ixju4zlAkZMlLKgZtDvh45V5I4CPdSZxQzK1kwz6ZU0
AO8haplvGnUkZSSwJyaYSoMYDkaYOGHSWY1sXLaOCPomFPuiWiRZvp3Ny3K5EOjC
+aEiOX1Twr1X6GdnNJpheXu4ojS6CUZIgqupgXIrX81MnRbtOcKxFiYIaFtFyFWU
xNX+tyr6xcA+6Tkm0fn/lhsLLj5HI5L3saESyNFbgauArWeicU31EWCN3jXQaN3W
dtyDbSJoJvJ5fPcgPvd+DT5zKQ2tX8MAz/zF3KiIfUNiT7PhZQI=
=nNJ3
-END PGP SIGNATURE-

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



Re: application goes down after restart the tomcat server 8.29 or restart the OS

2018-06-06 Thread Suvendu Sekhar Mondal
Loai,

On Thu, Jun 7, 2018, 2:03 AM Loai Abdallatif 
wrote:

> Dear Colleagues
> I have HR application deployed on two tomcat workers , but when I restart
> the tomcat instance or restart the OS , then the application failed to
> start and just works if I re-deploy the application again , please advise
>

What is the error you are getting? Please provide some details, otherwise
it will be very hard to help you out here.

>


application goes down after restart the tomcat server 8.29 or restart the OS

2018-06-06 Thread Loai Abdallatif
Dear Colleagues
I have HR application deployed on two tomcat workers , but when I restart
the tomcat instance or restart the OS , then the application failed to
start and just works if I re-deploy the application again , please advise


Re: 401 Unauthorized Exception restful webservice Linux OS, Tomcat Server

2018-05-29 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Prasanna,

On 5/26/18 2:09 PM, Prasanna Pati wrote:
> We are trying to access the Lithium Rest Api (its a https site)
> through Spring Rest Template as below
> 
> `String plainCreds = lswUserName + ":" + lswPassword;
> 
> byte[] plainCredsBytes = plainCreds.getBytes();
> 
> byte[] base64CredsBytes = Base64.encodeBase64(plainCredsBytes);
> 
> String base64Creds = new String(base64CredsBytes);
> 
> HttpHeaders headers = new HttpHeaders();
> 
> headers.add("Authorization", "Basic " + base64Creds);
> 
> 
> 
> HttpEntity request = new HttpEntity(headers);
> 
> ResponseEntity sRawResp =
> restTemplate.exchange(completeURL.toString(), HttpMethod.GET,
> request, String.class);'
> 
> Above code always gives
> org.springframework.web.client.HttpClientErrorException: 401
> Unauthorized Exception
> 
> There were no issues when invoking the same web service through
> postman, however whenever accessed through java code, getting the
> above 401 unauthorized exception
> 
> Previously I faced this issue with Windows OS, I struggled a lot
> and got the solution. The Soultion was, In Tomcat/bin folder I have
> added below entry related to proxy in to catalina.bat file set
> "JAVA_OPTS=%JAVA_OPTS% -Dhttp.proxyHost=hy**1.*.co.in
> -Dhttp.proxyPort=8080 "
> 
> This resolved the issue in Windows OS. Now we moved the entire
> setup to Linux OS and now i get the same error. Here in linux i
> don't have any proxy set. checked through wget
> http://www.google.com (Here no proxy
> details displayed). In this case how to resolve this issue in Linux
> when no proxy is set.
> 
> Please Help.

If you are getting a 401 response, it's probably not because you can't
make a connection. More likely is that you haven't implemented the
credential-munging properly. Your code looks okay to be, but you may
be missing:

1. The correct character encoding. Is the server passing a "charset"
parameter with the WWW-Authenticate header?

2. Does the username contain a colon? (That's not allowed per spec)

3. Does your Base64.encodeBase64 class implement RFC4648 faithfully?

There are some examples in RFC7617[1] with both plaintext and encoded
credentials. You might want to validate that your implementation
reproduces those examples correctly.

- -chris

[1] https://tools.ietf.org/html/rfc7617
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlsNWgcACgkQHPApP6U8
pFgZPw//X5bm1O6vUGM+fVzSIExQjRqVHU69IWiI2DC+1ygjI+IWTx2wNnPxgMVy
iejon1xmwplcJz2GXuilAFMNpVzioVY8Z40dFjm/eNzJu7NvXL9t0vd8NFRZnmuF
GLXRMTBDvNLeVGgIX5DhDZwJk29ANfwgORuvg5vhgK5HzmR5O+lo8eeLMmh1BUO2
iywoOS06y+GnHOEvSNz4F/3zwOoBRrxqj4Q0dQ0rEWoNBwax0bNWlRDgne8t5dMD
FATiANojwig0yNMjIIs36qHztej0twBL6JAlWdmlE6MxjxPtw3SFYovqPiM0pw6X
e+WV1RnQFYAT4jCHX5D+j3E0WntTuSUZfhaml9j9MN2nGrTv7WlOnjUMdOeZBNNa
CT3mWH2pLYP1y27XDXWIYORPTo05cvIp//7jcTmTcnrEMvymsqij7BykTos6ZUnl
kK/9Q6rLyU5zvtW973wSKOb9K9gfiGIMDJ6/cxFrs/RQOFeazhV9j6oqAzRz7dQp
nTz1L2/ghEexBfB87E5np5QQ83fF5QUAqMMuCHCU4nWxoEU64w1CVuj0crXWfexG
C31fedUG21EUvfsBeDVGxs6IVaesWg1zWUlSlhW93K71E+zGT2kplt5JJM0YwPNC
hesuxVhgrteGx+J/ynGqu7/KNpWwKkuImmbuPIN9spBQvXND7W4=
=6G5J
-END PGP SIGNATURE-

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



401 Unauthorized Exception restful webservice Linux OS, Tomcat Server

2018-05-26 Thread Prasanna Pati
We are trying to access the Lithium Rest Api (its a https site) through Spring 
Rest Template as below

   `String plainCreds = lswUserName + ":" + lswPassword;

byte[] plainCredsBytes = plainCreds.getBytes();

byte[] base64CredsBytes = Base64.encodeBase64(plainCredsBytes);

String base64Creds = new String(base64CredsBytes);

HttpHeaders headers = new HttpHeaders();

headers.add("Authorization", "Basic " + base64Creds);



HttpEntity request = new HttpEntity(headers);

ResponseEntity sRawResp = 
restTemplate.exchange(completeURL.toString(), HttpMethod.GET, request, 
String.class);'

Above code always gives 
org.springframework.web.client.HttpClientErrorException: 401 Unauthorized 
Exception

There were no issues when invoking the same web service through postman, 
however whenever accessed through java code, getting the above 401 unauthorized 
exception

Previously I faced this issue with Windows OS, I struggled a lot and got the 
solution. The Soultion was, In Tomcat/bin folder I have added below entry 
related to proxy in to catalina.bat file set "JAVA_OPTS=%JAVA_OPTS% 
-Dhttp.proxyHost=hy**1.*.co.in -Dhttp.proxyPort=8080 "

This resolved the issue in Windows OS. Now we moved the entire setup to Linux 
OS and now i get the same error. Here in linux i don't have any proxy set. 
checked through wget http://www.google.com (Here no 
proxy details displayed). In this case how to resolve this issue in Linux when 
no proxy is set.

Please Help.

DISCLAIMER
==
This e-mail may contain privileged and confidential information which is the 
property of Persistent Systems Ltd. It is intended only for the use of the 
individual or entity to which it is addressed. If you are not the intended 
recipient, you are not authorized to read, retain, copy, print, distribute or 
use this message. If you have received this communication in error, please 
notify the sender and delete all copies of this message. Persistent Systems 
Ltd. does not accept any liability for virus infected mails.


Re: Mutual SSL client certificate validation(Key Usage and Extended Key Usage) in tomcat server

2018-02-04 Thread Mark Thomas

On 05/02/2018 02:14, Indunil Rathnayake wrote:

Hi,

On 2 February 2018 at 19:55, Christopher Schultz <
ch...@christopherschultz.net> wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Mark,

On 2/2/18 5:35 AM, Mark Thomas wrote:

On 02/02/18 04:06, Christopher Schultz wrote:




It seems reasonable for Tomcat to verify that any "critical"
key-use extensions are respected, and perhaps even some
non-critical ones.


I'd assume that JSSE / OpenSSl do this automatically. Is there any
evidence that they do not?


Sorry, I meant to say that Tomcat should probably perform those checks
if the underlying TLS handler is not already doing them, or instruct
the underlying handler to perform those checks if they are not already
being done and can be done during the handshake.



Thanks.. Appreciate if you can share some reference for how we can enable
this validation through a tomcat handler.


I'll repeat. Is there any evidence that this is not already being 
performed in JSSE / OpenSSL by default?


Mark


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



Re: Mutual SSL client certificate validation(Key Usage and Extended Key Usage) in tomcat server

2018-02-04 Thread Indunil Rathnayake
Hi,

On 2 February 2018 at 19:55, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Mark,
>
> On 2/2/18 5:35 AM, Mark Thomas wrote:
> > On 02/02/18 04:06, Christopher Schultz wrote:
> >
> > 
> >
> >> It seems reasonable for Tomcat to verify that any "critical"
> >> key-use extensions are respected, and perhaps even some
> >> non-critical ones.
> >
> > I'd assume that JSSE / OpenSSl do this automatically. Is there any
> > evidence that they do not?
>
> Sorry, I meant to say that Tomcat should probably perform those checks
> if the underlying TLS handler is not already doing them, or instruct
> the underlying handler to perform those checks if they are not already
> being done and can be done during the handshake.
>

Thanks.. Appreciate if you can share some reference for how we can enable
this validation through a tomcat handler.


>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQJRBAEBCAA7FiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlp0dNodHGNocmlzQGNo
> cmlzdG9waGVyc2NodWx0ei5uZXQACgkQHPApP6U8pFioMQ/8CjEoj/JLUblsMIOF
> m/tQ3UuuNz1s1vxfpHUWCI1BRIGmu4fGYnKmjaFuGn2iHVpt7lMjOreXkHNtkVdP
> g7oPbdihGkltIOrj4ayiZXNMH40fMRRHNqQEITKMR+u9f0smqzJB3A2YYcO9qvtH
> MDv/Vg1c2f5btWDfXj9FV5rwbtrMbJSFrwDg0mOTOEoZMjtr3FCxbT8XfMseGE85
> a7WCEljodU64ef5F0tbsj4KQqNFcVkkpI8YpGni1y9suDFyeN2JXeVJUJRK2f28A
> 55HIQvhVvWU3d+c2ZfQQJiY1XJ7Feg+54rczXXusfIxMd/zQxvptdMlzRjkss5Rg
> 7MzrpO3NDPmDadAeTw0pDAAhUzWVn/BlGlb7hioXkU/lJR/PzN03DbiVdC6HBquj
> 0f0rV53MhS28SmhU1GCLex1kyDqlRfcqpd0QD+Yyi/WgcnVR4lr60brdu8WquvuQ
> qT5jtT/tSZHImMGGGnVxE0Fg0wZaSdBf9tA9NqNAYUXsoMituRTeDQoL9DeIPs0F
> QDnURxtOTfkhmtq/wYeZSqzoPZGdSyfTT6quOugVeECrLkT7lZQHetGLIwlNVuRY
> gP17H521N46dysVe/Qec1o+7FTJsJ7eQ/nEtJVnCI8PPJBT3XITB+LDaHEc5XNSH
> BUB6HOt4pNpncpdWSO8o1HgDNfc=
> =EEgh
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


-- 

*Indunil Rathnayake *

*Faculty of Information Technology*

*University of Moratuwa.*


Re: Mutual SSL client certificate validation(Key Usage and Extended Key Usage) in tomcat server

2018-02-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Mark,

On 2/2/18 5:35 AM, Mark Thomas wrote:
> On 02/02/18 04:06, Christopher Schultz wrote:
> 
> 
> 
>> It seems reasonable for Tomcat to verify that any "critical"
>> key-use extensions are respected, and perhaps even some
>> non-critical ones.
> 
> I'd assume that JSSE / OpenSSl do this automatically. Is there any 
> evidence that they do not?

Sorry, I meant to say that Tomcat should probably perform those checks
if the underlying TLS handler is not already doing them, or instruct
the underlying handler to perform those checks if they are not already
being done and can be done during the handshake.

- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQJRBAEBCAA7FiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlp0dNodHGNocmlzQGNo
cmlzdG9waGVyc2NodWx0ei5uZXQACgkQHPApP6U8pFioMQ/8CjEoj/JLUblsMIOF
m/tQ3UuuNz1s1vxfpHUWCI1BRIGmu4fGYnKmjaFuGn2iHVpt7lMjOreXkHNtkVdP
g7oPbdihGkltIOrj4ayiZXNMH40fMRRHNqQEITKMR+u9f0smqzJB3A2YYcO9qvtH
MDv/Vg1c2f5btWDfXj9FV5rwbtrMbJSFrwDg0mOTOEoZMjtr3FCxbT8XfMseGE85
a7WCEljodU64ef5F0tbsj4KQqNFcVkkpI8YpGni1y9suDFyeN2JXeVJUJRK2f28A
55HIQvhVvWU3d+c2ZfQQJiY1XJ7Feg+54rczXXusfIxMd/zQxvptdMlzRjkss5Rg
7MzrpO3NDPmDadAeTw0pDAAhUzWVn/BlGlb7hioXkU/lJR/PzN03DbiVdC6HBquj
0f0rV53MhS28SmhU1GCLex1kyDqlRfcqpd0QD+Yyi/WgcnVR4lr60brdu8WquvuQ
qT5jtT/tSZHImMGGGnVxE0Fg0wZaSdBf9tA9NqNAYUXsoMituRTeDQoL9DeIPs0F
QDnURxtOTfkhmtq/wYeZSqzoPZGdSyfTT6quOugVeECrLkT7lZQHetGLIwlNVuRY
gP17H521N46dysVe/Qec1o+7FTJsJ7eQ/nEtJVnCI8PPJBT3XITB+LDaHEc5XNSH
BUB6HOt4pNpncpdWSO8o1HgDNfc=
=EEgh
-END PGP SIGNATURE-

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



Re: Mutual SSL client certificate validation(Key Usage and Extended Key Usage) in tomcat server

2018-02-02 Thread Indunil Rathnayake
Hi Chris,





On 2 February 2018 at 09:36, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Indunil,
>
> On 2/1/18 7:33 AM, Indunil Rathnayake wrote:
> > I have configured a tomcat connector for handling requests for a
> > particular servlet and have configured a trust store for the
> > connector. Anyone knows whether tomcat handles validation of "Key
> > Usage" and "Extended Key Usage" extensions in client certificates?
> > And how it's handled through tomcat(is it through the tomcat
> > connector)?
> >
> > Appreciate your help on this.
>
> Are you interested in making sure that Tomcat verifies that the
> certificate is e.g. allowed to be used for TLS client authentication?
>
> I'm fairly sure Tomcat does not currently verify any of the key-usage
> fields on a certificate. The assumption is that if a trusted CA
> doesn't think a key should be used for authentication, then the CA
> should not sign that certificate.
>
> But it's reasonable to imagine a scenario where a code-signing
> certificate signed by a CA could be "illegally" used as a TLS client
> certificate, and in that case, Tomcat would allow the handshake.
>
> It seems reasonable for Tomcat to verify that any "critical" key-use
> extensions are respected, and perhaps even some non-critical ones.
>
> Is this what you had in mind?
>

Thanks a lot for the information. I really appreciate it. Yes, I was
concerned whether tomcat is validate the key usage and extended key usage
extensions, for checking whether a particular certificate is served the
purpose it is intended to. Ex: in client authentication, certificate
without "clientAuth" extended key usage in extension shouldn't be taken as
a valid certificate from tomcat level.

As per your comment, seems like in tomcat level, those validations will not
be done.

Do you know what are the "key usage" or "extended key usage" extension
values should be required, in order to support client authentication?



>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlpz46oACgkQHPApP6U8
> pFiqiBAAmL6qk1g+TOSgsy9fvs7E540l8fuAk3jQ7l0z/uy9hOIUw6yYjvMorabG
> MWmc6VLRJ95y1ALbmW/olEGVZ4SHihdnmlJbkZ8AqiKBQtaz6fWKXcGdYymlnoE5
> jTye1XLBjk7lyhOWoP6bW315Bg+LI62gzUoFukphcmEQwE9CkpzVEJtpnfXpuCuf
> xJl0sh8oTKaU+Fsy4nW4HITSmuVHNEaoKseKCRSjDe1z4pc1NG9n5QN4Ij5TX53o
> JLIqv3c8dpyIO2+brIoc+KvXBNVBngaDsiDbJszGdhDICsIoz0andxHwzQRLoqtu
> 4I5eLpO/qbGNk10Kl/TRamnIUw+t79NsE+WeAbwX30zkEPkApb7rJ6M4g6haQPg5
> wSaka+FLy/zdlNVzBw6iiJla4UiLtzlVXYUlCCC/j/cs+aV0A2ilsUYZNUrLMB3F
> No77FxDt+bo6v8U2JqS4AU6N/5ktNVRfpwcDWQrNT1TTWFdOMzqxI1NVSm08hmwM
> FrBaO6dL6ZikaB2x1Xb3STyGKb3t03R/AqI/CQpxUus9a/0AHVMNM8ru+gnB8kJu
> TCkjE3+Tu3Uh+wLzR8bTkqpecFtLNV3Lf6I6k+FrbLb3XBWW7EBpTx3yeKbCij7X
> rHigCnOMO/Np3YE6Ttuepja0poEYdLo+yGbaKxZQubIjVfPMmjU=
> =e5q4
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


-- 

*Indunil Rathnayake *

*Faculty of Information Technology*

*University of Moratuwa.*

Email : *indunil@gmail.com * | Skype: indu.upeksha
| Mobile : (+94)713695179  | Twitter @indunilUR |

LinkedIn: http://lk.linkedin.com/in/indunil

|  Facebook
: https://www.facebook.com/indunilrathnayake80


Re: Mutual SSL client certificate validation(Key Usage and Extended Key Usage) in tomcat server

2018-02-02 Thread Mark Thomas
On 02/02/18 04:06, Christopher Schultz wrote:



> It seems reasonable for Tomcat to verify that any "critical" key-use
> extensions are respected, and perhaps even some non-critical ones.

I'd assume that JSSE / OpenSSl do this automatically. Is there any
evidence that they do not?

Mark

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



Re: Mutual SSL client certificate validation(Key Usage and Extended Key Usage) in tomcat server

2018-02-01 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Indunil,

On 2/1/18 7:33 AM, Indunil Rathnayake wrote:
> I have configured a tomcat connector for handling requests for a
> particular servlet and have configured a trust store for the
> connector. Anyone knows whether tomcat handles validation of "Key
> Usage" and "Extended Key Usage" extensions in client certificates?
> And how it's handled through tomcat(is it through the tomcat
> connector)?
> 
> Appreciate your help on this.

Are you interested in making sure that Tomcat verifies that the
certificate is e.g. allowed to be used for TLS client authentication?

I'm fairly sure Tomcat does not currently verify any of the key-usage
fields on a certificate. The assumption is that if a trusted CA
doesn't think a key should be used for authentication, then the CA
should not sign that certificate.

But it's reasonable to imagine a scenario where a code-signing
certificate signed by a CA could be "illegally" used as a TLS client
certificate, and in that case, Tomcat would allow the handshake.

It seems reasonable for Tomcat to verify that any "critical" key-use
extensions are respected, and perhaps even some non-critical ones.

Is this what you had in mind?

- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlpz46oACgkQHPApP6U8
pFiqiBAAmL6qk1g+TOSgsy9fvs7E540l8fuAk3jQ7l0z/uy9hOIUw6yYjvMorabG
MWmc6VLRJ95y1ALbmW/olEGVZ4SHihdnmlJbkZ8AqiKBQtaz6fWKXcGdYymlnoE5
jTye1XLBjk7lyhOWoP6bW315Bg+LI62gzUoFukphcmEQwE9CkpzVEJtpnfXpuCuf
xJl0sh8oTKaU+Fsy4nW4HITSmuVHNEaoKseKCRSjDe1z4pc1NG9n5QN4Ij5TX53o
JLIqv3c8dpyIO2+brIoc+KvXBNVBngaDsiDbJszGdhDICsIoz0andxHwzQRLoqtu
4I5eLpO/qbGNk10Kl/TRamnIUw+t79NsE+WeAbwX30zkEPkApb7rJ6M4g6haQPg5
wSaka+FLy/zdlNVzBw6iiJla4UiLtzlVXYUlCCC/j/cs+aV0A2ilsUYZNUrLMB3F
No77FxDt+bo6v8U2JqS4AU6N/5ktNVRfpwcDWQrNT1TTWFdOMzqxI1NVSm08hmwM
FrBaO6dL6ZikaB2x1Xb3STyGKb3t03R/AqI/CQpxUus9a/0AHVMNM8ru+gnB8kJu
TCkjE3+Tu3Uh+wLzR8bTkqpecFtLNV3Lf6I6k+FrbLb3XBWW7EBpTx3yeKbCij7X
rHigCnOMO/Np3YE6Ttuepja0poEYdLo+yGbaKxZQubIjVfPMmjU=
=e5q4
-END PGP SIGNATURE-

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



Re: Mutual SSL client certificate validation(Key Usage and Extended Key Usage) in tomcat server

2018-02-01 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Indunil,

On 2/1/18 6:15 PM, Indunil Rathnayake wrote:
> Adding Chris

There's no need to specifically CC list members.

- -chris

> On 1 February 2018 at 18:03, Indunil Rathnayake
>  wrote:
> 
>> Hi,
>> 
>> I have configured a tomcat connector for handling requests for a 
>> particular servlet and have configured a trust store for the
>> connector. Anyone knows whether tomcat handles validation of "Key
>> Usage" and "Extended Key Usage" extensions in client
>> certificates? And how it's handled through tomcat(is it through
>> the tomcat connector)?
>> 
>> Appreciate your help on this.
>> 
>> Thanks and Regards
>> 
>> --
>> 
>> *Indunil Rathnayake *
>> 
>> *Faculty of Information Technology*
>> 
>> *University of Moratuwa.*
>> 
>> 
> 
> 
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlpz4EwACgkQHPApP6U8
pFjCcg/9HKMR3ZOqc8GnH94NBivjn7Vg9E3W47Wzk+RNT2i4NfZc4qTboghmDoW0
7obpHS475oQ6RRyWvXpbmF5LkVcMx1lNRXDo1t090x740bJ9mKyB9MpXJI49YoqZ
V3hH5Mu9ZsnX+2jU7xmU2d074PsVgl+YdOsn+uQm+yF+a7Gg7ChfLe1+MWe/bYog
GALkWQ5pGF34BDe4N4BAipjsBtrm6vvMf4ukmQAJsQ8A0QahAlVmv+N6/R8nyx7I
MM1kKpIlCf4yKkOafayS3oKrxIr0J6c58jCcfzr2+EmMQ+bHh+2V45/hqnLjyWYd
1VJy7EufCftU+ow6c4JtlBaiPGiEnNmaU66Giiw2fKgAevqAggQBjvUJsV6EADBv
QGj7qABDJzAn5bRHwSO4CXiqbtDpP3fLPPEnnlcZCGedSo4Gqa6akacfYenDEHNf
jxItoaSnJpqO4TdMWz0+5LO2Z73uDAYlaZi1uiCtyuGrQzr7bYsmSQ4bRsC01SQl
+44RF/1n2EC8/GWNK7Z9ucAQ0+3q5kxqyr+l58ifKNPlr2Or4z7J6Mk+PkQGTmM4
fx6usRzA613Qm5fFM6mXuxAOWIoFdzA8C55ImCk5r6m3uW4o6zEKH4IdTqjNd2xw
UV2uij1JZhm0xrVCXFBKSN6lHOlUTg/TjH9cxIldvE7NpbRmKY0=
=60ml
-END PGP SIGNATURE-

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



Re: Mutual SSL client certificate validation(Key Usage and Extended Key Usage) in tomcat server

2018-02-01 Thread Indunil Rathnayake
Adding Chris

On 1 February 2018 at 18:03, Indunil Rathnayake 
wrote:

> Hi,
>
> I have configured a tomcat connector for handling requests for a
> particular servlet and have configured a trust store for the connector.
> Anyone knows whether tomcat handles validation of "Key Usage" and "Extended
> Key Usage" extensions in client certificates? And how it's handled through
> tomcat(is it through the tomcat connector)?
>
> Appreciate your help on this.
>
> Thanks and Regards
>
> --
>
> *Indunil Rathnayake *
>
> *Faculty of Information Technology*
>
> *University of Moratuwa.*
>
>


-- 

*Indunil Rathnayake *

*Faculty of Information Technology*

*University of Moratuwa.*

Email : *indunil@gmail.com * | Skype: indu.upeksha
| Mobile : (+94)713695179  | Twitter @indunilUR |

LinkedIn: http://lk.linkedin.com/in/indunil

|  Facebook
: https://www.facebook.com/indunilrathnayake80


  1   2   3   4   5   6   7   8   >