0 Replies Latest reply on Jun 10, 2005 8:42 AM by Louis Masters

    JBoss 4, Sybase ASA 9:  datasource getConnection throwing ex

    Louis Masters Newbie

      I'm setting up JBoss 4 with Sybase ASA 9 and jconnect 5. I created a sybase-ds.xml file and deployed it. JBoss boots and connects to the Sybase DB (I can see the initial 10 connections), but when I try to log into my app, I get an exception coming from my datasource.getConnection() call. The exception stack is:

      2005-06-10 07:57:36,322 INFO [org.jboss.resource.connectionmanager.CachedConnectionManager] Closing a connection for you. Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@198046
      java.lang.Exception: STACKTRACE
      at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:321)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:467)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:874)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:103)
      at com.lognet.interfaces.DatabaseInterface.getDatabaseConnection(DatabaseInterface.java:127)
      at com.lognet.interfaces.DatabaseInterface.getDatabaseConnection(DatabaseInterface.java:33)
      at com.lognet.ejb.dispatcher.DispatcherBean.dispatch(DispatcherBean.java:82)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      ...


      My ds xml file follows:

      <datasources>
      <local-tx-datasource>
       <jndi-name>sybasePool</jndi-name>
       <connection-url>jdbc:sybase:Tds:1.1.1.1:2638?ServiceName=DBNAME;CON=JBOSS</connection-url>
       <driver-class>com.sybase.jdbc2.jdbc.SybDriver</driver-class>
       <user-name>xxx</user-name>
       <password>xxx</password>
       <min-pool-size>40</min-pool-size>
       <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.SybaseExceptionSorter</exception-sorter-class-name>
      
       <metadata>
       <type-mapping>Sybase</type-mapping>
       </metadata>
      </local-tx-datasource>
      </datasources>


      My java code is:

      InitialContext ctx = new InitialContext();
      DataSource ds = (DataSource) ctx.lookup("java:"+pool);
      conn = ds.getConnection(); //EXCEPTION HERE



      Please tell me I configured something wrong.
      Thanks.