1 Reply Latest reply on Nov 12, 2008 10:59 AM by Peter Johnson

    JNDI/JDBC error

    Yuriy Sherst Newbie

      Hi all.

      I am trying to run web application and get error:

      2008-11-12 10:31:33,344 INFO [org.jboss.resource.connectionmanager.CachedConnectionManager] Closing a connection for you. Please close them yourself: org.jboss.resource.adapter.jdbc.jdk5.WrappedConnectionJDK5@376cc3
      java.lang.Throwable: STACKTRACE
      at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:290)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:423)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:849)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)
      at com.avalbank.cardstat.DBWork.connect(DBWork.java:87)
      at com.avalbank.cardstat.DBWork.<init>(DBWork.java:67)
      at com.avalbank.cardstat.DBWorkSes.<init>(DBWorkSes.java:12)
      at org.apache.jsp.epoint_jsp._jspService(epoint_jsp.java:105)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
      at java.lang.Thread.run(Thread.java:595)
      2008-11-12 10:33:21,248 DEBUG [com.arjuna.ats.arjuna.logging.arjLogger] Periodic recovery - first pass <�р, 12 ли�т 2008 10:33:21>
      2008-11-12 10:33:21,248 DEBUG [com.arjuna.ats.arjuna.logging.arjLogger] StatusModule: first pass
      2008-11-12 10:33:21,248 DEBUG [com.arjuna.ats.txoj.logging.txojLoggerI18N] [com.arjuna.ats.internal.txoj.recovery.TORecoveryModule_3] - TORecoveryModule - first pass
      2008-11-12 10:33:21,248 DEBUG [com.arjuna.ats.jta.logging.loggerI18N] [com.arjuna.ats.internal.jta.recovery.info.firstpass] Local XARecoveryModule - first pas



      Web.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
      
      <web-app>
       <welcome-file-list>
       <welcome-file>epoint.jsp</welcome-file>
       </welcome-file-list>
       <resource-ref>
       <res-ref-name>jdbc/cardstat-ds</res-ref-name>
       <res-type>javax.sql.DataSource</res-type>
       <res-auth>Container</res-auth>
       <res-sharing-scope>Shareable</res-sharing-scope>
       </resource-ref>
      </web-app>
      


      jboss-web.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
      
      <jboss-web>
       <!-- <context-root>cardstat</context-root> -->
       <resource-ref>
       <res-ref-name>jdbc/cardstat-ds</res-ref-name>
       <jndi-name>java:jdbc/cardstat-ds</jndi-name>
       </resource-ref>
      
      </jboss-web>




      java class

      void connect(/*String user, String pass*/) throws SQLException,
       ClassNotFoundException, Exception
       {
      
       InitialContext ic = new InitialContext();
       pool = (DataSource) ic.lookup("java:jdbc/cardstat-ds");
      
       basa = pool.getConnection();
       basa.setAutoCommit(false);
       }