Re: How to set global variable in Tomcat 5.5.17

2007-03-06 Thread tang jie

Kathy Lo:
   I think you can use the interface
javax.servlet.ServletContextListener.In you implementation's method
contextInitialized(ServletContextEventfile:///E:/java/api/j2eeri-1_4-doc-api/apidocs/javax/servlet/ServletContextEvent.html
sce),you can parse these configuration files and save the parsing result in
the application scope,for example:
sce.getServletContext().setAttribute(linkedlist,linkedlist);
then when you want to the linkedlist,you can get the ServletContext,and call
its getAttribute().

2007/3/7, Kathy Lo [EMAIL PROTECTED]:


Hi,

I setup Tomcat 5.5.17 in Linux Fedora Core 4 and develop a Web
Application under /webapps directory.

I have so many configuration files that need to be loaded into my web
application. These configuration files are in a self-defined format
and I wrote some Java classes to parse these configuration files and
save the parsing result in a linked list (java.util.List or
java.util.Map). These configuration files are static (not change).

In my web application, when a user session created, I call these Java
classes to parse these configuration files and save the linked lists
into the session. So, every user sessions contain the same set of
linked list and, as a result, it reads these files every time when
session created (so many I/O access, if many session created as the
same time, it will slow down the server).

Now, I want to save these linked lists as a global variables in Tomcat
so that each JSP and Servlet can access these global variables and
reduce I/O access and memory usage.

So, would you please tell me how to set global variables in Tomcat and
initialize them using the Java classes that I wrote.

Thanks

--
Kathy Lo

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: mod_jk Submounts

2006-05-06 Thread tang jie

On 5/2/06, Mike Bydalek [EMAIL PROTECTED] wrote:


  Host name=www.domain.com
Context path= docBase=/opt/tomcat5/webapps/webappA
debug=0/



I think you should add the following:
Context path=/appB docBase=... debug=0/
Context path=/appC docBase=... debug=0/

 /Host


Because i think you should tell Tomcat the  other  2  webapp's location.


jk can't connect to tomcat

2006-04-27 Thread tang jie
I sometimes met the problem that apache can't connect to tomcat
through jk.Iwant to know why,the records of mod_jk.log  like:

[Wed Apr 26 18:46:54 2006] [error] ajp_service::jk_ajp_common.c (1758):
Error connecting to tomcat. Tomcat is probably not started or is listening
on the wrong port. worker=worker1 failed
[Wed Apr 26 18:46:54 2006] [info]  jk_handler::mod_jk.c (1985): Service
error=0 for worker=worker1
[Wed Apr 26 18:46:54 2006] [info]  jk_open_socket::jk_connect.c (444):
connect to 127.0.0.1:8010 failed with errno=111
[Wed Apr 26 18:46:54 2006] [info]  ajp_connect_to_endpoint::jk_ajp_common.c
(889): Failed opening socket to (127.0.0.1:8010) with (errno=111)
[Wed Apr 26 18:46:54 2006] [info]  ajp_send_request::jk_ajp_common.c (1248):
Error connecting to the Tomcat process.
[Wed Apr 26 18:46:54 2006] [info]  ajp_service::jk_ajp_common.c (1749):
Sending request to tomcat failed,  recoverable operation attempt=1
[Wed Apr 26 18:46:54 2006] [info]  jk_open_socket::jk_connect.c (444):
connect to 127.0.0.1:8010 failed with errno=111
[Wed Apr 26 18:46:54 2006] [info]  ajp_connect_to_endpoint::jk_ajp_common.c
(889): Failed opening socket to (127.0.0.1:8010) with (errno=111)
[Wed Apr 26 18:46:54 2006] [info]  ajp_send_request::jk_ajp_common.c (1248):
Error connecting to the Tomcat process.
[Wed Apr 26 18:46:54 2006] [info]  ajp_service::jk_ajp_common.c (1749):
Sending request to tomcat failed,  recoverable operation attempt=2
[Wed Apr 26 18:46:54 2006] [info]  jk_open_socket::jk_connect.c (444):
connect to 127.0.0.1:8010 failed with errno=111
[Wed Apr 26 18:46:54 2006] [info]  ajp_connect_to_endpoint::jk_ajp_common.c
(889): Failed opening socket to (127.0.0.1:8010) with (errno=111)
[Wed Apr 26 18:46:54 2006] [info]  ajp_send_request::jk_ajp_common.c (1248):
Error connecting to the Tomcat process.
[Wed Apr 26 18:46:54 2006] [info]  ajp_service::jk_ajp_common.c (1749):
Sending request to tomcat failed,  recoverable operation attempt=3


