Access for restricted user to restart

2010-10-27 Thread M.S.Eesh
Hi,

I have installed Apache tomcat 5.0.28 in windows vista business
edition.I am using one application which is working only on this tomcat
version.Now I need to give access for restricted windows vista user to
restart tomcat service as and when require.Please guide me to do it.


Re: mod_jk makes ajp connector run out of free connections

2010-10-27 Thread Marc Wilmots
Thanks a lot Mladen, I really appreciate your help.
About the AJP leaving connections open; If you hadn't @apache.org in
your email address I wouldn't believe you ;)

2010/10/26, Mladen Turk mt...@apache.org:
 On 10/26/2010 08:36 PM, Marc Wilmots wrote:

 1200  1000, thus your theory is probably right.

 :)

 However, I'm just
 wondering... I read that when Tomcat reaches the max number of
 connections,
 just rejects new connections (I'm omitting the backlog on purpose).

 So, I can understand that my Tomcat is reaching the maxThreads, but I'm
 supposing that once I stop my stress test, the connections should go down,
 and not remain there as idle as they do now. No load, means no more
 connections, so why does mod_jk keep the 200 connections occupied? I don't
 have anything set such as keepalive or whatever.. Shouldn't it just
 release
 the connections?


 Simple. AJP is constant protocol. Once established the
 connections are never released but rather reused.
 Well unless you set the connectionTimeout which basically
 is not connection timeout but rather the timeout
 between 2 http requests made over the persistent connection.


 Regards
 --
 ^TM

 -
 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: destory method is called twice while the child is destoryed directly

2010-10-27 Thread Mark Thomas
On 27/10/2010 06:43, Ivan wrote:
 Hi,
 While calling the method destory() on the StandardContext directly, it
 seems that the method destoryInternal() is called twice in the
 LifecycleMBeanBase, the two stacktraces are below :
 a.  LifecycleMBeanBase.unregister(ObjectName) line: 191
  LifecycleMBeanBase.destroyInternal() line: 73
  ContainerBase.destroyInternal() line: 1109
  StandardContext.destroyInternal() line: 5114
  LifecycleBase.destroy() line: 271
  ContainerBase.removeChild(Container) line: 963
  ContainerBase.destroyInternal() line: 1106
  StandardContext.destroyInternal() line: 5114
  LifecycleBase.destroy() line: 271
  ...
  b. LifecycleMBeanBase.unregister(ObjectName) line: 191
  LifecycleMBeanBase.destroyInternal() line: 73
  ContainerBase.destroyInternal() line: 1109
  StandardContext.destroyInternal() line: 5114
  LifecycleBase.destroy() line: 271
  ...
 
  So is it by desgin or some code changes might be needed ? Thanks.

It is a bug - a side effect of the Lifecycle clean-up in Tomcat 7. BTW,
mentioning which version you are using would be a big help.

Mark

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



Re: mod_jk makes ajp connector run out of free connections

2010-10-27 Thread Pid
On 26/10/2010 16:08, Marc Wilmots wrote:
 Hi again.
 
 I checked out the executor element, although, I can't find a lot of
 information about it.
 Would you mind explaining why using the executor element would fix the
 problem I am having?

The Executor will reduce the size of the thread pool once threads are idle.


p

 2010/10/26 Pid p...@pidster.com
 
 On 26/10/2010 13:47, Marc Wilmots wrote:
 Hi Experts,

 I have the following setup:

 Apache1
   / \
   Apache2 Apache3
   \  /
 Tomcat1

 That's an interesting setup.  What does it achieve?

 All Apaches are version 2.2.3 (RedHat)

 Time for an upgrade methinks.

 Apache2 and Apache3 loadbalance Tomcat1 (6.0.18) with mod_jk (2.2.28).

 Same again for Tomcat.  Presumably you mean 1.2.28 for mod_jk.

 In idle state the AJP connector of Tomcat1 only has 7 active connections.
 After launching a stress test of Tomcat1, it's AJP connector has reached
 maxThreads (200). After the stress test has finished, there are still 200
 active connections in the AJP connector.

 Because of this, apache2 and apache2 cannot receive any heartbeat message
 anymore from the AJP connector and mark Tomcat1 as dead. I can access
 perfectly through port 8080, so Tomcat1 isn't dead at all!

 Find and enable the Executor element in server.xml, configure your
 Connector to reference it.

 According to a threaddump, ALL TP-Processor-x threads are in the
 following
 state:

 TP-Processor41 daemon prio=10 tid=0x8ada7800 nid=0x1496 runnable
 [0x861eb000]
java.lang.Thread.State: RUNNABLE
 at java.net.SocketInputStream.socketRead0(Native Method)
 at java.net.SocketInputStream.read(SocketInputStream.java:129)
 at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
 at
 java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
 at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
 - locked 0xbab3ef10 (a java.io.BufferedInputStream)
 at
 org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:620)
 at
 org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:558)
 at

 org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:685)
 at

 org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
 at

 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
 at java.lang.Thread.run(Thread.java:619)

 LambaProbe confirms this and shows 200 AJP connections in KeepAlive
 state.

 Please see my mod_jk and tomcat ajp connector configurations:

 server.xml:

 Connector port=9009 protocol=AJP/1.3 redirectPort=8443
 URIEncoding=UTF-8 /

 workers.properties:

 worker.list=liferay_alf

 worker.alfresco1.port=9009
 worker.alfresco1.host=10.133.23.4
 worker.alfresco1.type=ajp13
 worker.alfresco1.lbfactor=1

 worker.liferay_alf.type=lb
 worker.liferay_alf.balance_workers=alfresco1
 worker.liferay_alf.sticky_session=0


 In the Tomcat documentation I've seen that the AJP connector has a
 property
 keepAliveTimeout. Although, before setting this, I would like to know
 from
 you guys whether this looks as apache2 and apache3 continuously keep
 sending
 keepAlive messages to the open AJP connections. If so, why is this? And
 do
 you think setting keepAliveTimeout in Tomcat is the best solution?

 No, nothing to do with it.  See above.


 p

 



