java stack trace for_junt test方法里的事务完后DEBUG STACK TRACE for PoolBackedDataSource.close()....

spring 注入的dao

Trans.exec(new Molecule(){

public void run() {

try {

for(int i=1;i<=lastRowNum;i++){ //循环每一行开始导入

Unit unit = new Unit();

XSSFRow row = sheet0.getRow(i);

XSSFCell c_address = row.getCell(0);

String address = ExcelUtil.getValue(c_address);

if(StringUtils.isBlank(address))

continue;

//address = 延安西路1328弄 7 - 16B

Pattern p=Pattern.compile("\\d*-.*");

Matcher m=p.matcher(address);

m.find();

String pStr = m.group();

String projectAddress = address.substring(0, address.indexOf(pStr));

unit.setProjectId(projectId);

if(null == projectAddressMap.getInt(projectAddress)){

ProjectAddress pa = new ProjectAddress();

pa.setProjectId(projectId);

pa.setName(projectAddress);

pa = dao.insert(pa);

projectAddressMap.put(projectAddress, pa.getId());

}

unit.setUnitAddressId(projectAddressMap.getInt(projectAddress));

String[] temp = pStr.split("-");

//插入building后获取buildingId 放到unit中

Building building = new Building();

building.setBuildingName(temp[0]);

building.setAddressId(projectAddressMap.getInt(projectAddress));

Building fetch = dao.fetch(Building.class,Cnd.where("buildingName", "=", temp[0]).and("addressId", "=", projectAddressMap.getInt(projectAddress)));

if(fetch == null)

building = dao.insert(building);

else

building = fetch;

unit.setUnitBuildingId(building.getId());

unit.setUnitName(temp[1]);

unit.setBuildingArea(Float.parseFloat(

ExcelUtil.getValue(

row.getCell(3)

)));

unit.setRoomPropertyId(roomPropertyMap.getInt(ExcelUtil.getValue(

row.getCell(1)

)));

unit.setPropertyTypeId(propertyTypeMap.getInt(ExcelUtil.getValue(

row.getCell(2)

)));

unit.setContactName(ExcelUtil.getValue(row.getCell(5)));

unit.setContactPhone(ExcelUtil.getValue(row.getCell(6)));

unit.setResidentsPopulation(StringUtils.isNoneBlank(ExcelUtil.getValue(row.getCell(9)))?(Integer.parseInt(ExcelUtil.getValue(row.getCell(9)))):null);

dao.insert(unit);

}

} catch (Exception e) {

e.printStackTrace();

throw new DaoException("e");

}

}

});

调试看着是循环正常结束了 但是报这个错误

java.lang.Exception: DEBUG STACK TRACE for PoolBackedDataSource.close().

at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.close(AbstractPoolBackedDataSource.java:417)

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

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.springframework.beans.factory.support.DisposableBeanAdapter.invokeCustomDestroyMethod(DisposableBeanAdapter.java:353)

at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:276)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:578)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:554)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:972)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:523)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:979)

at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1000)

at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:976)

at org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:895)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值