4 Replies Latest reply on Oct 25, 2001 8:47 PM by David Jencks

    ConnectionPoolDataSource

    Blaise Rudaz Newbie

      platform : JBoss-2.4.3_Tomcat-3.2.3
      database : MS SQL Server 2000

      This portion of code works fine :

      Context ctx = new InitialContext();
      DataSource ds = (DataSource)ctx.lookup(aContext);
      Connection con = ds.getConnection();

      But this one produce the following error :
      //-------------------------------------------------
      Context ctx = new InitialContext() ;
      ConnectionPoolDataSource ds =(ConnectionPoolDataSource) ctx.lookup(aContext) ;
      PooledConnection pcon = ds.getPooledConnection("sa","") ;
      //-------------------------------------------------
      ERROR :
      //-------------------------------------------------
      [Default] java.lang.ClassCastException: org.jboss.pool.jdbc.xa.XAPoolDataSource
      [Default] at jaccess.NorthwindBean.connectionPoolConnect(NorthwindBean.java:87)
      [Default]
      [Default] at jaccess.NorthwindBean.testDriverManager(NorthwindBean.java:50)
      [Default]
      [Default] at java.lang.reflect.Method.invoke(Native Method)
      [Default]
      [Default] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:54
      3)
      [Default]
      [Default] at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:276)
      [Default]
      [Default] at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.
      java:87)
      [Default]
      [Default] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:128)
      [Default]
      [Default] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
      [Default]
      [Default] at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:286)
      [Default]
      [Default] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:489)
      [Default]
      [Default] at org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericProxy.java:335)
      [Default]
      [Default] at org.jboss.ejb.plugins.jrmp.interfaces.StatelessSessionProxy.invoke(StatelessSessionProxy.java:123)
      [Default]
      [Default] at $Proxy24.testDriverManager(Unknown Source)
      [Default]
      [Default] at jaccess.NorthwindServlet.doPost(NorthwindServlet.java:78)
      [Default]
      [Default] at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      [Default]
      [Default] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      [Default]
      [Default] at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
      [Default]
      [Default] at org.apache.tomcat.core.Handler.service(Handler.java:287)
      [Default]
      [Default] at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
      [Default]
      [Default] at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
      [Default]
      [Default] at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
      [Default]
      [Default] at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213
      )
      [Default]
      [Default] at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
      [Default]
      [Default] at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
      [Default]
      [Default] at java.lang.Thread.run(Thread.java:484)
      [Default]

      Can anyone help me ! Thanks in advance -Blaise