roller-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Levine <levine_br...@hotmail.com>
Subject DB connection pooling
Date Fri, 16 Oct 2009 00:50:59 GMT


I'm trying to setup DB Connection pooling with roller, but I'm having trouble.

I'm using tomcat 5.5 and mysql 5.x.

I've placed a context.xml file in the META_INF directory that looks like this:

<Context debug="0">

  <Resource name="jdbc/rollerdb" auth="Container" type="javax.sql.DataSource"
    driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/rollerblog?autoReconnect=true"
    username="blevine"
    password=xxxxxx
    maxActive="20" maxIdle="3" removeAbandoned="true" maxWait="3000" />

  <Resource name="mail/Session" auth="Container" type="javax.mail.Session"
     mail.smtp.host="smtp-server.example.com" />

</Context>

And then created the WAR and deployed it.

When I load up roller in my browser (firefox) I get this error:

A database error occurred, probably because your database connection
is misconfigured. You will have to fix this problem and then restart or
redeploy Roller before you can proceed. Here's what happened when
Roller tried to establish a connection:

SUCCESS: Got parameters. Using configuration type JNDI_NAME-- Using JNDI datasource name:
java:comp/env/jdbc/rollerdbSUCCESS: located JNDI DataSource [java:comp/env/jdbc/rollerdb]ERROR:
unable to obtain database connection. Likely problem: bad connection parameters or database
unavailable.
 [org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect
URL 'null'
	at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150)
	at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
	at org.apache.roller.weblogger.business.DatabaseProvider.getConnection(DatabaseProvider.java:179)
	at org.apache.roller.weblogger.business.DatabaseProvider.<init>(DatabaseProvider.java:141)
	at org.apache.roller.weblogger.business.startup.WebloggerStartup.prepare(WebloggerStartup.java:171)
	at org.apache.roller.weblogger.ui.core.RollerContext.contextInitialized(RollerContext.java:138)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)
	at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:448)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:177)
Caused by: java.lang.NullPointerException
	at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507)
	at sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:476)
	at sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307)
	at java.sql.DriverManager.getDriver(DriverManager.java:253)
	at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143)
	... 33 more]
I removed the "docBase" and "path" attributes from the "Context" element because I saw something
in the tomcat docs that says leaving those in will mess up the deployment.  I tried it with
those in and got the same errors.

I copied over the url, username, password, and driverClassName from roller-custom.properties
so I'm pretty sure those were right.

Anyone have any suggestions?

Thanks!
/Brian

 		 	   		  
_________________________________________________________________
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
http://clk.atdmt.com/GBL/go/177141664/direct/01/
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message