Return-Path: Delivered-To: apmail-xml-cocoon-users-archive@xml.apache.org Received: (qmail 86015 invoked by uid 500); 27 Jun 2002 19:00:40 -0000 Mailing-List: contact cocoon-users-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-users@xml.apache.org Delivered-To: mailing list cocoon-users@xml.apache.org Received: (qmail 86001 invoked from network); 27 Jun 2002 19:00:40 -0000 Message-ID: <20020627190044.77178.qmail@web20412.mail.yahoo.com> Date: Thu, 27 Jun 2002 12:00:44 -0700 (PDT) From: Joshua McCulloch Subject: J2EE Datasources To: cocoon-users@xml.apache.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: 209.66.108.5 1.6.2 0/1000/N Hello, I'd like to know if anyone is using J2EE defined datasources in Cocoon? I'm trying unsucessfully to connect to a MySQL database using the Orion J2EE server. I've defined a datasource in Orion: I can get a javax.sql.DataSource using the following code from within a custom class called by a custom Transformer: DataSource ds = (DataSource) new InitialContext().lookup("jdbc/MysqlDS"); I then defined this datasource in cocoon.xconf: MysqlDS When Cocoon starts, this occurs in the error.log: ERROR (2002-06-27) 11:58.24:441 [core.datasources.myhms-datasource] (Unknown-URI) Unknown-thread/LogKitLogger: Problem with JNDI lookup of datasource javax.naming.NameNotFoundException: jdbc/MysqlDS not found in Cocoon2 Demo at com.evermind._lj.lookup(.:49) at com.evermind._bm._es(.:121) at com.evermind._bm.lookup(.:63) at javax.naming.InitialContext.lookup(InitialContext.java:345) at org.apache.avalon.excalibur.datasource.J2eeDataSource.configure(J2eeDataSource.java:63) at org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstance(DefaultComponentFactory.java:172) at org.apache.avalon.excalibur.component.ThreadSafeComponentHandler.initialize(ThreadSafeComponentHandler.java:84) at org.apache.avalon.excalibur.component.ExcaliburComponentSelector.addComponent(ExcaliburComponentSelector.java:467) at org.apache.avalon.excalibur.component.ExcaliburComponentSelector.configure(ExcaliburComponentSelector.java:354) at org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstance(DefaultComponentFactory.java:172) at org.apache.avalon.excalibur.component.ThreadSafeComponentHandler.initialize(ThreadSafeComponentHandler.java:84) at org.apache.avalon.excalibur.component.ExcaliburComponentManager.initialize(ExcaliburComponentManager.java:167) at org.apache.cocoon.Cocoon.initialize(Cocoon.java:269) at org.apache.cocoon.servlet.CocoonServlet.createCocoon(CocoonServlet.java:1212) at org.apache.cocoon.servlet.CocoonServlet.init(CocoonServlet.java:407) I haven't worked with JNDI before. What am I missing? I looked at J2eeDataSource.java and found it was calling InitialContext.lookup( "java:comp/env/jdbc/" + "MysqlDS") I tried changing the datasource location attribute to "java:comp/env/jdbc/MysqlDS" which didn't do anything, not that I was really expecting it to... __________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. To unsubscribe, e-mail: For additional commands, e-mail: