Troubleshooting: "Bad or missing database configuration" error with DB2 datasource (WebSphere)
Symptom
When connecting to a DB2 database using a datasource through WebSphere, the connection fails even though:
- all the DB2 connectivity jar files are correctly referenced in the JDBC Provider
- the datasource connection tests successfully from WebSphere:
The DB2 connectivity jar files are:
- db2jcc_license.jar
- db2jcc_license_cisuz.jar
- db2jcc_license_cu.jar
- db2jcc.jar
When the connection fails, the following error message appears:
[1/4/07 11:28:38:545 CST] 00000069 SystemOut O 11:28:38,545 [nectorThreadPool : 2] ( etier.engine.EngineStartup) ERROR - PegaRULES cannot initialize due to a bad or missing database configuration.
[1/4/07 11:28:38:559 CST] 00000069 SystemOut O 11:28:38,551 [nectorThreadPool : 2] ( etier.engine.EngineStartup) ERROR - Reason:
com.pega.pegarules.pub.database.BadDatabaseDefinitionException: Database-BadDBDef-Missing pegarules
From: (unknown)
at com.pega.pegarules.engine.database.ConnectionManager.
getDBConfig(ConnectionManager.java:1896)
at com.pega.pegarules.engine.database.ConnectionManager.
getConnection(ConnectionManager.java:810)
at com.pega.pegarules.engine.database.ConnectionManager.
getConnection(ConnectionManager.java:779)
at com.pega.pegarules.etier.impl.EngineImpl.doStartup(EngineImpl.java:98)
at com.pega.pegarules.web.servlet.WebAppLifeCycleListener.
contextInitialized(WebAppLifeCycleListener.java:194)
at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1355)
at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:371)
at com.ibm.ws.webcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:114)
at com.ibm.ws.webcontainer.VirtualHost.addWebApplication(VirtualHost.java:127)
at com.ibm.ws.webcontainer.WebContainer.addWebApp(WebContainer.java:776)
at com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:729)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:683)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1161)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1366)
at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:1012)
at mx4j.server.interceptor.InvokerMBeanServerInterceptor.invoke(InvokerMBeanServerInterceptor.java:233)
at
mx4j.server.interceptor.ContextClassLoaderMBeanServerInterceptor.invoke(ContextClassLoaderMBeanServerInterceptor.java:167)
at mx4j.server.MX4JMBeanServer.invoke(MX4JMBeanServer.java:1249)
at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:901)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java(Compiled Code))
at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:817)
at com.ibm.ws.management.connector.AdminServiceDelegator.invoke(AdminServiceDelegator.java:139)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at com.ibm.ws.management.connector.soap.SOAPConnector.invoke(SOAPConnector.java(Compiled Code))
at com.ibm.ws.management.connector.soap.SOAPConnector.service(SOAPConnector.java(Compiled Code))
at com.ibm.ws.management.connector.soap.SOAPConnection.handleRequest(SOAPConnection.java(Compiled Code))
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java(Compiled Code))
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java(Compiled Code))
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
The following error message is displayed when you are attempting the same connection through a Data-Admin-DB-Name instance:
Solution
Resolution
This issue is caused by an environment variable in WebSphere’s JAVA_CLASSPATH
that points to DB2 JDBC drivers. This environment variable overrides the JDBC Provider settings created during installation.
Note: This is not an area where you normally make changes. If the DB2 driver references are in the WebSphere JAVA_CLASSPATH
, it means the JAVA_CLASSPATH
was inadvertently edited during installation.
To resolve this issue, use WebSphere’s Administrative console to update the JAVA_CLASSPATH
and remove all references to DB2 and JDBC. Thereafter, all connections to the database are made using the settings in the JDBC datasource.
For information on using the WebSphere Administration console, see the WebSphere Administration guide.
For information on creating a JDBC Provider, see the Install Guide for your Process Commander version.