Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Cloudscape Database with JSP

Status
Not open for further replies.

webdev17

Programmer
Feb 6, 2006
33
US
Hi,

I am working on a java web application that uses JSP, EJBs, and struts. The EJB is being used to call the connection to a Cloudscape database (I am restricted to using this type of database).

The call to the database looks like this:

Code:
String aDataSourceName   = "java:comp/env/jdbc/fitnessDS";
		String aUserId           = "user";
		String aPassword         = "admin";

		//get the connection from the Factory
		System.out.println("getting connection");        
		/*DbConnectionFactory df = new DbConnectionFactory();
		conn = df.createDbConnection(aDataSourceName, aUserId, aPassword);*/
		ServiceLocator loc = ServiceLocator.getInstance();
		DataSource ds = (DataSource)loc.getObject(aDataSourceName);
		conn = ds.getConnection(aUserId, aPassword);

This connection is failing. Does anyone know why this isn't working?

The error Rational Application Developer is throwing looks like this:

Code:
3/2/07 8:54:20:867 EST]  4380438 FreePool      E J2CA0046E: Method createManagedConnctionWithMCWrapper caught an exception during creation of the ManagedConnection for resource jdbc/fitnessDS, throwing ResourceAllocationException.  Original exception: com.ibm.ws.exception.WsException: DSRA8100E: Unable to get a PooledConnection from the DataSource. with SQL State : XJ004 SQL Code : 40000
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:80)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:44)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:315)
	at com.ibm.websphere.rsadapter.GenericDataStoreHelper.mapExceptionHelper(GenericDataStoreHelper.java:481)
	at com.ibm.websphere.rsadapter.GenericDataStoreHelper.mapException(GenericDataStoreHelper.java:524)
	at com.ibm.ws.rsadapter.spi.WSRdbDataSource.getPooledConnection(WSRdbDataSource.java:762)
	at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl.createManagedConnection(WSManagedConnectionFactoryImpl.java:764)
	at com.ibm.ejs.j2c.poolmanager.FreePool.createManagedConnectionWithMCWrapper(FreePool.java:1332)
	at com.ibm.ejs.j2c.poolmanager.FreePool.createOrWaitForConnection(FreePool.java:1133)
	at com.ibm.ejs.j2c.poolmanager.PoolManager.reserve(PoolManager.java:1748)
	at com.ibm.ejs.j2c.ConnectionManager.allocateMCWrapper(ConnectionManager.java:712)
	at com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:465)
	at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:242)
	at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:337)
	at ejbs.FitnessBean.getEllipticalSummaryInfo(FitnessBean.java)
	at ejbs.EJSRemoteStatelessFitness_b93ff16a.getEllipticalSummaryInfo(EJSRemoteStatelessFitness_b93ff16a.java:35)
	at ejbs._Fitness_Stub.getEllipticalSummaryInfo(_Fitness_Stub.java:256)
	at presentation.SummaryAction.getEllipticalSummaryInfo(SummaryAction.java:93)
	at presentation.SummaryAction.perform(SummaryAction.java:60)
	at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1787)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1586)
	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
	at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
	at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
	at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
	at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
	at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
	at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
	at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:1171)
	at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:676)
	at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:203)
	at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:125)
	at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:294)
	at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
	at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
	at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
	at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
	at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:652)
	at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:448)

Thanks!
 
I guess you didn't configure the data pool in your server.

Cheers,
Dian
 
I do not prefer to cloudscape with IBM websphere. It looks cloudscape will create a deadlock on a file for using it under websphere. I prefer to use IBM DB2. You can try DB2 if you can find any evaluation version.

MySQL can also work great with websphere if you can configure well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top