Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-dev] JNDI not creating database pool with com.mysql.jdbc.Driver

(Reposting in this new thread under a more appropriate Subject)

I am running Jetty 7. I want to use pooled database connections so I
use the WEB-INF/jetty-env.xml quoted below.

I know jetty is reading the jetty-env.xml, because if I replace

org.eclipse.jetty.plus.jndi.Resource, or
org.apache.commons.dbcp.BasicDataSource

with nonsense strings the deployer complains.

However my java:comp/env context is completely empty. Also if I replace

com.mysql.jdbc.Driver

with nonsense, the deployer does not care. The database log shows no
activity from jetty.

Any ideas? Anyone?

********************* jetty-env.xml ***********************
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN"
"http://www.eclipse.org/jetty/configure.dtd";>

<Configure class="org.eclipse.jetty.webapp.WebAppContext">
	<New id="DataSource" class="org.eclipse.jetty.plus.jndi.Resource">
		<Arg>jdbc/mydb</Arg>
		<Arg>
			<New class="org.apache.commons.dbcp.BasicDataSource">
				<Set name="driverClassName">com.mysql.jdbc.Driver</Set>
				<Set name="url">jdbc:mysql://localhost/mydb</Set>
				<Set name="username">dbuser</Set>
				<Set name="password">dbpass</Set>
			</New>
		</Arg>
	</New>
</Configure>


Back to the top