RE: Issue Migrating servlets to 10.1

2023-11-21 Thread Campbell, Lance
Thanks so much.
One last question. If I want to use javax.serlet.* then what is the highest 
version of Java I should use? 

Thanks,

Lance

-Original Message-
From: Robert Turner  
Sent: Tuesday, November 21, 2023 2:36 PM
To: Tomcat Users List 
Subject: Re: Issue Migrating servlets to 10.1

Tomcat 10.x and higher require Jakarta namespaces versions of the Servlet 
specifications.
Tomcat 9.x is the last Tomcat support javax.servlet namespaces.

Refer to the Which Version page for Tomcat for details:
https://urldefense.com/v3/__https://tomcat.apache.org/whichversion.html__;!!DZ3fjg!4VB2wQDqugXc0S2euhB5gcgb0Cu6xk-8SLRK_GwqXTxu2U6M3PLo_zrv8d_LmTAOeY0pUCw2GMYHX0pcXv1cMQ$
 

On Tue, Nov 21, 2023 at 3:30 PM Campbell, Lance  wrote:

> I am migrating from Java 8 tomcat 9 to Java 11 tomcat 10.1 .
>
> I am getting a cast class exception when trying to access my login 
> servlet. In my servlets I am using these packages:
>
>
> import javax.servlet.ServletException;
>
> import javax.servlet.http.HttpServlet;
>
> import javax.servlet.http.HttpServletRequest;
>
> import javax.servlet.http.HttpServletResponse;
>
>
>   1.  Does either Java 11 or Tomcat 10.1 require that I use
> Jakarta.servlet.* packages instead of javax.servlet.*?
>   2.  If that is the case, then what is specifically requiring this? 
> Is it Java 11 or Tomcat 10.1 or both?
>
> My servlet is getting this error:
>
> 21-Nov-2023 14:14:52.768 INFO [main]
> org.apache.catalina.core.ApplicationContext.log Marking servlet 
> [LoginServlet] as unavailable
> 21-Nov-2023 14:14:52.769 SEVERE [main] 
> org.apache.catalina.core.StandardContext.loadOnStartup Servlet 
> [LoginServlet] in web application [] threw load() exception
> java.lang.ClassCastException: class xyz.servlet.LoginServlet 
> cannot be cast to class jakarta.servlet.Servlet 
> (xyz.servlet.LoginServlet is in unnamed module of loader 
> org.apache.catalina.loader.ParallelWebappClassLoader
> @2ccca26f; jakarta.servlet.Servlet is in unnamed module of loader 
> java.net.URLClassLoader @63e2203c)
>
> Thanks,
>
> Lance
>


Issue Migrating servlets to 10.1

2023-11-21 Thread Campbell, Lance
I am migrating from Java 8 tomcat 9 to Java 11 tomcat 10.1 .

I am getting a cast class exception when trying to access my login servlet. In 
my servlets I am using these packages:


import javax.servlet.ServletException;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;


  1.  Does either Java 11 or Tomcat 10.1 require that I use Jakarta.servlet.* 
packages instead of javax.servlet.*?
  2.  If that is the case, then what is specifically requiring this? Is it Java 
11 or Tomcat 10.1 or both?

My servlet is getting this error:

21-Nov-2023 14:14:52.768 INFO [main] 
org.apache.catalina.core.ApplicationContext.log Marking servlet [LoginServlet] 
as unavailable
21-Nov-2023 14:14:52.769 SEVERE [main] 
org.apache.catalina.core.StandardContext.loadOnStartup Servlet [LoginServlet] 
in web application [] threw load() exception
java.lang.ClassCastException: class xyz.servlet.LoginServlet cannot be 
cast to class jakarta.servlet.Servlet
(xyz.servlet.LoginServlet is in unnamed module of loader 
org.apache.catalina.loader.ParallelWebappClassLoader
@2ccca26f; jakarta.servlet.Servlet is in unnamed module of loader 
java.net.URLClassLoader @63e2203c)

Thanks,

Lance


Web.xml file question

2023-11-21 Thread Campbell, Lance
Tomcat 10.1
Java migration from 8 to 11
Eclipse

I am trying to migrate my thirteen tomcat web applications from java 8 to java 
11. And from tomcat 9 to tomcat 10.1 .

I have been using the web.xml file for years with Java 8 and tomcat 9. However, 
when I built my dynamic web application with eclipse I don't see a web.xml 
file. I looked at the example web application in the tomcat 10.1 download. Is 
the below top part of the web.xml file appropriate for java 11 running 10.1


https://jakarta.ee/xml/ns/jakartaee

  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance

  xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee

  https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd;

  version="6.0"

  metadata-complete="true">

Thanks,

Lance


Tomcat dedicated server

2022-01-19 Thread Campbell, Lance
On a Tomcat 9.x dedicated Linux server with 16G of memory, how much memory 
would you allocate for the OS?

Assume there is no file processing taking place.  Also assume Tomcat is 
communicating primarily with a PostgreSQL database and Apache web server each 
running on their own dedicated servers.  The Tomcat application server is the 
only thing running on the Linux server.

Thanks,

Lance


Performance Tuning Tomcat 9

2022-01-13 Thread Campbell, Lance
For Tomcat 9.x is there a particular website you have found to be helpful for 
performance tuning Tomcat 9?

Thanks,

Lance


Tomcat 9 Catalina Logging issue

2020-08-03 Thread Campbell, Lance
Apache Tomcat Version 9.0.37

I just upgraded to this version.  When I start tomcat sometimes it generates a 
“logs/catalina.out” file and other times it does not.  What is going on? Is 
anyone else having this issue?

I always get a catalina.2020-08-03.log .  However, it is lacking all of my 
startup info that is in the catalina.out file.

Any help on identifying this issue would be most appreciated.

Thanks,


LANCE CAMPBELL
Software Architect

Web Services
Public Affairs
Contact the Webtools Team
217.333.0382
la...@illinois.edu


[/var/folders/wp/1f6l7hw95y718z976kgnl5f9kr5rtc/T/com.microsoft.Outlook/WebArchiveCopyPasteTempFiles/signature_logo.png]

Under the Illinois Freedom of Information Act any written communication to or 
from university employees regarding university business is a public record and 
may be subject to public disclosure.



Re: Tomcat Upgrade Issue from 9.0.30 to 9.0.31

2020-04-23 Thread Campbell, Lance
That was it.  I lost an entire day on that.  I greatly appreciate your time!

Lance

On 4/23/20, 1:30 PM, "Mark Thomas"  wrote:

On 23/04/2020 18:57, Campbell, Lance wrote:
> I am upgrading from Tomcat 9.0.30 to 9.0.31 . This same issue occurs
> with any newer version of Tomcat as well. I have been using Tomcat since
> the earliest version.  I have never had an issue with upgrading or
> installing until now.
> 
> I have a Apache web server with mod_jk and mod_shib.  I have a separate
> tomcat application server.  When I upgraded from 9.0.30 to 9.0.31
> Shibboleth secured tomcat web pages will not work.  Non Shibboleth pages
> work fine.  If I revert tomcat to 9.0.30 it works fine.  I have a
> feeling that there is something new between these two versions that is
> preventing the passing of shibboleth information.
> 
> When I go to a web page that is protected by Shibboleth I get a *HTTP
> Status 403 – Forbidden.*
> 
> In Shibboleth I see no errors.
> 
> Tomcat does not appear to be able to get the page request.
> 
> I see the error in the apache web server log when it tries to send the
> request to the Shibboleth IDP.
> 
> What am I missing?  I would imagine other people have had this issue.

I'm guessing that Shibboleth passes information from httpd to Tomcat via
request attributes. Part of the tightening up of security as a result of
CVE-2020-1938 was restricting the acceptable request attributes.

See allowedRequestAttributesPattern in


http://tomcat.apache.org/tomcat-9.0-doc/config/ajp.html#Standard_Implementations

The quick and dirty test is to set allowedRequestAttributesPattern=".*"
for your AJP connector and see if that fixes it.

If it does, you need to find out what request attributes Shibboleth is
setting and then create a pattern to allow them (the pattern only needs
to match the extra ones, the standard ones are always allowed through).

We don't currently log the problematic attributes. Enabling debug
logging for mod_jk should allow you to figure out the request names if
the Shibboleth documentation doesn't document them.

Mark

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





Tomcat Upgrade Issue from 9.0.30 to 9.0.31

2020-04-23 Thread Campbell, Lance
I am upgrading from Tomcat 9.0.30 to 9.0.31 . This same issue occurs with any 
newer version of Tomcat as well. I have been using Tomcat since the earliest 
version.  I have never had an issue with upgrading or installing until now.

I have a Apache web server with mod_jk and mod_shib.  I have a separate tomcat 
application server.  When I upgraded from 9.0.30 to 9.0.31 Shibboleth secured 
tomcat web pages will not work.  Non Shibboleth pages work fine.  If I revert 
tomcat to 9.0.30 it works fine.  I have a feeling that there is something new 
between these two versions that is preventing the passing of shibboleth 
information.

When I go to a web page that is protected by Shibboleth I get a HTTP Status 403 
– Forbidden.

In Shibboleth I see no errors.
Tomcat does not appear to be able to get the page request.
I see the error in the apache web server log when it tries to send the request 
to the Shibboleth IDP.

What am I missing?  I would imagine other people have had this issue.

Thanks,

LANCE CAMPBELL
Software Architect

Web Services
Public Affairs
Contact the Webtools Team
217.333.0382
la...@illinois.edu


[/var/folders/wp/1f6l7hw95y718z976kgnl5f9kr5rtc/T/com.microsoft.Outlook/WebArchiveCopyPasteTempFiles/signature_logo.png]

Under the Illinois Freedom of Information Act any written communication to or 
from university employees regarding university business is a public record and 
may be subject to public disclosure.



Re: Roadmap for Tomcat and Jakarta EE

2019-11-05 Thread Campbell, Lance
Thanks.

On 11/5/19, 1:33 PM, "Rémy Maucherat"  wrote:

On Tue, Nov 5, 2019 at 8:19 PM Campbell, Lance  wrote:

> Is there an article describing a general roadmap for Tomcat and Jakarta EE
> that I could read?
>

http://tomcat.apache.org/presentations.html
The latest "State of the Cat" presentation from ApacheCon EU looks into the
Jakarta stuff.

Rémy


>
>
> Thanks,
>
>
>
> *LANCE CAMPBELL <https://directory.illinois.edu/person/lance>*
>
> *Software Architect*
>
>
>
> Web Services <https://webtools.illinois.edu/>
>
> Public Affairs <https://publicaffairs.illinois.edu/>
>
> Contact the Webtools Team <https://go.illinois.edu/contactUs>
>
> 217.333.0382
>
> la...@illinois.edu
>
>
>
>
>
> [image:
> 
/var/folders/wp/1f6l7hw95y718z976kgnl5f9kr5rtc/T/com.microsoft.Outlook/WebArchiveCopyPasteTempFiles/signature_logo.png]
> <http://illinois.edu/>
>
>
>
> *Under the Illinois Freedom of Information Act any written communication
> to or from university employees regarding university business is a public
> record and may be subject to public disclosure.*
>
>
>




Roadmap for Tomcat and Jakarta EE

2019-11-05 Thread Campbell, Lance
Is there an article describing a general roadmap for Tomcat and Jakarta EE that 
I could read?

Thanks,

LANCE CAMPBELL
Software Architect

Web Services
Public Affairs
Contact the Webtools Team
217.333.0382
la...@illinois.edu


[/var/folders/wp/1f6l7hw95y718z976kgnl5f9kr5rtc/T/com.microsoft.Outlook/WebArchiveCopyPasteTempFiles/signature_logo.png]

Under the Illinois Freedom of Information Act any written communication to or 
from university employees regarding university business is a public record and 
may be subject to public disclosure.



Re: How to display the current In-Use Stack Size

2019-03-04 Thread Campbell, Lance
I have seen those as well.  I was hoping someone knew if there was a way to 
view the Java Stack in particular.

On 3/4/19, 11:16 AM, "John Dale"  wrote:

I found this in some old code .. not sure if it works.  Let me know.

//Getting the runtime reference from system
Runtime runtime = Runtime.getRuntime();

//Print used memory
out.println("Used Memory: "
+ ((runtime.totalMemory() - runtime.freeMemory()) / mb) + 
"MB");
out.println("");

//Print free memory
out.println("Free Memory: "
+ (runtime.freeMemory() / mb) + "MB");
out.println("");

//Print total available memory
out.println("Total Memory: " + (runtime.totalMemory() / mb) + 
"MB");
out.println("");

//Print Maximum available memory
out.println("Max Memory: " + (runtime.maxMemory() / mb) + "MB");
out.println("");

On 3/4/19, Campbell, Lance  wrote:
> Tomcat 9.x
> What is the easiest way to identify how much memory Tomcat/Java is 
currently
> using from the Java stack -Xss ?  Not max but currently being used.
>
> Is there a particular statement I can put into a servlet to see what the
> current memory usage is of the stack?
>
> Thanks,
>
> Lance
>

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





How to display the current In-Use Stack Size

2019-03-04 Thread Campbell, Lance
Tomcat 9.x
What is the easiest way to identify how much memory Tomcat/Java is currently 
using from the Java stack -Xss ?  Not max but currently being used.

Is there a particular statement I can put into a servlet to see what the 
current memory usage is of the stack?

Thanks,

Lance


Re: Tomcat Valve

2018-08-24 Thread Campbell, Lance
I don't understand.  How does that help a valve running know that it is 
shutting down?  At that point it would be too late.  

On 8/24/18, 11:06 AM, "Mark Thomas"  wrote:

On 24/08/18 16:52, Campbell, Lance wrote:
> Tomcat 9
> Use Case 1:  I want to store the last N number of URLs sent to Tomcat 9 
application.  Then if Tomcat shuts down I want to write out these last N number 
of URLs to the log file.
> 
> Strategy:
> I figured I would use a valve to keep track of the last N number of URLs. 
 However I don’t know how to tell when the valve is shutting down.
> 
> Does anyone have any suggestions?

tail -n 9 ${CATALINA_BASE}/logs/localhost_access_log.-mm-dd.txt

Mark

-
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



Tomcat Valve

2018-08-24 Thread Campbell, Lance
Tomcat 9
Use Case 1:  I want to store the last N number of URLs sent to Tomcat 9 
application.  Then if Tomcat shuts down I want to write out these last N number 
of URLs to the log file.

Strategy:
I figured I would use a valve to keep track of the last N number of URLs.  
However I don’t know how to tell when the valve is shutting down.

Does anyone have any suggestions?

Thanks,

Lance


deallocated URLs during shutdown

2018-08-11 Thread Campbell, Lance
Tomcat 9.0.10

I got the below error during a shutdown of tomcat 9.  Tomcat would not stop.  
It hung during shutdown.  Is there a better way for me to get it to shutdown?  
Is there a way I could get the below deallocated servlet URLs during a 
shutdown?  Could I add some type of listener that would display the URLs in the 
log output?



ERROR:

11-Aug-2018 14:29:02.308 INFO [main] 
org.apache.catalina.core.StandardServer.await A valid shutdown command was 
received via the shutdown port. Stopping the Server instance.

11-Aug-2018 14:29:02.309 INFO [main] org.apache.coyote.AbstractProtocol.pause 
Pausing ProtocolHandler ["ajp-nio-8019"]

11-Aug-2018 14:29:02.361 INFO [main] 
org.apache.catalina.core.StandardService.stopInternal Stopping service 
[Catalina]

11-Aug-2018 14:29:02.363 INFO [main] 
org.apache.catalina.core.StandardWrapper.unload Waiting for [46] instance(s) to 
be deallocated for Servlet [View]

11-Aug-2018 14:29:03.364 INFO [main] 
org.apache.catalina.core.StandardWrapper.unload Waiting for [46] instance(s) to 
be deallocated for Servlet [View]

11-Aug-2018 14:29:04.366 INFO [main] 
org.apache.catalina.core.StandardWrapper.unload Waiting for [46] instance(s) to 
be deallocated for Servlet [View]

Thanks,

Lance


Using CentOS 7 logrotate

2017-12-19 Thread Campbell, Lance
Tomcat 8.0.x
CentOS 7
1) Is there a way to tell tomcat to put the logs for a running instance into 
/var/log/{somefoldername}/ .

2) Then have CentOS 7 logrotate take care of the rotation of the files?

Thanks,

Lance


RE: run thread from servlet

2017-07-19 Thread Campbell, Lance
Chris,
Thanks for your information.  So when I have a process that I want to run as a 
thread I would assume I need to implement the interface ServletContextListener. 
  I would also assume that the servlet that creates the process will call the 
following method:

this.getServletContext().addListener(myProcess)

That way the Tomcat container can send a message to myProcess to tell it to end 
itself because Tomcat is trying to stop.

Did I understand that correctly?

Thanks,

Lance

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Tuesday, July 18, 2017 4:30 PM
To: users@tomcat.apache.org
Subject: Re: run thread from servlet

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Lance,

On 7/18/17 9:56 AM, Campbell, Lance wrote:
> Tomcat 8.0.x Question: I am wanting to know the proper way to start a 
> thread from a servlet.
> 
> Use Case: A batch process will call a URL that is a servlet.  The 
> servlet will call a processes that will trigger a thread to run to do 
> a particular job.  The thread will run for a while.  The servlet will 
> not wait on the thread to finish running.  Also the thread that is 
> started is running a processes that requires there to only be one of 
> these processes running at any given time.
> 
> What I have done: I created a class I call EmailProcess.  I have a 
> static Boolean flag in the class called isWorking that indicates if 
> the process is running.  The class extends Runnable.  The class also 
> has a static method to start the thread if isWorking flag is false.  I 
> have a servlet that will call the static method in EmailProcess to 
> start the thread if possible.
> 
> Note: If the Tomcat container decides to clean up the servlet that is 
> called that triggers the thread I don't want it to mess with the 
> thread.  I want it to keep on running.

You want an ExecutorService (provided by the Java standard library), and you 
can limit the number of simultaneous jobs to 1. Submit the jobs to the service 
as they arrive, and then make sure you call
service.shutdown() when the servlet (or better yet, context) is being taken out 
of service. You might want to provide a way to cancel in-process jobs, 
otherwise you may stall container shutdown which might be inconvenient for you.

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

iQIcBAEBCAAGBQJZbn3uAAoJEBzwKT+lPKRYCTUP/1Ho+5z49FntCBrEevVxnYiO
He331XbbPN7x6XLzO8nqf82pZcjnH1DGPtZXhPdZ2DKOjqPKmSeoI3az1+s1gu6X
Igff6xoHpARdyWdVElIxHYO93QOJdIa0DtuaSgaO4HXwpZYgwxs/QwbuN9VWLK5f
4afXp0gE5VaUxZoLHb9TTVIV8t0IABXdq+m9tuKZtrihfVwyc79w0HTwDCzqHlYH
39p70KQEagzhj/ZNqUHZENvFZ+2vMHD8zGcnWtAoVzOaseNth0FtZY5aqO+2WThl
k1VpcCGIK6hsytcBXuYAtfp/H6o2ircpwa66+O1nbNuP3OLT9x4IHqe5I0KoG/zG
hPOA/ydauaTps4xoYVLPjIVfVLx4D3+Rcrsti2tlo80hRK4Mv3SEeZu5eH1Zxz/N
W1MSLrVa5QOdWQ1rLMUbfWyNFXbm3xT8DrlQ3WvsAlMsRCrHkBIPqihnN7cPdRKp
m7QsQGYk/QNJ4U45ZeF/n5e/P62Dw34dHEbsefXNozvAOzykRSmwSG+6guCVXiiL
tfxC72zOiPxHUFMO8+mfXUrbsODNUjAUQA8O5dphwHGkTIni9xAL3/38dxkyaVy3
1jU2CFGaou5rdvjeL/Ixwqs4LzsY4Li0DrA5MwJVjEJG62MGK9x65NcpQ/3AtvZ4
T6lRQ5ZjJH99h9b2/ijL
=SVOd
-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: run thread from servlet

2017-07-18 Thread Campbell, Lance
Also if tomcat is shut down and a thread is running how does tomcat communicate 
with my software to end a thread?  Is this where you were referring to the 
servlet context listener? 

-Original Message-
From: Campbell, Lance [mailto:la...@illinois.edu] 
Sent: Tuesday, July 18, 2017 12:00 PM
To: Tomcat Users List <users@tomcat.apache.org>
Subject: RE: run thread from servlet

Basically I have batch jobs that I need to run on many different web 
applications.  The batch jobs call servlets that then create threads to do 
whatever task I need done behind the scenes.  The servlets immediately return a 
message after starting the batch threaded job.However my understanding is 
that there can be issues with Tomcat detecting memory leaks if you have a 
thread spawned by a servlet.  So I was wondering if there was a better way to 
trigger a thread.  

-Original Message-
From: Pradip Bhattacharya [mailto:pradip.bhattacha...@gmail.com] 
Sent: Tuesday, July 18, 2017 9:10 AM
To: Tomcat Users List <users@tomcat.apache.org>
Subject: Re: run thread from servlet

Hello,
I hope I understood the requirement correctly. I believe you can start 
EmailProcess thread by the context listener. This thread can wait on an object. 
And the servlet can enque the data in a concurrent queue, and then notify the 
object, on which EmailProcess thread is waiting.
Is this EmailProcess is an asynchronous service to send emails ?
Regards
Pradip.B

On Jul 18, 2017 7:27 PM, "Campbell, Lance" <la...@illinois.edu> wrote:

Tomcat 8.0.x
Question:
I am wanting to know the proper way to start a thread from a servlet.

Use Case:
A batch process will call a URL that is a servlet.  The servlet will call a 
processes that will trigger a thread to run to do a particular job.  The thread 
will run for a while.  The servlet will not wait on the thread to finish 
running.  Also the thread that is started is running a processes that requires 
there to only be one of these processes running at any given time.

What I have done:
I created a class I call EmailProcess.  I have a static Boolean flag in the 
class called isWorking that indicates if the process is running.  The class 
extends Runnable.  The class also has a static method to start the thread if 
isWorking flag is false.  I have a servlet that will call the static method in 
EmailProcess to start the thread if possible.

Note: If the Tomcat container decides to clean up the servlet that is called 
that triggers the thread I don't want it to mess with the thread.  I want it to 
keep on running.

Thanks for your advice.

Lance


RE: run thread from servlet

2017-07-18 Thread Campbell, Lance
Basically I have batch jobs that I need to run on many different web 
applications.  The batch jobs call servlets that then create threads to do 
whatever task I need done behind the scenes.  The servlets immediately return a 
message after starting the batch threaded job.However my understanding is 
that there can be issues with Tomcat detecting memory leaks if you have a 
thread spawned by a servlet.  So I was wondering if there was a better way to 
trigger a thread.  

-Original Message-
From: Pradip Bhattacharya [mailto:pradip.bhattacha...@gmail.com] 
Sent: Tuesday, July 18, 2017 9:10 AM
To: Tomcat Users List <users@tomcat.apache.org>
Subject: Re: run thread from servlet

Hello,
I hope I understood the requirement correctly. I believe you can start 
EmailProcess thread by the context listener. This thread can wait on an object. 
And the servlet can enque the data in a concurrent queue, and then notify the 
object, on which EmailProcess thread is waiting.
Is this EmailProcess is an asynchronous service to send emails ?
Regards
Pradip.B

On Jul 18, 2017 7:27 PM, "Campbell, Lance" <la...@illinois.edu> wrote:

Tomcat 8.0.x
Question:
I am wanting to know the proper way to start a thread from a servlet.

Use Case:
A batch process will call a URL that is a servlet.  The servlet will call a 
processes that will trigger a thread to run to do a particular job.  The thread 
will run for a while.  The servlet will not wait on the thread to finish 
running.  Also the thread that is started is running a processes that requires 
there to only be one of these processes running at any given time.

What I have done:
I created a class I call EmailProcess.  I have a static Boolean flag in the 
class called isWorking that indicates if the process is running.  The class 
extends Runnable.  The class also has a static method to start the thread if 
isWorking flag is false.  I have a servlet that will call the static method in 
EmailProcess to start the thread if possible.

Note: If the Tomcat container decides to clean up the servlet that is called 
that triggers the thread I don't want it to mess with the thread.  I want it to 
keep on running.

Thanks for your advice.

Lance


run thread from servlet

2017-07-18 Thread Campbell, Lance
Tomcat 8.0.x
Question:
I am wanting to know the proper way to start a thread from a servlet.

Use Case:
A batch process will call a URL that is a servlet.  The servlet will call a 
processes that will trigger a thread to run to do a particular job.  The thread 
will run for a while.  The servlet will not wait on the thread to finish 
running.  Also the thread that is started is running a processes that requires 
there to only be one of these processes running at any given time.

What I have done:
I created a class I call EmailProcess.  I have a static Boolean flag in the 
class called isWorking that indicates if the process is running.  The class 
extends Runnable.  The class also has a static method to start the thread if 
isWorking flag is false.  I have a servlet that will call the static method in 
EmailProcess to start the thread if possible.

Note: If the Tomcat container decides to clean up the servlet that is called 
that triggers the thread I don't want it to mess with the thread.  I want it to 
keep on running.

Thanks for your advice.

Lance



Database Session Manager

2017-06-21 Thread Campbell, Lance
Tomcat 8, 8.5, or 9
Is there a session manager for Tomcat that does not keep sessions in memory at 
all but stores the session attributes in a database?

Example:  If I create a session for the first time then the session manager 
would create a session ID and write it to a database table.  Now if you do 
setAttribute on the session it would then insert a row in the database based on 
the session ID and name of the attribute.  It would not delay.  It would write 
it at that moment.  If you do a getAttribute it would then select the value 
from the database based on the session ID and name.  At no time is a session 
object kept in memory by the session manager.

The other element is that if I have N number of tomcat instances that run 
behind a load balancer any one of them can receive an incoming request.  There 
is no communication that has to occur between tomcat instances.

I looked over the Tomcat JDBCStore.  But it looks like it still maintains 
sessions in memory for a time before writing them.  I would like an 
implementation that never keeps them in memory.  Direct writing and direct 
reading when a session does a setAttribute or getAttribute.

Is this even possible to do?  My feeling is that the Manager might have some 
fields that never do anything.  I don't want to create something that someone 
else has already done.

If this is able to be done and it has not been developed before I would be 
happy to do it if someone wants to give me some basic starting information on 
how to do this.  I would be happy to share it with the community.

Thanks,

Lance



how to write a valve

2016-10-13 Thread Campbell, Lance
Tomcat 8.0.38

In my Eclipse development environment when particular servlet requests are made 
I want to simulate going through Shibboleth prior to Tomcat handling the 
request.  I wanted to see if this will work.

In Eclipse within each dynamic web application I would add a valve to the 
context.xml file.

The valve would:

1)  Check the URL request.

2)  If the URL string matches a list then it will add particular name value 
pairs to the request.

Example of a possible valve:




1)  Can a valve actually identify a particular URL path?

2)  Can a valve add an attribute to the request prior to the servlet 
getting the request?

3)  If item #1 and #2 will work does anyone have some base code for a value 
that would get me started down the correct path?

Thanks for all of your help.

Lance Campbell
Web Services
University of Illinois


Re: mod JK ho to rout all content to tomcat except for a few static folders

2016-06-21 Thread Campbell, Lance
I am so sorry.  You are correct.  

Lance

Sent from my iPhone

