Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 16477 invoked from network); 30 Jan 2004 18:50:32 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 30 Jan 2004 18:50:32 -0000 Received: (qmail 68014 invoked by uid 500); 30 Jan 2004 18:43:11 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 67898 invoked by uid 500); 30 Jan 2004 18:43:10 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 67756 invoked from network); 30 Jan 2004 18:43:09 -0000 Received: from unknown (HELO lexbsd2.gs.acs-inc.com) (4.37.72.1) by daedalus.apache.org with SMTP; 30 Jan 2004 18:43:08 -0000 Received: from lexbsd1.gs.acs-inc.com by lexbsd2.gs.acs-inc.com (8.12.8/8.12.8) id i0UIOXl3005444; Fri, 30 Jan 2004 13:24:33 -0500 (EST) Received: from lexexcbr01.gs.acs-inc.com by lexbsd1.gs.acs-inc.com (8.12.8/8.12.8) id i0UIOXQK056831; Fri, 30 Jan 2004 13:24:33 -0500 (EST) Received: by lexexcbr01.gs.acs-inc.com with Internet Mail Service (5.5.2657.72) id ; Fri, 30 Jan 2004 13:24:32 -0500 Message-ID: <15E8CE164083D611B27400065B3F00E701F4F010@lexexcu01.gs.acs-inc.com> From: "Fumo, Vince" To: "'commons-user@jakarta.apache.org'" Subject: DBCP Registering a PoolingDataSource in JNDI Date: Fri, 30 Jan 2004 13:24:31 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I'm trying to register a valid PoolingDataSource in JNDI using the following method and code: private final static String INITIAL_CONTEXT_FACTORY = "com.sun.jndi.fscontext.RefFSContextFactory"; private final static String FACTORY_URL = "file:/D:/jndi"; public static void register(PoolingDataSource datasource, String bindName) throws Exception { Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, INITIAL_CONTEXT_FACTORY); env.put(Context.PROVIDER_URL, FACTORY_URL); Context context = null; try { context = new InitialContext(env); } catch (NamingException e) { String msg = "Could not initialize the context : " + e.getMessage();; _log.error(msg); e.printStackTrace(); throw new Exception(msg); } try { context.rebind(bindName, datasource); } catch (NamingException e) { String msg = "Could not bind the datasource : " + e.getMessage(); _log.error(msg); e.printStackTrace(); throw new Exception(msg); } } The problem happens with the call to context.rebind. Apparantly JNDI is complaining as follows: javax.naming.OperationNotSupportedException: Can only bind References or Referenceable objects at com.sun.jndi.fscontext.RefFSContext.addObjectToBindings(RefFSContext.java:47 9) at com.sun.jndi.fscontext.RefFSContext.bindObject(RefFSContext.java:337) at com.sun.jndi.fscontext.RefFSContext.rebind(RefFSContext.java:189) at com.sun.jndi.fscontext.FSContext.rebind(FSContext.java:194) at javax.naming.InitialContext.rebind(Unknown Source) Any ideas on what's wrong? Vincent Fumo Software Engineer ACS State and Local Solutions Government Systems --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org