Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 60554 invoked from network); 1 Nov 2002 15:15:18 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 1 Nov 2002 15:15:18 -0000 Received: (qmail 14283 invoked by uid 97); 1 Nov 2002 15:15:44 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 14234 invoked by uid 97); 1 Nov 2002 15:15:43 -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 14211 invoked by uid 98); 1 Nov 2002 15:15:42 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) From: "Neil Aggarwal" To: "Tomcat-User" Subject: Has anyone gotten Castor to work using JNDI? Date: Fri, 1 Nov 2002 09:15:12 -0600 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Importance: Normal X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hello: Has anyone gotten Castor to work using JNDI and the JBCP pooling mechanism? My platform is Tomcat 4.0.6, Apache 2.0.43, and MySQL 3.23.53a on RedHat Linux 8.0. When I try to load the JDO object from the JNDI context, here is the error I get: javax.naming.NamingException: Cannot create resource instance at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory. java:167) at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:311) at org.apache.naming.NamingContext.lookup(NamingContext.java:834) at org.apache.naming.NamingContext.lookup(NamingContext.java:181) at org.apache.naming.NamingContext.lookup(NamingContext.java:822) at org.apache.naming.NamingContext.lookup(NamingContext.java:181) at org.apache.naming.NamingContext.lookup(NamingContext.java:822) at org.apache.naming.NamingContext.lookup(NamingContext.java:181) at org.apache.naming.NamingContext.lookup(NamingContext.java:822) at org.apache.naming.NamingContext.lookup(NamingContext.java:194) at org.apache.naming.SelectorContext.lookup(SelectorContext.java:183) at javax.naming.InitialContext.lookup(InitialContext.java:354) at top.Utils.getJDO(Utils.java:31) Here is the code that I am using to get the JDO instance: package top; // imports public class Utils { public static synchronized JDO getJDO() throws NamingException, SQLException, MappingException { ClassLoader loader = Utils.class.getClassLoader(); URL url = loader.getResource("database.xml"); JDO.loadConfiguration(url.toString()); InitialContext ctx = new InitialContext(); return (JDO) ctx.lookup( "java:comp/env/jdo/videoSearchPPV" ); } } Here is my web.xml: Resource reference to DataSource jdbc/videoSearchPPV javax.sql.DataSource Container Resource reference to JDO jdo/videoSearchPPV org.exolab.castor.jdo.JDO Container Here is my database.xml: Here is what I put in tomcat's server.xml: factory org.apache.commons.dbcp.BasicDataSourceFactory url jdbc:mysql://localhost:3306/videoSearchPPV password [The password to my database] maxWait 100 maxActive 100 driverClassName com.mysql.jdbc.Driver username videoSearchPPV maxIdle 30000 Any ideas? Thanks, Neil. -- Neil Aggarwal JAMM Consulting, Inc. (972) 612-6056, http://www.JAMMConsulting.com Custom Internet Development Websites, Ecommerce, Java, databases -- To unsubscribe, e-mail: For additional commands, e-mail: