Re: WebappClassLoader clearReferencesThreads

2010-07-07 Thread Konstantin Kolinko
2010/7/6 Leo Donahue - PLANDEVX leodona...@mail.maricopa.gov:
 Part 2:
 What is the correct way to make connections to things that are not data 
 sources in Tomcat?  Can Tomcat manage the connection information (machine 
 name, domain, user, password)?  How?


There is JNDI support available, so that you can declare Resource if
you provide an appropriate factory= for it.

http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html

The factories are provided for some standard resource types (like
java.sql.DataSource).

Actually, Tomcat does not implement that factory by itself, but uses
Apache Commons DBCP library from http://commons.apache.org/ which
itself is based on Apache Commons Pool library.

Best regards,
Konstantin Kolinko

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



WebappClassLoader clearReferencesThreads

2010-07-06 Thread Leo Donahue - PLANDEVX
This is really a two part question.

The first question has to do with the error in the log file and the second 
question has to do with making connections to other app servers in Tomcat.

Part 1:

I have a webapp (http://planning.maricopa.gov/apnxy) running under Tomcat 
6.0.26 that makes a connection to a different app server that hosts the GIS 
part of the webapp.  That app server is always running, even when I shutdown 
Tomcat.

I looked at the source for WebappClassLoader: 
http://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk/java/org/apache/catalina/loader/
 and I see that Tomcat is trying to terminate the thread that the apnxy web app 
started.

I could stop the GIS service on the app server prior to restarting Tomcat, then 
start the app server.


Part 2:
What is the correct way to make connections to things that are not data sources 
in Tomcat?  Can Tomcat manage the connection information (machine name, domain, 
user, password)?  How?


Making a server connection to an ArcGIS Server app server:
http://resources.esri.com/help/9.3/arcgisserver/adf/java/help/api/arcobjects/com/esri/arcgis/server/ServerConnection.html

PDUManagerImpl: 
http://edndoc.esri.com/arcobjects/9.2/Java/api/arcobjects/com/esri/arcgis/interop/PDUManagerImpl.html

WebappClassLoader: 
http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/catalina/loader/WebappClassLoader.html


Catalina logs:

Jul 5, 2010 9:42:45 AM org.apache.coyote.http11.Http11AprProtocol pause
INFO: Pausing Coyote HTTP/1.1 on http-80
Jul 5, 2010 9:42:45 AM org.apache.coyote.ajp.AjpAprProtocol pause
INFO: Pausing Coyote AJP/1.3 on ajp-8009
Jul 5, 2010 9:42:46 AM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
Jul 5, 2010 9:42:47 AM org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads
SEVERE: A web application appears to have started a thread named 
[PDUManagerImpl-openConnection] but has failed to stop it. This is very likely 
to create a memory leak.
Jul 5, 2010 9:42:47 AM org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads
SEVERE: A web application appears to have started a thread named 
[PDUManagerImpl-openConnection] but has failed to stop it. This is very likely 
to create a memory leak.
Jul 5, 2010 9:42:47 AM org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads
SEVERE: A web application appears to have started a thread named 
[PDUManagerImpl-openConnection] but has failed to stop it. This is very likely 
to create a memory leak.
Jul 5, 2010 9:42:47 AM org.apache.coyote.http11.Http11AprProtocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-80



Using CATALINA_BASE:   C:\apache-tomcat-6.0.26
Using CATALINA_HOME:   C:\apache-tomcat-6.0.26
Using CATALINA_TMPDIR: C:\apache-tomcat-6.0.26\temp
Using JRE_HOME:C:\Program Files\Java\jdk1.6.0_20
Using CLASSPATH:   C:\apache-tomcat-6.0.26\bin\bootstrap.jar
Server version: Apache Tomcat/6.0.26
Server built:   March 9 2010 1805
Server number:  6.0.26.0
OS Name:Windows 2003
OS Version: 5.2
Architecture:   x86
JVM Version:1.6.0_20-b02
JVM Vendor: Sun Microsystems Inc.

Leo Donahue



RE: WebappClassLoader clearReferencesThreads

2010-07-06 Thread Caldarale, Charles R
 From: Leo Donahue - PLANDEVX [mailto:leodona...@mail.maricopa.gov]
 Subject: WebappClassLoader clearReferencesThreads
 
 I looked at the source for WebappClassLoader:
 http://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk/java/
 org/apache/catalina/loader/
 and I see that Tomcat is trying to terminate the thread 
 that the apnxy web app started.

Which means Tomcat is trying to recover from sloppy programming in the webapp.  
It's the webapp's responsibility to manage all threads it creates, including 
terminating them when the webapp is stopped.

 What is the correct way to make connections to things that 
 are not data sources in Tomcat?  Can Tomcat manage the 
 connection information (machine name, domain, user, password)?

No, Tomcat cannot do that - there's nothing in the servlet spec that provides 
for that.  (But check the 3.0 spec and Tomcat 7 - I haven't studied them yet.)  
It's up to the webapp to deal with outbound connections, and manage them 
properly to avoid resource leaks.  Various 3rd-party libraries are available to 
help with that.

 - 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