> On Jun 20, 2016, at 12:13 PM, Rainer Jung <rainer.j...@kippdata.de> wrote:
> 
>> Am 20.06.2016 um 18:32 schrieb Campbell, Lance:
>> Neither of these options will work for me:
>> 1) no-jk is only supported for: "Starting with mod_jk 1.2.6 for Apache 2.x 
>> and 1.2.19 for Apache 1.3"
> 
> So? You wrote your versions are
> 
> Apache 2.2.15
> mod_jk  1.2.41
> 
> and isn't 1.2.41 >= 1.2.6? So the no-jk feature is supported. Why do you 
> think it is not?
> 
>> 2) The urls that get sent to Tomcat are unkown.  This is a dynamic content 
>> driven site.
> 
> 1) and 2) both work once you know which URIs you want to exclude form 
> forwarding. You wrote "except for three directories that contain static 
> content" so I guess you are able to describe those URIs to exclude e.g. by 
> one to three URI prefixes?
> 
> The examples Anthony gave are correct, so if your URIs to exclude start e.g. 
> with /img/, /css/ and /static/, you could either
> 
> JkUnMount /img/* *
> JkUnMount /css/* *
> JkUnMount /static/* *
> 
> or
> 
> SetEnvIf Request_URI "/img/*" no-jk
> SetEnvIf Request_URI "/css/*" no-jk
> SetEnvIf Request_URI "/static/*" no-jk
> 
> I slightly prefer the JkUnMount way, because it is a bit easier to 
> read/understand if you put it close to your JkMount in the config file. The 
> second way is convenient if the exclusion rules get more complex, because you 
> can do tricky stuff with environment variables (no-jk).
> 
> Regards,
> 
> Rainer
> 
>> -Original Message-
>> From: Anthony Biacco [mailto:abia...@handll.com]
>> Sent: Monday, June 20, 2016 10:29 AM
>> To: Tomcat Users List <users@tomcat.apache.org>
>> Subject: Re: mod JK ho to rout all content to tomcat except for a few static 
>> folders
>> 
>>> On Mon, Jun 20, 2016 at 9:14 AM, Campbell, Lance <la...@illinois.edu> wrote:
>>> 
>>> These are the versions of software I have to use.  I cannot install
>>> other
>>> software:
>>> 
>>> 
>>> 
>>> Apache 2.2.15
>>> 
>>> mod_jk  1.2.41
>>> 
>>> Tomcat 8.0.36
>>> 
>>> 
>>> 
>>> Issue:
>>> 
>>> We are looking at having a domain where all content will get routed to
>>> Tomcat 8 except for three directories that contain static content.
>>> These three directories will be served up by Apache.  Based on the
>>> above versions how can I tell Apache to handle just these three
>>> directories and then send all other content requests to Tomcat?
>> should be able to use either of:
>> 
>> JkUnMount /URI/* worker
>> 
>> SetEnvIf Request_URI "/URI/*" no-jk
>> 
>> 
>> -Tony
> 
> -
> 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: mod JK ho to rout all content to tomcat except for a few static folders

2016-06-20 Thread Campbell, Lance
Neither of these options will work for me:
1) no-jk is only supported for: "Starting with mod_jk 1.2.6 for Apache 2.x and 
1.2.19 for Apache 1.3"
2) The urls that get sent to Tomcat are unkown.  This is a dynamic content 
driven site.  

Any other options.

Thanks,

Lance

-Original Message-
From: Anthony Biacco [mailto:abia...@handll.com] 
Sent: Monday, June 20, 2016 10:29 AM
To: Tomcat Users List <users@tomcat.apache.org>
Subject: Re: mod JK ho to rout all content to tomcat except for a few static 
folders

On Mon, Jun 20, 2016 at 9:14 AM, Campbell, Lance <la...@illinois.edu> wrote:

> These are the versions of software I have to use.  I cannot install 
> other
> software:
>
>
>
> Apache 2.2.15
>
> mod_jk  1.2.41
>
> Tomcat 8.0.36
>
>
>
> Issue:
>
> We are looking at having a domain where all content will get routed to 
> Tomcat 8 except for three directories that contain static content.  
> These three directories will be served up by Apache.  Based on the 
> above versions how can I tell Apache to handle just these three 
> directories and then send all other content requests to Tomcat?
>
>
>
>
>
should be able to use either of:

JkUnMount /URI/* worker

SetEnvIf Request_URI "/URI/*" no-jk


-Tony

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



mod JK ho to rout all content to tomcat except for a few static folders

2016-06-20 Thread Campbell, Lance
These are the versions of software I have to use.  I cannot install other 
software:



Apache 2.2.15

mod_jk  1.2.41

Tomcat 8.0.36



Issue:

We are looking at having a domain where all content will get routed to Tomcat 8 
except for three directories that contain static content.  These three 
directories will be served up by Apache.  Based on the above versions how can I 
tell Apache to handle just these three directories and then send all other 
content requests to Tomcat?



Example Apache configuration.  This is obviously made up.  It is just for the 
sake of providing a visual starting point:





  ServerName someserver.com

  DocumentRoot /www/testxxx/htdocs



  

  Options Indexes MultiViews

  AllowOverride None

  Order allow,deny

  Allow from all

  



  

  Options Indexes MultiViews

  AllowOverride None

  Order allow,deny

  Allow from all

  



  

  Options Indexes MultiViews

  AllowOverride None

  Order allow,deny

  Allow from all

  



  JkMount /* mytomcatapplication



  













proper web application logging

2016-05-24 Thread Campbell, Lance
Tomcat 8.0.35

The below question is not about logging Tomcat internal activity.  This is 
about logging web applications running within Tomcat.

I have been using tomcat forever.  I have been manually adding the Log4J 1.2 
JAR file into my web application.  Then using Log4J for web application 
logging.  I have been thinking about upgrading from Log4J 1.2 to Log4J 2.2 .  
The more reading I do the more I am concerned about other JAR files and Tomcat 
itself getting confused if I make the change to 2.2.

Then it hit me.  Maybe I have been doing this all wrong to start with.  Maybe I 
should see if I could have my software somehow use whatever the default Tomcat 
8.0.35 logging mechanism is.  Then I could avoid this issue completely.

Questions:

1)  Is there a preferred way to log web applications from within Tomcat 8?

2)  If so could someone recommend a how to web page?

3)  My main two requirements for logging are: be able to set the logging 
level to debug or error and send logging data to a database.

Thanks,

Lance





RE: Tomcat 8 disable parts

2016-05-20 Thread Campbell, Lance
Thanks for all of the posts.  The one about using Tomcat 3.3 was great.

I will just keep using the defaults.  A few MB here or there is not a big 
concern to me.

Thanks for all of the great input.

Lance

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Friday, May 20, 2016 9:04 AM
To: Tomcat Users List <users@tomcat.apache.org>
Subject: Re: Tomcat 8 disable parts

Lance,

On 5/20/16 9:41 AM, Campbell, Lance wrote:
> I love Tomcat.  I have been using it before it was Tomcat.  Thanks for 
> the great work!
> 
> Our group only uses Tomcat with Apache for serving up content through 
> servlets.  We never use JSPs, tag libs, etc.  I know Tomcat is taking 
> on a lot more capabilities.  Is there a way to disable or maybe tell 
> Tomcat that we don't use anything other than just Servlets?  I did not 
> know if doing this might help load/startup time.
> Or maybe it would make for a smaller footer print or better 
> performance.

If you aren't using JSP, you can de-configure the JspServlet in 
conf/context.xml (note this will disable JSP across all applications deployed 
in Tomcat, not just one application). But the JspServlet isn't really taking up 
much in the way of resources when it's never being used. I'm not sure you would 
be able to see any difference in heap usage if you de-configured that.

If you disable much of the JAR-scanning, you may be able to save some heap if 
you never use any of the auto-configuring resources, etc.

But Tomcat is quite lean-and-mean in its default configuration. Last time I 
checked, it takes about 12MiB of heap to run Tomcat with nothing but a trivial 
ROOT application deployed.

Is there anything in particular that you are trying to reduce?

-chris

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



Tomcat 8 disable parts

2016-05-20 Thread Campbell, Lance
Tomcat 8.0.35
I love Tomcat.  I have been using it before it was Tomcat.  Thanks for the 
great work!

Our group only uses Tomcat with Apache for serving up content through servlets. 
 We never use JSPs, tag libs, etc.  I know Tomcat is taking on a lot more 
capabilities.  Is there a way to disable or maybe tell Tomcat that we don't use 
anything other than just Servlets?  I did not know if doing this might help 
load/startup time.  Or maybe it would make for a smaller footer print or better 
performance.

Just thought I would ask.

Thanks for the great work.

Lance Campbell
Web Services @ University of Illinois


AccessLogValve - add a suffix to log file on rotation

2015-02-22 Thread Campbell, Lance
Tomcat 8.x
Valve: org.apache.catalina.valves.AccessLogValve

When all of my log files rotate I like to add the suffix .old.  This is so 
that if there is an issue with file sizes I can very quickly delete all old log 
files by doing:

rm *.old

Using the above AccessLogValve how can I append .old to the end of the file 
name when it rotates?


Thanks,

Lance Campbellhttp://illinois.edu/person/lance
Software Architect
Web Services at Public Affairs
217-333-0382
[University of Illinois at Urbana-Champaign logo]http://illinois.edu/




RE: AccessLogValve - add a suffix to log file on rotation

2015-02-22 Thread Campbell, Lance
Thanks


Thanks,

Lance Campbell
Software Architect
Web Services at Public Affairs
217-333-0382 



-Original Message-
From: Rainer Jung [mailto:rainer.j...@kippdata.de] 
Sent: Sunday, February 22, 2015 12:09 PM
To: Tomcat Users List
Subject: Re: AccessLogValve - add a suffix to log file on rotation

Am 22.02.2015 um 17:12 schrieb Campbell, Lance:
 Tomcat 8.x

 Valve: org.apache.catalina.valves.AccessLogValve

 When all of my log files rotate I like to add the suffix “.old”.  This 
 is so that if there is an issue with file sizes I can very quickly 
 delete all old log files by doing:

 rm *.old

 Using the above AccessLogValve how can I append “.old” to the end of 
 the file name when it rotates?

Try:

renameOnRotate=true fileDateFormat=.-MM-dd.old

and no suffix attribute.

See:

http://tomcat.apache.org/tomcat-8.0-doc/config/valve.html#Access_Log_Valve

Regards,

Rainer

-
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



How do you catch these exceptions

2014-10-31 Thread Campbell, Lance
Tomcat 7.0.56
Java 7.0_72

I received the below Tomcat error messages in a web application.  Is there a 
way for me to catch these exceptions so that I can then either execute Java 
code or trigger a Linux shell script?

Oct 31, 2014 7:38:25 PM org.apache.tomcat.util.net.NioEndpoint$SocketProcessor 
doRun
SEVERE:
java.lang.OutOfMemoryError: Java heap space

Oct 31, 2014 7:38:46 PM org.apache.tomcat.util.net.NioEndpoint$Acceptor run
SEVERE:
java.lang.OutOfMemoryError: Java heap space

Oct 31, 2014 7:38:49 PM org.apache.tomcat.util.net.NioEndpoint$Poller run


Thanks,

Lance Campbellhttp://illinois.edu/person/lance
Software Architect
Web Services at Public Affairs
217-333-0382
[University of Illinois at Urbana-Champaign logo]http://illinois.edu/




Programmatically retrieve number of tomcat connections

2014-07-31 Thread Campbell, Lance
Tomcat 7
Is there a way via a Java servlet to get the number of tomcat connections?


Thanks,

Lance Campbellhttp://illinois.edu/person/lance
Software Architect
Web Services at Public Affairs
217-333-0382
[University of Illinois at Urbana-Champaign logo]http://illinois.edu/




RE: Programmatically retrieve number of tomcat connections

2014-07-31 Thread Campbell, Lance
Good question.  I would like to have a servlet that would return to me the 
number of tomcat HTTP connections.  I know you can do this via a Linux console 
command.  But I would prefer to do it via a servlet.


Thanks,

Lance Campbell
Software Architect
Web Services at Public Affairs
217-333-0382 



-Original Message-
From: Mark Thomas [mailto:ma...@apache.org] 
Sent: Thursday, July 31, 2014 11:10 AM
To: Tomcat Users List
Subject: Re: Programmatically retrieve number of tomcat connections

On 31/07/2014 17:06, Campbell, Lance wrote:
 Tomcat 7
 
 Is there a way via a Java servlet to get the number of tomcat connections?

Connections from what to what in what state?

With or without non-Servlet API calls?

Mark


-
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: Programmatically retrieve number of tomcat connections

2014-07-31 Thread Campbell, Lance
Could you elaborate a little?  How do you actually get the number of HTTP 
connections?


Thanks,

Lance Campbell
Software Architect
Web Services at Public Affairs
217-333-0382 




-Original Message-
From: Igal Sapir [mailto:i...@getrailo.org] 
Sent: Thursday, July 31, 2014 11:35 AM
To: Tomcat Users List
Subject: RE: Programmatically retrieve number of tomcat connections

Write a simple ServletFilter
 On Jul 31, 2014 9:33 AM, Campbell, Lance la...@illinois.edu wrote:

 Good question.  I would like to have a servlet that would return to me 
 the number of tomcat HTTP connections.  I know you can do this via a 
 Linux console command.  But I would prefer to do it via a servlet.


 Thanks,

 Lance Campbell
 Software Architect
 Web Services at Public Affairs
 217-333-0382



 -Original Message-
 From: Mark Thomas [mailto:ma...@apache.org]
 Sent: Thursday, July 31, 2014 11:10 AM
 To: Tomcat Users List
 Subject: Re: Programmatically retrieve number of tomcat connections

 On 31/07/2014 17:06, Campbell, Lance wrote:
  Tomcat 7
 
  Is there a way via a Java servlet to get the number of tomcat
 connections?

 Connections from what to what in what state?

 With or without non-Servlet API calls?

 Mark


 -
 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




Tomcat 7.0.53 no changelog

2014-04-02 Thread Campbell, Lance
Tomcat 7.0.53 does not have a changelog.  The last change log is for Tomcat 
7.0.52 .


Thanks,

Lance Campbellhttp://illinois.edu/person/lance
Software Architect
Web Services at Public Affairs
217-333-0382
[University of Illinois at Urbana-Champaign logo]http://illinois.edu/




Number of AJP connections

2014-02-13 Thread Campbell, Lance
Java 7  Tomcat 7

In a servlet when doing I a RequestDispatcher.forward to another servlet does 
this create a new Tomcat AJP connection or does it reuse the same connection ?
 
 
Thanks,
 
Lance Campbell
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Number of AJP connections

2014-02-13 Thread Campbell, Lance
Thanks a lot.  That was very clear.  I knew the forward caused the 
communication to stay on the same server.  But I was not clear if it 
communicated by calling a class/object or by going through some type of 
connection stream.  That was very helpful.  If it had communicated on the same 
server via a connection stream then that meant the change I made to a servlet 
might need to have additional connections added to the tomcat configuration.  
But since it appears to go from one class/object to another then I won't have 
to change the configuration settings.

Thanks again.

Thanks,

Lance Campbell
Software Architect
Web Services at Public Affairs
217-333-0382 



-Original Message-
From: André Warnier [mailto:a...@ice-sa.com] 
Sent: Thursday, February 13, 2014 8:42 AM
To: Tomcat Users List
Subject: Re: Number of AJP connections

Daniel Mikusa wrote:
 On Feb 13, 2014, at 8:25 AM, Campbell, Lance la...@illinois.edu wrote:
 
 Java 7  Tomcat 7
 
 For future reference, please specify the full version numbers in use.
 
 In a servlet when doing I a RequestDispatcher.forward to another servlet 
 does this create a new Tomcat AJP connection or does it reuse the same 
 connection ?
 
 Forwards a request from a servlet to another resource (servlet, JSP file, or 
 HTML file) on the server.
 
 http://tomcat.apache.org/tomcat-7.0-doc/servletapi/javax/servlet/Reque
 stDispatcher.html#forward(javax.servlet.ServletRequest, 
 javax.servlet.ServletResponse)
 

I think that this does not really answer the OP's question, or maybe not 
clearly.

It is a bit difficult to answer, because in fact it doesn't have anything to do 
with the connection, and yet..

Let's try this :

- It certainly does not create a new connection, be it AJP or otherwise.
- It doesn't re-use the existing connection.  Its is just that the same 
connection continues to exist while this is taking place, and it just continues 
to use it to read request data from, and output response data to.
- It doesn't have anything to do with the Connector through which the 
connection was established.
- It is purely internal to the server, say like ok, I'll use that servlet code 
to respond to the client, instead of this one.




-
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



documentation resource suggestions for scaling tomcat 7 horizontally

2014-02-13 Thread Campbell, Lance
I am looking for free documentation for scaling Tomcat 7 horizontally.  I 
currently have three tomcat 7 application servers load balanced.   The system 
is working good.  I have noticed that my number of connections has increased.  
I was hoping to find an up to date resource guide that would give me 
suggestions on when to add additional nodes.  I know there are a gazillion 
variables to consider.  I am just wanting to get some generalized suggestions.  
I have read on a couple of sites that at about 500 to 750 connections one 
should really consider adding additional nodes.

Thanks,

Lance Campbellhttp://illinois.edu/person/lance
Software Architect
Web Services at Public Affairs
217-333-0382
[University of Illinois at Urbana-Champaign logo]http://illinois.edu/




Servlet RequestDisplatcher.forward

2014-02-10 Thread Campbell, Lance
Java 7  Tomcat 7
In a servlet I am doing a RequestDispatcher.forward to another servlet.  In 
Tomcat 7 I use AJP connectors.  Does this create a new Tomcat AJP connection 
when it does the forward or use the same connection?


Thanks,

Lance Campbellhttp://illinois.edu/person/lance
Software Architect
Web Services at Public Affairs
217-333-0382
[University of Illinois at Urbana-Champaign logo]http://illinois.edu/




New website skin looks great

2013-09-12 Thread Campbell, Lance
WOW!  I love the new design of the tomcat web site.  It looks much more 
professional and refined.  It is also much easier to read.  The prior 
background colors caused the text to run together.   This is so much better.  I 
love the subtle but clear separation and grouping of information.


Thanks,

Lance Campbell
Software Architect
Web Services at Public Affairs
217-333-0382
[University of Illinois at Urbana-Champaign logo]http://illinois.edu/




Too many open files error

2011-08-24 Thread Campbell, Lance
Tomcat 6.0.32
Java 1.6.27
Apache 2.0
RedHat 6.x 64 bit
/proc/sys/fs/file-max = 3233344

We experienced an issue where we were getting the error too many open files 
in tomcat.  The server manager increase the amount of open files to the above.  
But the error kept coming back even after rebooting the server.  Is there a max 
number of connections that tomcat should run within based on the above specs?

The servlet in question that was being hit returned an XML document after doing 
a series of database queries.

Thanks,

Lance


RE: Too many open files error

2011-08-24 Thread Campbell, Lance
The file /etc/security/limits.d is empty.  What would be an example of 
something you would expect to see in there that would relate to changing the 
RMILIT_NFILE value? 

Thanks,  

From: Francis GALIEGUE [f...@one2team.com]
Sent: Wednesday, August 24, 2011 10:24 AM
To: Tomcat Users List
Subject: Re: Too many open files error

On Wed, Aug 24, 2011 at 17:21, Campbell, Lance la...@illinois.edu wrote:
 Tomcat 6.0.32
 Java 1.6.27
 Apache 2.0
 RedHat 6.x 64 bit
 /proc/sys/fs/file-max = 3233344

 We experienced an issue where we were getting the error too many open files 
 in tomcat.  The server manager increase the amount of open files to the 
 above.  But the error kept coming back even after rebooting the server.  Is 
 there a max number of connections that tomcat should run within based on the 
 above specs?

 The servlet in question that was being hit returned an XML document after 
 doing a series of database queries.


file-max is not what you want to modify. It's the user's limit: RMILIT_NFILE.

Look in /etc/security/limits.d. You'll need to restart Tomcat.

--
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

-
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



Outlook 2003and 2010 does not display image when streamed through tomcat

2010-09-22 Thread Campbell, Lance
I am streaming an image through tomcat 6.29.  In a browser the image
looks fine. But in an email in Outlook 2003 and 2010 the image does not
display.  Any thoughts?  

 

System.out.println content:

 

fileSize:80848

contentTypeStr:image/jpeg

 

The file name does have .jpg

 

Code:

 

if (contentTypeStr != null)

  {

resp.setContentType(contentTypeStr);

try

{

File file = new File(filePath);

long fileSize = file.length();

int fileSizeInt = (int)fileSize;

resp.setContentLength(fileSizeInt);

System.out.println(fileSize: + fileSizeInt);

System.out.println(contentTypeStr: +
contentTypeStr);

}

catch(Exception e)

{

}

  }

  //

  InputStream is =
FileAssistant.getInputStream(filePath);

  if (is == null)

  {

resp.sendError(404);

return;

  }

  //

  OutputStream out = resp.getOutputStream();

  try

  {

int data = 0;

while ((data = is.read())  -1)

{

  out.write(data);

}

out.flush();

out.close();  

  }

  catch (Exception e)

  {

  }

 

Thanks,

 

Lance Campbell

Software Architect/DBA/Project Manager

Web Services at Public Affairs

217-333-0382

 



RE: Outlook 2003and 2010 does not display image when streamed through tomcat

2010-09-22 Thread Campbell, Lance
I took the image file that Outlook won't display from Tomcat 6 and
copied it to a public directory on our web server.  I then resent the
email to Outlook using the public web location on apache and it
displayed fine. 

Thanks,

Lance Campbell
Software Architect/DBA/Project Manager
Web Services at Public Affairs
217-333-0382

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Wednesday, September 22, 2010 1:03 PM
To: Tomcat Users List
Subject: RE: Outlook 2003and 2010 does not display image when streamed
through tomcat

 From: Campbell, Lance [mailto:la...@illinois.edu] 
 Subject: Outlook 2003and 2010 does not display image when streamed
through tomcat

 I am streaming an image through tomcat 6.29.  In a browser 
 the image looks fine. But in an email in Outlook 2003 and 
 2010 the image does not display.  Any thoughts?  

Don't use Outlook?  (Which I say while forced to use it myself by
corporate requirements.)

There's an option for Outlook to show embedded images and it may be
locally or globally disabled.  Run Wireshark and see if Outlook even
makes a request to Tomcat to retrieve the image, or use Tomcat's
AccessLogValve to see if the request is made.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.


-
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: Outlook 2003and 2010 does not display image when streamed through tomcat

2010-09-22 Thread Campbell, Lance
Never Mind.  It was a security issue on our side.  There is no problem.

Thanks,

Lance Campbell
Software Architect/DBA/Project Manager
Web Services at Public Affairs
217-333-0382


-Original Message-
From: Campbell, Lance [mailto:la...@illinois.edu] 
Sent: Wednesday, September 22, 2010 1:08 PM
To: Tomcat Users List
Subject: RE: Outlook 2003and 2010 does not display image when streamed
through tomcat

I took the image file that Outlook won't display from Tomcat 6 and
copied it to a public directory on our web server.  I then resent the
email to Outlook using the public web location on apache and it
displayed fine. 

Thanks,

Lance Campbell
Software Architect/DBA/Project Manager
Web Services at Public Affairs
217-333-0382

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Wednesday, September 22, 2010 1:03 PM
To: Tomcat Users List
Subject: RE: Outlook 2003and 2010 does not display image when streamed
through tomcat

 From: Campbell, Lance [mailto:la...@illinois.edu] 
 Subject: Outlook 2003and 2010 does not display image when streamed
through tomcat

 I am streaming an image through tomcat 6.29.  In a browser 
 the image looks fine. But in an email in Outlook 2003 and 
 2010 the image does not display.  Any thoughts?  

Don't use Outlook?  (Which I say while forced to use it myself by
corporate requirements.)

There's an option for Outlook to show embedded images and it may be
locally or globally disabled.  Run Wireshark and see if Outlook even
makes a request to Tomcat to retrieve the image, or use Tomcat's
AccessLogValve to see if the request is made.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.


-
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: Basic Question

2010-04-15 Thread Campbell, Lance

Did you put an entry in your web.XML file?

Lance Campbell
Sent from my iPhone

On Apr 15, 2010, at 8:09 PM, Rhino rhi...@sympatico.ca wrote:

I hope someone will take pity on me and help me with this very basic  
question. I was moderately fluent with servlets and Tomcat several  
years ago but haven't touched them in a while. I'm trying to get  
back into servlets now.


I am having trouble getting my servlets to start in Tomcat. I  
inevitably get a 404 error. I am running Tomcat 6.0.26 on Windows XP  
SP2. The sample applications in Tomcat run fine.


My servlets are in Eclipse 3.5.2. They compile fine and I have used  
the Tomcat menu to export them to the war file directory; no error  
gets reported when I do the export. I did a manual deploy of the war  
file from the war file to deplay section of the Tomcat Manager page.


When I start the Tomcat Manager in my browser, it shows several  
servlets, including the examples and the servlets that I have  
deployed myself. In each case, my own servlets seem to be started  
just fine. All of them say running, the number of sessions is 0  
for each of them, and all of them have stop, reload and undeploy  
options which are clickable and a start option which is not  
clickable. To me, that says these puppies are started and there is  
no error in any of them.


However, when I click on my servlets, like /FileUploadServlet for  
example, I get this:



HTTP Status 404 - /FileUploadServlet/

--- 
-


*type* Status report

*message* _/FileUploadServlet/_

*description* _The requested resource (/FileUploadServlet/) is not  
available._


--- 
-



Apache Tomcat/6.0.26



I feel sure that I've simply neglected to do something simple and  
straightforward but my memory is failing me. I can't remember what  
other steps are needed to get a servlet configured so that it runs  
in Tomcat.


I was going to try to run the servlet in Eclipse but I'm darned if I  
can remember how to start it there either.


Can someone help me out?

--
Rhino

-
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



mod_jk - apache to tomcat using SSL

2010-03-16 Thread Campbell, Lance
I have a web server and an application server.  I use mod_jk to
communicate between apache2.0 and tomcat 6.  I don't believe the
communication between apache and tomcat is secured by default.  Is there
a way to have it send the information in a secure way.

 

 

Thanks,

 

Lance Campbell

Software Architect/DBA/Project Manager

Web Services at Public Affairs

217-333-0382

 



RE: mod_jk - apache to tomcat using SSL

2010-03-16 Thread Campbell, Lance
What group is responsible for the Tomcat AJP protocol?  Is there a way to 
request a feature to add SSL encryption to the protocol?

Thanks,

Lance Campbell
Software Architect/DBA/Project Manager
Web Services at Public Affairs
217-333-0382


-Original Message-
From: André Warnier [mailto:a...@ice-sa.com] 
Sent: Tuesday, March 16, 2010 4:08 PM
To: Tomcat Users List
Subject: Re: mod_jk - apache to tomcat using SSL

Campbell, Lance wrote:
 I have a web server and an application server.  I use mod_jk to
 communicate between apache2.0 and tomcat 6.  I don't believe the
 communication between apache and tomcat is secured by default.  Is there
 a way to have it send the information in a secure way.
 
Taking your question strictly as phrased, I don't think so, because the 
mod_jk/Tomcat AJP protocol is not encrypted.
If you really needed to do this, you could use an SSH tunnel however.
If you really needed to and the physical constraints allow it, you could 
also link your Apache with the back-end Tomcat with a dedicated LAN, and 
avoid the overhead of SSL.


-
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



Schema or DTD for the context.xml

2009-12-03 Thread Campbell, Lance
Is there a schema or DTD for the context.xml file?

Thanks,

Lance Campbell
Project Manager/Software Architect/DBA
Web Services at Public Affairs
217-333-0382



How do I set the location of where catalina.out goes

2009-11-09 Thread Campbell, Lance
Tomcat 6
How do I set the location and file name of catalina.out?

Thanks,

Lance Campbell
Project Manager/Software Architect/DBA
Web Services at Public Affairs
217-333-0382



RE: How do I set the location of where catalina.out goes

2009-11-09 Thread Campbell, Lance
It just occurred to me to use a symbolic link.  That works great. 


Thanks,

Lance Campbell
Project Manager/Software Architect/DBA
Web Services at Public Affairs
217-333-0382

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Monday, November 09, 2009 11:21 AM
To: Tomcat Users List
Subject: RE: How do I set the location of where catalina.out goes

 From: Campbell, Lance [mailto:la...@illinois.edu]
 Subject: How do I set the location of where catalina.out goes
 
 How do I set the location and file name of catalina.out?

The catalina.out file is not used directly by Tomcat itself.  Rather,
it's a redirection of stdout and stderr set up by the catalina.sh
script.  You're free to modify the script to redirect anywhere you want;
note that there are three references to the file in the script.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.


-
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