Hi Sean,

> --- Ursprüngliche Nachricht ---
> Von: Sean Rowe <[EMAIL PROTECTED]>
> An: tomcat-user@jakarta.apache.org
> Betreff: jndi question
> Datum: Mon, 22 Aug 2005 01:26:49 -0500
> 
> I have tried for several hours now to get connection pooling for my 
> MySql database to work, but have been unable to do so.  I keep getting 
> this error:
> 
> javax.naming.NoInitialContextException: Cannot instantiate class:
> org.apache.commons.dbcp.BasicDataSourceFactory
> 
> 
 
> It's bombing out on this code:
> 
>     Properties p=new Properties();
>      
>
p.put(Context.INITIAL_CONTEXT_FACTORY,"org.apache.commons.dbcp.BasicDataSourceFactory");
>      p.put(Context.PROVIDER_URL,"jdbc:mysql://localhost:3306");
>      Context initCtx = new InitialContext(p); // here's where it dies
> 

You're mixing up some concepts here. Context.INITIAL_CONTEXT_FACTORY is
meant to provide the name of a factory producing JNDI contexts, not a
factory for producing JDBC DataSources. The same goes for the next line of
code. Context.PROVIDER_URL is not used for providing information about a
database connection.

There is extensive documentation on the tomcat web site regarding JNDI
ressource configuration. Have a look at the following URL:

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

> Can someone please help me, or at least point me in the direction of 
> some documentation that I've missed?  I've searched google and every 
> other search engine I can think of.  Thanks in advance.
> 
> Sean Rowe
> 

Regards
        Dirk

-- 
GMX DSL = Maximale Leistung zum minimalen Preis!
2000 MB nur 2,99, Flatrate ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to