0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: mod_jk makes ajp connector run out of free connections

2010-10-27 Thread Mark Thomas
On 27/10/2010 11:08, Pid wrote:
 On 26/10/2010 16:08, Marc Wilmots wrote:
 Hi again.

 I checked out the executor element, although, I can't find a lot of
 information about it.
 Would you mind explaining why using the executor element would fix the
 problem I am having?
 
 The Executor will reduce the size of the thread pool once threads are idle.

Problem is, the threads aren't idle as AJP connections are persistent by
default.

Options:
1. Increase maxThreads on Tomcat to be the same as max threads (exact
directives vary with MPM) on httpd
2. Turn on mod_jk's disable reuse option

I'd go with 2.

Mark

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



RE: Access for restricted user to restart

2010-10-27 Thread Caldarale, Charles R
 From: M.S.Eesh [mailto:freeos...@gmail.com] 
 Subject: Access for restricted user to restart

 I have installed Apache tomcat 5.0.28

Over six years old and unsupported.  Start again.

 Now I need to give access for restricted windows vista 
 user to restart tomcat service as and when require.

Don't run it as a service.

 - 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



Re: mod_jk makes ajp connector run out of free connections

2010-10-27 Thread Pid
On 27/10/2010 11:16, Mark Thomas wrote:
 On 27/10/2010 11:08, Pid wrote:
 On 26/10/2010 16:08, Marc Wilmots wrote:
 Hi again.

 I checked out the executor element, although, I can't find a lot of
 information about it.
 Would you mind explaining why using the executor element would fix the
 problem I am having?

 The Executor will reduce the size of the thread pool once threads are idle.
 
 Problem is, the threads aren't idle as AJP connections are persistent by
 default.
 
 Options:
 1. Increase maxThreads on Tomcat to be the same as max threads (exact
 directives vary with MPM) on httpd
 2. Turn on mod_jk's disable reuse option

Ah.  Yes.  I've just read the other half of the thread...


p


0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


ISAPI-Problem

2010-10-27 Thread Jost Richstein

Hi,

I have the following problem on a Windows Server 2003 64Bit (AMD).

Configuration:
IIS 6, isapi_redirect.dll AMD64 Version 1.2.30, Tomcat 5.5.27, JDk 1.6.0_12 
64Bit.

I am using the following small worker.properties:

 ps=\
 worker.list=ajp13
 worker.ajp13.port=8010
 worker.ajp13.host=localhost
 worker.ajp13.type=ajp13
 worker.ajp13.connection_pool_size=500

My isapi_redirect.properties contains only (no other parameters set)

extension_uri
log_file
log_level (error)
worker_file
worker_mount_file

My Tomcat site works fine in general, there are up to 1.400 users active and 
the site
answers requests very fast. However I have the following log entries every few 
minutes
(sometimes every few seconds) in jk.log. Every time that pair of entries:

 [Wed Oct 27 12:15:37.764 2010] [3156:3284] [error] 
ajp_service::jk_ajp_common.c (2559): (ajp13) connecting to tomcat failed.
 [Wed Oct 27 12:15:37.811 2010] [3156:3284] [error] 
HttpExtensionProc::jk_isapi_plugin.c (2195): service() failed with http error 
500

And I do not have any other log entries in Tomcat- or Application Log. The 
client receives
an incomplete HTTP-Response, the response has no Content-Length header and no 
content,
for example.

Any hints or ideas?

Regards,
Jost




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



RE: deploying as ROOT application

2010-10-27 Thread Aggarwal, Ajay
Thank you. That's exactly what I was looking for.

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 


And look here, for step-by-step instructions:
http://wiki.apache.org/tomcat/HowTo#How_do_I_make_my_web_application_be_
the_Tomcat_default_application_.3F

 - Chuck



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



Re: ISAPI-Problem

2010-10-27 Thread Mladen Turk

On 10/27/2010 03:24 PM, Jost Richstein wrote:


I am using the following small worker.properties:

worker.ajp13.connection_pool_size=500


...


My Tomcat site works fine in general, there are up to 1.400 users active and 
the site


So how do you expect 500 connections will serve up to 1400 concurrent users?


Regards
--
^TM

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



Re: ISAPI-Problem

2010-10-27 Thread Jost Richstein

I did not say concurrent users. Just active sessions. There are,
under normal circumstances, not more than 50 conccurent requests.

 Original-Nachricht 
Betreff: Re: ISAPI-Problem
Von: Mladen Turk mt...@apache.org
An: users@tomcat.apache.org
Datum: 27.10.2010 15:30


On 10/27/2010 03:24 PM, Jost Richstein wrote:


I am using the following small worker.properties:

worker.ajp13.connection_pool_size=500


...


My Tomcat site works fine in general, there are up to 1.400 users active and 
the site


So how do you expect 500 connections will serve up to 1400 concurrent users?


Regards


--
Jost Richstein
SoftDeCC Software GmbH
Email: jrichst...@softdecc.com
Tel.: +49 89 89 06 78 47
Fax.: +49 89 89 06 78 33

SoftDeCC Software GmbH; Gesellschaft mit beschränkter Haftung; Sitz der Gesellschaft: München; Registergericht: München, HRB 123667; 
Geschäftsführer: Ralf Malis, Georg Nüssel, Jost Richstein, Gerd Wilts



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



AW: AW: IPV6 problem with tcnative-1.dll: unable to connect from other host

2010-10-27 Thread Michael Wendt
Hi Mladen,

I 've understand the firt step.
The second step 
 mod_jk supports only IPV4  
How and where can I do this.

Thank' for your help

Regards
Michael Wendt


-Ursprüngliche Nachricht-
Von: Mladen Turk [mailto:mt...@apache.org] 
Gesendet: Montag, 25. Oktober 2010 17:41
An: users@tomcat.apache.org
Betreff: Re: AW: IPV6 problem with tcnative-1.dll: unable to connect from other 
host

On 10/25/2010 05:12 PM, Michael Wendt wrote:
 Hi Pid,


  Connector port=8009
 enableLookups=false redirectPort=8443 protocol=AJP/1.3 
 /


Try adding address=your.host.ip.address
Having null address will force listening on *all*
interfaces and *all* protocols, and I suppose you
don't need that. mod_jk supports only IPV4, so just
enter your valid IPV4 address, and that should be enough.


Regards
-- 
^TM

-
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 to start my application without localhost, only with virtiual host ?

2010-10-27 Thread M.Arkhypov


Hi Tomcat - Users,

I use Tomcat 6.0.29 on a Suse 11.1 Linux Server and I would like to start  
my application without localhost, only with virtiual host.


On Windows it works already.
Here is the server.xml:

 !--
Host name=localhost  appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
/Host
--

  Host name=mmmtest.ch
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=true
Aliasmmmtest.ch/Alias
Context path=
 docBase=c:/temp_mmm/apache-tomcat-6.0.29/webapps/examples
 reloadable=true allowLinking=true 
/Context
 /Host

Now I can reach the network with the URL: http://mmmtest.ch/.
The tomcatmanager is reachable on: http://mmmtest.ch:8080/manager/html.


The server.xml:

 !-- Define a non-SSL HTTP/1.1 Connector on port 8080 --
Connector port=8080 maxHttpHeaderSize=8192
   maxThreads=150 minSpareThreads=25 maxSpareThreads=75
   enableLookups=false redirectPort=8443 acceptCount=100
   connectionTimeout=2 disableUploadTimeout=true /
Connector port=8010
   enableLookups=false redirectPort=8443  
protocol=AJP/1.3 /


Engine name=Catalina defaultHost=localhost

  Realm className=org.apache.catalina.realm.UserDatabaseRealm
 resourceName=UserDatabase/

  !--
  Host name=localhost appBase=webapps

   unpackWARs=true autoDeploy=true
   xmlValidation=false xmlNamespaceAware=false

  /Host
--

 Host name=pcd-testcommunity.de
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=true
Aliaspcd-testcommunity.de/Alias
 Context path=
 
docBase=/var/lib/tomcat55/webapps/CompetenceNetwork
 reloadable=true allowLinking=true 
 /Context
 /Host

/Engine

  /Service

/Server

The network is reachable on pcd-testcommunity.de. If I try to reach the  
tomcatmanager with http://pcd-testcommunity.de:8081/manager/html, I get an  
ERROR 404.

How can I work with tomcatmanager with these configurations?

Greetings

Michael Arkhypov, Softwareentwickler

Lyncker  Theis GmbH
Wilhelmstr. 16
65185 Wiesbaden
Germany

Fon +49 611/89038960
Fax +49 611/9406125

Handelsregister: HRB 23156 Amtsgericht Wiesbaden
Steuernummer: 04323897052
USt-IdNr.: DE255806399

Geschäftsführer:
Filip Lyncker,
Armin Theis

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



RE: How to troubleshoot what's causing so many connections?

2010-10-27 Thread Caldarale, Charles R
 From: laredotornado [mailto:laredotorn...@gmail.com] 
 Subject: How to troubleshoot what's causing so many connections?

 We're noticing a high number of active Tomcat
 connections on one of our servers.

First off, what do you mean by Tomcat connections?  That's rather ambiguous 
phrasing.

 how can we nail down more concretely where the hold up is?

Take some thread dumps and see what they're doing.

http://wiki.apache.org/tomcat/HowTo#How_do_I_obtain_a_thread_dump_of_my_running_webapp_.3F

 - 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



Re: How to troubleshoot what's causing so many connections?

2010-10-27 Thread Mark Thomas
On 27/10/2010 17:56, laredotornado wrote:
 
 Hi,
 
 We're using Tomcat 6.0.24.  We're noticing a high number of active Tomcat
 connections on one of our servers.  We suspect that a lot of these
 connections are idle and waiting for a database call to return, but how can
 we nail down more concretely where the hold up is?

Threaddump

Mark

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



How to start a daemon without getting the warning?

2010-10-27 Thread Leon Rosenberg
Hello,

I'm getting following warning with 6.0.29,

after shutdown:
SEVERE: The web application [/moskitodemo] appears to have started a
thread named [MoskitoMemoryPoolReader] but has failed to stop it. This
is very likely to create a memory leak.

here's the snapshot of the code that starts the thread:


public class BuiltInMemoryPoolProducer implements IStatsProducer{

/**
 * Timer instance for this producer type.
 */
private static final Timer timer = new Timer(MoskitoMemoryPoolReader, 
true);

...

public BuiltInMemoryPoolProducer(MemoryPoolMXBean aPool){

timer.scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
readMemory();
}
}, 0, 1000L*60);
...}

to my knowledge this thread is a daemon. This knowledge is also shared
by jstack:


MoskitoMemoryPoolReader daemon prio=5 tid=10883f800 nid=0x11a9b2000
in Object.wait() [11a9b1000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on 10a1120d0 (a java.util.TaskQueue)
at java.util.TimerThread.mainLoop(Timer.java:509)
- locked 10a1120d0 (a java.util.TaskQueue)
at java.util.TimerThread.run(Timer.java:462)

So, how can I avoid this warning and where's the bug.

regards
Leon

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



RE: How to start a daemon without getting the warning?

2010-10-27 Thread Caldarale, Charles R
 From: Leon Rosenberg [mailto:rosenberg.l...@gmail.com] 
 Subject: How to start a daemon without getting the warning?

 to my knowledge this thread is a daemon. 

Which isn't really relevant in the situation where only the context is being 
stopped, not the entire JVM.

 how can I avoid this warning and where's the bug.

The bug is in failing to implement a ServletContextListener that can stop the 
thread.

 - 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



Re: How to start a daemon without getting the warning?

2010-10-27 Thread Leon Rosenberg
On Wed, Oct 27, 2010 at 10:43 PM, Caldarale, Charles R
chuck.caldar...@unisys.com wrote:
 From: Leon Rosenberg [mailto:rosenberg.l...@gmail.com]
 Subject: How to start a daemon without getting the warning?

 to my knowledge this thread is a daemon.

 Which isn't really relevant in the situation where only the context is being 
 stopped, not the entire JVM.

Meaning that I have to implement own thread registry for all started
threads? Anyone already did something like this by chance?


Leon

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



RE: How to start a daemon without getting the warning?

2010-10-27 Thread Caldarale, Charles R
 From: Leon Rosenberg [mailto:rosenberg.l...@gmail.com] 
 Subject: Re: How to start a daemon without getting the warning?

 Meaning that I have to implement own thread registry for 
 all started threads?

Nobody's going to do it for you, since they're part of your webapp.  (Might be 
an interesting beyond-spec extension for Tomcat, though.)

 Anyone already did something like this by chance?

You might want to take a look at java.util.concurrent.ThreadPoolExecutor, or 
perhaps org.apache.commons.pool.

 - 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



Re: How to start a daemon without getting the warning?

2010-10-27 Thread Leon Rosenberg
On Wed, Oct 27, 2010 at 11:39 PM, Caldarale, Charles R
chuck.caldar...@unisys.com wrote:
 From: Leon Rosenberg [mailto:rosenberg.l...@gmail.com]
 Subject: Re: How to start a daemon without getting the warning?

 Meaning that I have to implement own thread registry for
 all started threads?

 Nobody's going to do it for you, since they're part of your webapp.  (Might 
 be an interesting beyond-spec extension for Tomcat, though.)

What I mean is a registry-style-thing where i can register all my
threads, timers and executors, and which will take care of them with a
-ready-to-use- contextlistener i just have to add to my web.xml.


 Anyone already did something like this by chance?

 You might want to take a look at java.util.concurrent.ThreadPoolExecutor, or 
 perhaps org.apache.commons.pool.

Well, that would just move the problem from stopping Timer to calling
shutdown on  Executor, wouldn't it?


  - 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: How to start a daemon without getting the warning?

2010-10-27 Thread Konstantin Kolinko
2010/10/28 Leon Rosenberg rosenberg.l...@gmail.com:

 Well, that would just move the problem from stopping Timer to calling
 shutdown on  Executor, wouldn't it?


The problem is with the Thread.getContextClassLoader() for your
thread.  It contains a reference to the webapp classloader, and thus
does not allow to GC it.


Note, that the webapp classloader cannot be used anymore once the
application is stopped. Any attempt to load classes through it will
fail.

Best regards,
Konstantin Kolinko

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



Re: How to start a daemon without getting the warning?

2010-10-27 Thread Leon Rosenberg
Hello Konstantin,

On Wed, Oct 27, 2010 at 11:53 PM, Konstantin Kolinko
knst.koli...@gmail.com wrote:
 2010/10/28 Leon Rosenberg rosenberg.l...@gmail.com:

 Well, that would just move the problem from stopping Timer to calling
 shutdown on  Executor, wouldn't it?


 The problem is with the Thread.getContextClassLoader() for your
 thread.  It contains a reference to the webapp classloader, and thus
 does not allow to GC it.

But I can't detect any obvious Thread.getContextClassLoader() calls in
the code below:

public class BuiltInMemoryPoolProducer implements IStatsProducer{
/**
 * The id of the producers. Usually its the name of the pool.
 */
private String producerId;
/**
 * Associated stats.
 */
private MemoryPoolStats stats;
/**
 * Stats container
 */
private ListIStats statsList;

/**
 * The monitored pool.
 */
private MemoryPoolMXBean pool;
/**
 * Timer instance for this producer type.
 */
private static final Timer timer = new Timer(MoskitoMemoryPoolReader, 
true);

/**
 * Creates a new producers object for a given pool.
 * @param aPool
 */
public BuiltInMemoryPoolProducer(MemoryPoolMXBean aPool){
pool = aPool;
producerId = 
MemoryPool-+pool.getName()+-+(pool.getType()==MemoryType.HEAP?
Heap : NonHeap);
statsList = new CopyOnWriteArrayListIStats();
stats = new MemoryPoolStats(producerId);
statsList.add(stats);

timer.scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
readMemory();
}
}, 0, 1000L*60);
readMemory();
}

@Override
public String getCategory() {
return memory;
}

@Override
public String getProducerId() {
return producerId;
}

@Override
public ListIStats getStats() {
return statsList;
}

@Override
public String getSubsystem() {
return SUBSYSTEM_BUILTIN;
}

private void readMemory() {
MemoryUsage usage = pool.getUsage();
stats.setCommited(usage.getCommitted());
stats.setUsed(usage.getUsed());
stats.setInit(usage.getInit());
stats.setMax(usage.getMax());
}

/**
 * This method is used internally for virtual producers / stats.
 * @return
 */
MemoryPoolStats getMemoryPoolStats(){
return stats;
}
}






 Note, that the webapp classloader cannot be used anymore once the
 application is stopped. Any attempt to load classes through it will
 fail.

 Best regards,
 Konstantin Kolinko

 -
 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 start a daemon without getting the warning?

2010-10-27 Thread Caldarale, Charles R
 From: Leon Rosenberg [mailto:rosenberg.l...@gmail.com] 
 Subject: Re: How to start a daemon without getting the warning?

 But I can't detect any obvious Thread.getContextClassLoader()
 calls in the code below:

The problem isn't associated with calling the above method, it's actually that 
the webapp's classloader has been associated with your thread.  If you reset 
the contextClassLoader for your thread, that /might/ avoid the memory leak when 
the webapp is stopped.  However, if the thread retains any references to other 
webapp-related classes, you still have the leak.  Best to manage your threads 
properly - which is a good bit trickier in a container environment than in a 
stand-alone program.

 - 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



Re: How to start a daemon without getting the warning?

