~信~仰~
2018-08-10
1551浏览量
代码运行报错:
----------> Parent Classloader:
java.net.URLClassLoader@1c53fd30
:
java.lang.ClassNotFoundException: org.springframework.dao.TransientDataAccessResourceException
八月 10, 2018 5:45:28 下午 com.caucho.hessian.io.SerializerFactory getDeserializer
警告: Hessian/Burlap: 'org.springframework.dao.TransientDataAccessResourceException' is an unknown class in ParallelWebappClassLoader
context: cc-web
delegate: false
----------> Parent Classloader:
java.net.URLClassLoader@1c53fd30
:
java.lang.ClassNotFoundException: org.springframework.dao.TransientDataAccessResourceException
com.weibo.api.motan.exception.MotanServiceException: error_message: biz exception cause is throwable error:class java.lang.Throwable, errmsg:PreparedStatementCallback; SQL [SELECT `free_pricing` FROM `account` WHERE `account_id`=?]; Before start of result set, status: 503, error_code: 10001,r=null
at com.weibo.api.motan.proxy.RefererInvocationHandler.invoke(RefererInvocationHandler.java:127)
at com.sun.proxy.$Proxy71.getFreePricingStatus(Unknown Source)
at com.btzh.resource.ProfileResource.toCopyright(ProfileResource.java:285)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
@Override
public YesOrNo getFreePricingStatus(Integer accountId) {
return jdbcTemplate.query("SELECT `free_pricing` FROM `account` WHERE `account_id`=?", new Object[] { accountId }, new ResultSetExtractor<YesOrNo>() {
@Override
public YesOrNo extractData(ResultSet rs) throws SQLException, DataAccessException {
return YesOrNo.getByValue(rs.getInt("free_pricing"));
}
});
}
@Override
public YesOrNo getFreePricingStatus(Integer accountId) {
return jdbcTemplate.query("SELECT `free_pricing` FROM `account` WHERE `account_id`=?", new Object[] { accountId }, new ResultSetExtractor<YesOrNo>() {
@Override
public YesOrNo extractData(ResultSet rs) throws SQLException, DataAccessException {
if (rs.next()) {
return YesOrNo.getByValue(rs.getInt("free_pricing"));
}
return YesOrNo.NO;
}
});
}
好了. 但是没想清楚为什么单元测试没有报错, 待续.
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
分享数据库前沿,解构实战干货,推动数据库技术变革