Originally posted by jason jones:
I have installed Web Application Server 4.0 and DB2 version 7.2/Version 7.1 FixPak 3. I have both products running on the same Win2K Server machine (development / evaluation purposes only).
I have followed all the setup instructions as per the documentation for DB2 and everything looks fine. I can query the tables that the scripts create etc through DB2 control center etc, however, when I try to enter the Petstore store, I get the message:
"Unable to Connect to Database Database Connection is closed: Confirm that you have started your database".
When I look in the default_server_stdout.log file I see the following error message:
[01.08.27 20:09:11:988 EDT] 4d58298f Helpers W NMSV0610I: A NamingException is being thrown from a javax.naming.Context implementation. Details follow:
Context implementation: com.ibm.ws.naming.java.javaURLContextRoot
Context method: lookup(String)
Context name: java:
Target name: java:comp/env/jdbc/EstoreDataSource
Other data:
Exception stack trace: com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while attempting to get an instance of the object for the specified reference object. Root exception is com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while attempting to get an instance of the object for the specified reference object. Root exception is javax.naming.NamingException: ClassNotFoundException: COM.ibm.db2.jdbc.DB2ConnectionPoolDataSource
at com.ibm.websphere.advanced.cm.factory.DataSourceFactory$ResourceReferenceObjectFactory.getObjectInstance(DataSourceFactory.java:754)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:308)
at com.ibm.ws.naming.urlbase.UrlContextHelper.isReference(UrlContextHelper.java:115)
at com.ibm.ws.naming.urlbase.UrlContextHelper.processBoundObjectForLookup(UrlContextHelper.java:221)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1181)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1158)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1210)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory.getObjectInstance(IndirectJndiLookupObjectFactory.java:193)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:308)
at com.ibm.ws.naming.urlbase.UrlContextHelper.isReference(UrlContextHelper.java:115)
at com.ibm.ws.naming.urlbase.UrlContextHelper.processBoundObjectForLookup(UrlContextHelper.java:229)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1181)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1158)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1210)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.sun.j2ee.blueprints.tools.populate.web.PopulateServlet.getDBConnection(PopulateServlet.java:359)
at com.sun.j2ee.blueprints.tools.populate.web.PopulateServlet.checkConnection(PopulateServlet.java:179)
at com.sun.j2ee.blueprints.tools.populate.web.PopulateServlet.doGet(PopulateServlet.java:99)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:827)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:159)
at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:286)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:106)
at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:472)
at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:1012)
at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:913)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:499)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:278)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:105)
at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:67)
at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:123)
at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67)
at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:122)
at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:315)
at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java:60)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:313)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:242)
at com.ibm.ws.util.CachedThread.run(ThreadPool.java:122)
Is there another db driver that I should be using instead of COM.ibm.db2.jdbc.DB2ConnectionPoolDataSource?
Thanks
Jason
[email protected]
Originally posted by meddie katongole:
Jason,
Did you try to access the database from the Command Line Processor?
It is under IBM DB2>> Command Line Processor.
See if that helps.
Meddie
Originally posted by jason jones:
I am not sure how that will help. The database does seem to be online and available from within the Db2 tools, however, when the Petstore demo attempts to access the database via jdbc I get the error message described below.
Originally posted by meddie katongole:
You connect to the database using "connect to db" where db is the name of the database and it tells you whether you have a connection or not.
Try it and see.
Originally posted by jason jones:
I found the problem. It appears that by default JDBC 1.0 is installed - and it has no concept of connection pooling. The following article http://www-4.ibm.com/software/webservers/appserv/v4_faqs.html#11 points to instructions that explain how to upgrade to JDBC 2.0.
Originally posted by jason jones:
I found the problem. It appears that by default JDBC 1.0 is installed - and it has no concept of connection pooling. The following article http://www-4.ibm.com/software/webservers/appserv/v4_faqs.html#11 points to instructions that explain how to upgrade to JDBC 2.0.
Best Regards,<br />Nagendra Prasad.
Clowns were never meant to be THAT big! We must destroy it with this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|