Cannot connect to database

What happened?

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/rollerdb
  • SUCCESS: located JNDI DataSource [java:comp/env/jdbc/rollerdb]
  • ERROR: unable to obtain database connection. Likely problem: bad connection parameters or database unavailable.

Why did that happen?

In case the clues above are not enough to help you figure out what is going wrong, here are some more details. The root cause of the problem is an exception of type [org.apache.tomcat.dbcp.dbcp.SQLNestedException]

To help you debug the problem, here is the stack trace for that exception:

    [org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Io exception: The Network Adapter could not establish the connection)
	at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1232)
	at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
	at org.apache.roller.weblogger.business.DatabaseProvider.getConnection(DatabaseProvider.java:178)
	at org.apache.roller.weblogger.business.DatabaseProvider.<init>(DatabaseProvider.java:140)
	at org.apache.roller.weblogger.business.startup.WebloggerStartup.prepare(WebloggerStartup.java:169)
	at org.apache.roller.weblogger.ui.core.RollerContext.contextInitialized(RollerContext.java:140)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4276)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4779)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:803)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:780)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583)
	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:676)
	at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:602)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:503)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1322)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:325)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1069)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1061)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
	at org.apache.catalina.core.StandardService.start(StandardService.java:525)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:761)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)
	at java.lang.reflect.Method.invoke(Method.java:620)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:113)
	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:147)
	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:257)
	at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:389)
	at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:454)
	at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
	at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
	at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:802)
	at org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
	at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
	at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1254)
	at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1228)
	... 29 more]