2010-10-27 Thread Konstantin Kolinko
2010/10/28 Leon Rosenberg rosenberg.l...@gmail.com:
 Hello Konstantin,

 On Wed, Oct 27, 2010 at 11:53 PM, Konstantin Kolinko
 knst.koli...@gmail.com wrote:
 2010/10/28 Leon Rosenberg rosenberg.l...@gmail.com:

 Well, that would just move the problem from stopping Timer to calling
 shutdown on  Executor, wouldn't it?


 The problem is with the Thread.getContextClassLoader() for your
 thread.  It contains a reference to the webapp classloader, and thus
 does not allow to GC it.

 But I can't detect any obvious Thread.getContextClassLoader() calls in
 the code below:

 public class BuiltInMemoryPoolProducer implements IStatsProducer{
(skipped the code, have not read it)


If you mean setContextClassLoader(..), that happens in
java.lang.Thread constructor, or more specifically in some private
helper method called there (Thread.init()).

The Thread is created by the Timer.

Best regards,
Konstantin Kolinko

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



Re: destory method is called twice while the child is destoryed directly

2010-10-27 Thread Ivan
Thanks for clarifying it, does the devs have plan for it ? Hope it could be
fixed soon.

2010/10/27 Mark Thomas ma...@apache.org

 On 27/10/2010 06:43, Ivan wrote:
  Hi,
  While calling the method destory() on the StandardContext directly,
 it
  seems that the method destoryInternal() is called twice in the
  LifecycleMBeanBase, the two stacktraces are below :
  a.  LifecycleMBeanBase.unregister(ObjectName) line: 191
   LifecycleMBeanBase.destroyInternal() line: 73
   ContainerBase.destroyInternal() line: 1109
   StandardContext.destroyInternal() line: 5114
   LifecycleBase.destroy() line: 271
   ContainerBase.removeChild(Container) line: 963
   ContainerBase.destroyInternal() line: 1106
   StandardContext.destroyInternal() line: 5114
   LifecycleBase.destroy() line: 271
   ...
   b. LifecycleMBeanBase.unregister(ObjectName) line: 191
   LifecycleMBeanBase.destroyInternal() line: 73
   ContainerBase.destroyInternal() line: 1109
   StandardContext.destroyInternal() line: 5114
   LifecycleBase.destroy() line: 271
   ...
 
   So is it by desgin or some code changes might be needed ? Thanks.

 It is a bug - a side effect of the Lifecycle clean-up in Tomcat 7. BTW,
 mentioning which version you are using would be a big help.

 Mark

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




-- 
Ivan


Re: destory method is called twice while the child is destoryed directly

2010-10-27 Thread Ivan
Yes, I am using 7.0.4. Will create a entry in the bugzila system
Thanks.

2010/10/28 Mark Thomas ma...@apache.org

 On 28/10/2010 02:20, Ivan wrote:
  Thanks for clarifying it, so do the devs have plan for it ?

 Yes. What? Fix it. When? TBD.

 Creating a bugzilla entry will ensure it doesn't get forgotten.

 I see you still haven't told us which version you are using. I assume
 you've tested 7.0.4.

 Mark

  Hope it could be fixed soon.
 
  2010/10/27 Mark Thomas ma...@apache.org
 
  On 27/10/2010 06:43, Ivan wrote:
  Hi,
  While calling the method destory() on the StandardContext directly,
  it
  seems that the method destoryInternal() is called twice in the
  LifecycleMBeanBase, the two stacktraces are below :
  a.  LifecycleMBeanBase.unregister(ObjectName) line: 191
   LifecycleMBeanBase.destroyInternal() line: 73
   ContainerBase.destroyInternal() line: 1109
   StandardContext.destroyInternal() line: 5114
   LifecycleBase.destroy() line: 271
   ContainerBase.removeChild(Container) line: 963
   ContainerBase.destroyInternal() line: 1106
   StandardContext.destroyInternal() line: 5114
   LifecycleBase.destroy() line: 271
   ...
   b. LifecycleMBeanBase.unregister(ObjectName) line: 191
   LifecycleMBeanBase.destroyInternal() line: 73
   ContainerBase.destroyInternal() line: 1109
   StandardContext.destroyInternal() line: 5114
   LifecycleBase.destroy() line: 271
   ...
 
   So is it by desgin or some code changes might be needed ? Thanks.
 
  It is a bug - a side effect of the Lifecycle clean-up in Tomcat 7. BTW,
  mentioning which version you are using would be a big help.
 
  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




-- 
Ivan