Re: jk can't connect to tomcat

2006-04-27 Thread tang jie
The correspong setting in Tomcat::
Connector port='8010 enableLookups=false redirectPort=8443
protocol=AJP/1.3

workers.properties is:
worker.list=worker1

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

The web server can run for about one day,but suddently it can't response to
the user's request.After I restartet tomcat ,it would run normally.I want to
know how it happened.What's wrong?




On 4/27/06, fooshyn [EMAIL PROTECTED] wrote:


 --Tomcat is probably not started or is listening on the wrong port--

 Probably the Tomcat or AJP port setting is wrong? Seems that your tomcat
 runs on port 8010...what are your settings for Tomcat AJP connector?

 HTH

 FooShyn


 -Original Message-
 From: tang jie [mailto:[EMAIL PROTECTED]
 Sent: Thursday, April 27, 2006 2:07 PM
 To: users@tomcat.apache.org
 Subject: jk can't connect to tomcat

 I sometimes met the problem that apache can't connect to tomcat
 through jk.Iwant to know why,the records of mod_jk.log  like:

 [Wed Apr 26 18:46:54 2006] [error] ajp_service::jk_ajp_common.c (1758):
 Error connecting to tomcat. Tomcat is probably not started or is listening
 on the wrong port. worker=worker1 failed
 [Wed Apr 26 18:46:54 2006] [info]  jk_handler::mod_jk.c (1985): Service
 error=0 for worker=worker1
 [Wed Apr 26 18:46:54 2006] [info]  jk_open_socket::jk_connect.c (444):
 connect to 127.0.0.1:8010 failed with errno=111
 [Wed Apr 26 18:46:54 2006]
 [info]  ajp_connect_to_endpoint::jk_ajp_common.c
 (889): Failed opening socket to (127.0.0.1:8010) with (errno=111)
 [Wed Apr 26 18:46:54 2006] [info]  ajp_send_request::jk_ajp_common.c
 (1248):
 Error connecting to the Tomcat process.
 [Wed Apr 26 18:46:54 2006] [info]  ajp_service::jk_ajp_common.c (1749):
 Sending request to tomcat failed,  recoverable operation attempt=1
 [Wed Apr 26 18:46:54 2006] [info]  jk_open_socket::jk_connect.c (444):
 connect to 127.0.0.1:8010 failed with errno=111
 [Wed Apr 26 18:46:54 2006]
 [info]  ajp_connect_to_endpoint::jk_ajp_common.c
 (889): Failed opening socket to (127.0.0.1:8010) with (errno=111)
 [Wed Apr 26 18:46:54 2006] [info]  ajp_send_request::jk_ajp_common.c
 (1248):
 Error connecting to the Tomcat process.
 [Wed Apr 26 18:46:54 2006] [info]  ajp_service::jk_ajp_common.c (1749):
 Sending request to tomcat failed,  recoverable operation attempt=2
 [Wed Apr 26 18:46:54 2006] [info]  jk_open_socket::jk_connect.c (444):
 connect to 127.0.0.1:8010 failed with errno=111
 [Wed Apr 26 18:46:54 2006]
 [info]  ajp_connect_to_endpoint::jk_ajp_common.c
 (889): Failed opening socket to (127.0.0.1:8010) with (errno=111)
 [Wed Apr 26 18:46:54 2006] [info]  ajp_send_request::jk_ajp_common.c
 (1248):
 Error connecting to the Tomcat process.
 [Wed Apr 26 18:46:54 2006] [info]  ajp_service::jk_ajp_common.c (1749):
 Sending request to tomcat failed,  recoverable operation attempt=3


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




Re: i want to know load on Tomcat

2006-04-27 Thread tang jie
I think you can use JMeter to execute load test on web server.

On 4/27/06, balaraju mandala [EMAIL PROTECTED] wrote:

 Dear Comunity,

 I want to know how much load is on my Tomcat. How can i do this?

 I hav a Client, which continues calls set of  Servlets. I want to test how
 many Clients(max) i can run at a time, for this i want to know load on
 Tomcat.

 regards,
 bala