0 Replies Latest reply: Apr 22, 2011 7:26 AM by Xiaobin Zhanginside RSS

Closing a connection for you.  Please close them yourself: org.jboss.resource.adapter.jdbc.jdk5.WrappedConnectionJDK5

Xiaobin Zhanginside Newbie

Hi ,

     I get exception when i tried to call a procedure through JdbcTemplate,and a i get exception:

    

    

18:38:51,086 INFO  [CachedConnectionManager] Closing a connection for you.  Please close them yourself: org.jboss.resource.adapter.jdbc.jdk5.WrappedConnectionJDK5@17093d8

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 org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:113)

at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:79)

at com.ge.transportation.appliedtimesystem.dao.impl.ATSTimesheetDaoImpl.insertUpdateATSTimesheets(ATSTimesheetDaoImpl.java:116)

at com.ge.transportation.appliedtimesystem.service.impl.ATSTimesheetManagerImpl.insertUpdateATSTimesheets(ATSTimesheetManagerImpl.java:100)

at com.ge.transportation.appliedtimesystem.bean.ATSTimesheetBean.saveTimesheet(ATSTimesheetBean.java:430)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.apache.el.parser.AstValue.invoke(AstValue.java:131)

at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)

at org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:68)

at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)

at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)

at javax.faces.component.UICommand.broadcast(UICommand.java:387)

at org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:55)

at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:324)

at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:299)

at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:256)

at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:469)

at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)

at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)

at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at com.ge.transportation.appliedtimesystem.filter.AuthFilter.doFilter(AuthFilter.java:178)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)

at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)

at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)

at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

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(Unknown Source)

 

my code:

public String[] insertUpdateATSTimesheets(long sso, long fiscalYear,

   long fiscalWeek, long component, char status, String[] datas)

   throws ATSException {

  logger.info("call ats_timesheet_upgrade_pkg.SP_ATS_INSUP_TIMESHEET");

  String sql = "call ats_timesheet_upgrade_pkg.SP_ATS_INSUP_TIMESHEET(?,?,?,?,?,?,?,?,?)";

  Connection conn = null;

  oracle.jdbc.OracleConnection oracleConn = null;

  String[] retVal = null;

  InsertUpdateATSTimesheetsCallback call = null;

  try {

   conn = DataSourceUtils.getConnection(this.getDataSource());

   conn = this.getJdbcTemplate().getNativeJdbcExtractor().getNativeConnection(conn);

   oracleConn = (oracle.jdbc.OracleConnection) conn;

   ArrayDescriptor arrayDesc = ArrayDescriptor.createDescriptor("TAB_ARRAY", oracleConn);

   ARRAY vArr = new ARRAY(arrayDesc, oracleConn, datas);

   call = new InsertUpdateATSTimesheetsCallback(sso, fiscalYear, fiscalWeek, component, status, datas , vArr , oracleConn);

   retVal =  (String[]) getJdbcTemplate().execute(sql, call);

  } catch (SQLException e) {

   logger.error(e.getSQLState());

  }finally{

   if(conn != null){

    try {

     conn.close();

    } catch (SQLException e) {

     throw new ATSException(e);

    }

   }

   if(oracleConn != null){

    try {

     oracleConn.close();

    } catch (SQLException e) {

     throw new ATSException(e);

    }

   }

  }

  return retVal;

}

 

private static class InsertUpdateATSTimesheetsCallback implements CallableStatementCallback{

  private long sso;

  private long fiscalYear;

  private long fiscalWeek;

  private long component;

  private char status;

  private String[] datas;

  private ARRAY vArr;

 

  private  Connection connection;

  /* (non-Javadoc)

   * @see org.springframework.jdbc.core.CallableStatementCallback#doInCallableStatement(java.sql.CallableStatement)

   */

 

  @Override

  public Object doInCallableStatement(CallableStatement cs)

    throws SQLException, DataAccessException {

   cs.setLong(1, this.sso);

   cs.setLong(2, this.fiscalYear);

   cs.setLong(3, this.fiscalWeek);

   cs.setLong(4, this.component);

   cs.setString(5, this.status+"");

   cs.setArray(6, vArr);

   cs.registerOutParameter(7, OracleTypes.CHAR);

   cs.registerOutParameter(8, OracleTypes.VARCHAR);

   cs.registerOutParameter(9, OracleTypes.VARCHAR);

   cs.execute();

   String psStatusOut = String.valueOf(cs.getString(7)).trim();

   String statusMessage = cs.getString(8) == null ? "" : cs.getString(8);

   return new String[]{psStatusOut , statusMessage};

  }

 

can anyone help me.

thanks!