Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 46846 invoked from network); 9 Jul 2004 14:13:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 9 Jul 2004 14:13:52 -0000 Received: (qmail 59754 invoked by uid 500); 9 Jul 2004 14:13:22 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 59573 invoked by uid 500); 9 Jul 2004 14:13:21 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 59558 invoked by uid 99); 9 Jul 2004 14:13:21 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [208.186.142.125] (HELO NS2.adaweb.net) (208.186.142.125) by apache.org (qpsmtpd/0.27.1) with SMTP; Fri, 09 Jul 2004 07:13:12 -0700 Received: From PELICAN.ada.net.gov ([208.186.142.115]) by NS2.adaweb.net (WebShield SMTP v4.5 MR1a); id 1089382384809; Fri, 9 Jul 2004 08:13:04 -0600 Received: from eagle.ada.net.gov ([10.113.5.250]) by PELICAN.ada.net.gov with Microsoft SMTPSVC(6.0.3790.0); Fri, 9 Jul 2004 08:13:04 -0600 X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: JNDI / pooling Date: Fri, 9 Jul 2004 08:13:04 -0600 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: JNDI / pooling Thread-Index: AcRlsIGnyP3PMreNTQOpnEoM5oYMGAADXELw From: "Randall Svancara" To: "Tomcat Users List" X-OriginalArrivalTime: 09 Jul 2004 14:13:04.0857 (UTC) FILETIME=[D9FBDC90:01C465BE] X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Most ftp connections time out, so you would have to have an = auto-reconnect feature right? This sounds like a kewl idea. =20 -----Original Message----- From: Ryan Lissack [mailto:rlissack@buildonline.com] Sent: Friday, July 09, 2004 6:30 AM To: 'Tomcat Users List' Subject: RE: JNDI / pooling http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-resources-howto.html= See the 'Adding Custom Resource Factories' section. Ryan. -----Original Message----- From: Viorel Dragomir [mailto:bc@vio.ro] Sent: 09 July 2004 13:12 To: Tomcat Users List Subject: JNDI / pooling Hi, I can't describe exactly the problem because I'm not familiar with all = the terms... But the big picture is that I want to create a pool of ftp connections to work like a database connection and I want to get the connection from JNDI. So far I extended BaseKeyedPoolableObjectFactory and = StackKeyedObjectPool and it works fine like this: FTPConnectionPool pool =3D new FTPConnectionPool(); String key =3D "key"; try{ FTPClient ftp =3D pool.borrowClient(key); if( ftp.sendNoOp() ){ System.out.println("OK"); }else{ System.out.println("NOPE"); } =20 pool.returnClient( key, ftp ); }catch(Exception ex){ ex.printStackTrace(); } But I want to make it work from "JNDI" almost like a datasource InitialContext ctx =3D new InitialContext(); DataSource ds =3D (DataSource) ctx.lookup("java:comp/env/jdbc/backup"); Anyway I am completely lost if it can be done or not. So far I get an exception when I try to start Tomcat: GlobalResourcesLifecycleListener: Exception processing Global JNDI = Resources javax.naming.NamingException: Could not create resource factory = instance, null at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFacto= ry. java:146) at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301) at = org.apache.naming.NamingContext.lookup(NamingContext.java:834) at = org.apache.naming.NamingContext.lookup(NamingContext.java:194) =20 regards, viorel --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org