NutzCN Logo
精华 sql语法异常
发布于 3074天前 作者 黄海峰 1611 次浏览 复制 上一个帖子 下一个帖子
标签:

Sql sql = createSQL(NAME_SPACE,"fetchAdoptCount");
sql.params().set("uid", uid);
sql.setCallback(Sqls.callback.integer());
nutDao.execute(sql);
return sql.getNumber().intValue();
以上是我的代码:
获取到的sql是:select count(*) as adoptCount from qiu_answer where uid = and type =1
添加的uid条件是:6131720219623690240

将以上debug获取的sql在Navicat上执行获取结果14.

执行nutDao.execute(sql);抛异常
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? and type =1' at line 1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_60]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_60]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_60]
at java.lang.reflect.Constructor.newInstance(Constructor.java:422) ~[na:1.8.0_60]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) ~[mysql-connector-java-5.1.18.jar:na]

能看出原因吗?
10 回复

报错前的日志也贴出来,用菜单里的代码按钮

来自炫酷的 NutzCN

2016-06-16 14:03:04,140 [main] DEBUG o.s.t.c.s.AbstractDirtiesContextTestExecutionListener - Before test method: context [DefaultTestContext@2118cddf testClass = UserControllerTest, testInstance = cc.yanshu.thething.controller.UserControllerTest@67d32a54, testMethod = testUserHome@UserControllerTest, testException = [null], mergedContextConfiguration = [WebMergedContextConfiguration@17a7f733 testClass = UserControllerTest, locations = '{classpath:applicationContext.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.test.context.web.WebDelegatingSmartContextLoader', parent = [null]]], class annotated with @DirtiesContext [false] with mode [null], method annotated with @DirtiesContext [false] with mode [null]. 
2016-06-16 14:03:04,169 [main] DEBUG o.s.t.w.s.TestDispatcherServlet - Initializing servlet '' 
2016-06-16 14:03:04,172 [main] DEBUG o.s.w.c.s.StandardServletEnvironment - Adding [servletConfigInitParams] PropertySource with lowest search precedence 
2016-06-16 14:03:04,172 [main] DEBUG o.s.w.c.s.StandardServletEnvironment - Adding [servletContextInitParams] PropertySource with lowest search precedence 
2016-06-16 14:03:04,172 [main] DEBUG o.s.w.c.s.StandardServletEnvironment - Adding [systemProperties] PropertySource with lowest search precedence 
2016-06-16 14:03:04,172 [main] DEBUG o.s.w.c.s.StandardServletEnvironment - Adding [systemEnvironment] PropertySource with lowest search precedence 
2016-06-16 14:03:04,172 [main] DEBUG o.s.w.c.s.StandardServletEnvironment - Initialized StandardServletEnvironment with PropertySources [servletConfigInitParams,servletContextInitParams,systemProperties,systemEnvironment] 
2016-06-16 14:03:04,172 [main] INFO  o.s.mock.web.MockServletContext - Initializing Spring FrameworkServlet '' 
2016-06-16 14:03:04,172 [main] INFO  o.s.t.w.s.TestDispatcherServlet - FrameworkServlet '': initialization started 
2016-06-16 14:03:04,172 [main] DEBUG o.s.t.w.s.TestDispatcherServlet - Unable to locate MultipartResolver with name 'multipartResolver': no multipart request handling provided 
2016-06-16 14:03:04,173 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver' 
2016-06-16 14:03:04,173 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' 
2016-06-16 14:03:04,178 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' 
2016-06-16 14:03:04,178 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' 
2016-06-16 14:03:04,178 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver' 
2016-06-16 14:03:04,178 [main] DEBUG o.s.t.w.s.TestDispatcherServlet - Unable to locate LocaleResolver with name 'localeResolver': using default [org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver@2349f14d] 
2016-06-16 14:03:04,179 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.web.servlet.theme.FixedThemeResolver' 
2016-06-16 14:03:04,179 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' 
2016-06-16 14:03:04,182 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' 
2016-06-16 14:03:04,182 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' 
2016-06-16 14:03:04,182 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.web.servlet.theme.FixedThemeResolver' 
2016-06-16 14:03:04,182 [main] DEBUG o.s.t.w.s.TestDispatcherServlet - Unable to locate ThemeResolver with name 'themeResolver': using default [org.springframework.web.servlet.theme.FixedThemeResolver@706ddbc8] 
2016-06-16 14:03:04,183 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping' 
2016-06-16 14:03:04,183 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping' 
2016-06-16 14:03:04,183 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter' 
2016-06-16 14:03:04,183 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter' 
2016-06-16 14:03:04,183 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter' 
2016-06-16 14:03:04,183 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver#0' 
2016-06-16 14:03:04,183 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver#0' 
2016-06-16 14:03:04,183 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver#0' 
2016-06-16 14:03:04,184 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator' 
2016-06-16 14:03:04,184 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' 
2016-06-16 14:03:04,187 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' 
2016-06-16 14:03:04,187 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' 
2016-06-16 14:03:04,187 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator' 
2016-06-16 14:03:04,187 [main] DEBUG o.s.t.w.s.TestDispatcherServlet - Unable to locate RequestToViewNameTranslator with name 'viewNameTranslator': using default [org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator@25be445f] 
2016-06-16 14:03:04,190 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.web.servlet.view.InternalResourceViewResolver' 
2016-06-16 14:03:04,190 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' 
2016-06-16 14:03:04,202 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' 
2016-06-16 14:03:04,203 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' 
2016-06-16 14:03:04,204 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.web.servlet.view.InternalResourceViewResolver' 
2016-06-16 14:03:04,204 [main] DEBUG o.s.t.w.s.TestDispatcherServlet - No ViewResolvers found in servlet '': using default 
2016-06-16 14:03:04,205 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.web.servlet.support.SessionFlashMapManager' 
2016-06-16 14:03:04,205 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' 
2016-06-16 14:03:04,210 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' 
2016-06-16 14:03:04,210 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' 
2016-06-16 14:03:04,211 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.web.servlet.support.SessionFlashMapManager' 
2016-06-16 14:03:04,211 [main] DEBUG o.s.t.w.s.TestDispatcherServlet - Unable to locate FlashMapManager with name 'flashMapManager': using default [org.springframework.web.servlet.support.SessionFlashMapManager@5e26f1ed] 
2016-06-16 14:03:04,211 [main] DEBUG o.s.t.w.s.TestDispatcherServlet - Published WebApplicationContext of servlet '' as ServletContext attribute with name [org.springframework.web.servlet.FrameworkServlet.CONTEXT.] 
2016-06-16 14:03:04,211 [main] INFO  o.s.t.w.s.TestDispatcherServlet - FrameworkServlet '': initialization completed in 39 ms 
2016-06-16 14:03:04,211 [main] DEBUG o.s.t.w.s.TestDispatcherServlet - Servlet '' configured successfully 
2016-06-16 14:03:04,239 [main] DEBUG o.s.t.w.s.TestDispatcherServlet - DispatcherServlet with name '' processing GET request for [/user/home/6131720219623690240] 
2016-06-16 14:03:04,245 [main] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Looking up handler method for path /user/home/6131720219623690240 
2016-06-16 14:03:04,254 [main] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Returning handler method [public cc.yanshu.thething.common.wrapper.ResponseWrapper cc.yanshu.thething.controller.UserController.userHome(java.lang.Long,org.springframework.http.HttpHeaders)] 
2016-06-16 14:03:04,254 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'userController' 
2016-06-16 14:03:04,255 [main] DEBUG o.s.t.w.s.TestDispatcherServlet - Last-Modified value for [/user/home/6131720219623690240] is: -1 
2016-06-16 14:03:04,256 [main] DEBUG c.y.t.i.AuthenticationInterceptor - Request with 
 {
 Token : a5fd7e5d43c5bd9c6b05b31429d5bfde ,
 Key : 6131720219623690240 ,
 Device : 1 
} 
2016-06-16 14:03:04,262 [main] DEBUG o.s.j.d.DataSourceTransactionManager - Creating new transaction with name [cc.yanshu.thething.service.impl.UserServiceImpl.authAccessToken]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT 
2016-06-16 14:03:04,263 [main] DEBUG o.s.j.d.DataSourceTransactionManager - Acquired Connection [ConnectionJavassistProxy(1699826397) wrapping com.mysql.jdbc.JDBC4Connection@79e7188e] for JDBC transaction 
2016-06-16 14:03:04,266 [main] DEBUG o.s.j.d.DataSourceTransactionManager - Switching JDBC Connection [ConnectionJavassistProxy(1699826397) wrapping com.mysql.jdbc.JDBC4Connection@79e7188e] to manual commit 
2016-06-16 14:03:04,443 [main] DEBUG o.s.d.r.core.RedisConnectionUtils - Opening RedisConnection 
2016-06-16 14:03:04,485 [main] DEBUG o.s.d.r.core.RedisConnectionUtils - Closing Redis Connection 
2016-06-16 14:03:04,490 [main] DEBUG o.s.d.r.core.RedisConnectionUtils - Opening RedisConnection 
2016-06-16 14:03:04,495 [main] DEBUG o.s.d.r.core.RedisConnectionUtils - Closing Redis Connection 
2016-06-16 14:03:04,568 [main] DEBUG o.s.j.d.DataSourceTransactionManager - Initiating transaction commit 
2016-06-16 14:03:04,568 [main] DEBUG o.s.j.d.DataSourceTransactionManager - Committing JDBC transaction on Connection [ConnectionJavassistProxy(1699826397) wrapping com.mysql.jdbc.JDBC4Connection@79e7188e] 
2016-06-16 14:03:04,569 [main] DEBUG o.s.j.d.DataSourceTransactionManager - Releasing JDBC Connection [ConnectionJavassistProxy(1699826397) wrapping com.mysql.jdbc.JDBC4Connection@79e7188e] after transaction 
2016-06-16 14:03:04,569 [main] DEBUG o.s.jdbc.datasource.DataSourceUtils - Returning JDBC Connection to DataSource 
2016-06-16 14:03:14,992 [main] DEBUG org.nutz.resource.Scans - Locations for Scans:
[JarResourceLocation [jarPath=file:/C:/develop/yanshuMaven/repositorys/org/nutz/nutz/1.b.51/nutz-1.b.51.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\aopalliance\aopalliance\1.0\aopalliance-1.0.jar], JarResourceLocation [jarPath=C:\Programs\jdk1.8.0_60\jre\lib\deploy.jar], JarResourceLocation [jarPath=C:\Programs\jdk1.8.0_60\jre\lib\ext\jaccess.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\com\google\protobuf\protobuf-java\2.5.0\protobuf-java-2.5.0.jar], JarResourceLocation [jarPath=C:\Programs\jdk1.8.0_60\jre\lib\ext\localedata.jar], JarResourceLocation [jarPath=C:\DevTool\IntelliJ IDEA 15.0.1\lib\idea_rt.jar], JarResourceLocation [jarPath=C:\Programs\jdk1.8.0_60\jre\lib\ext\dnsns.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\springframework\spring-jdbc\4.2.6.RELEASE\spring-jdbc-4.2.6.RELEASE.jar], FileSystemResourceLocation [root=D:\yanshu_dev\Java_New_Version\trunk\web-app\target\test-classes], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\springframework\spring-tx\4.2.5.RELEASE\spring-tx-4.2.5.RELEASE.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\com\gexin\platform\gexin-rp-sdk-base\4.0.0.7\gexin-rp-sdk-base-4.0.0.7.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\javax\inject\javax.inject\1\javax.inject-1.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\com\relops\snowflake\1.1\snowflake-1.1.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\mysql\mysql-connector-java\5.1.18\mysql-connector-java-5.1.18.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\springframework\spring-aop\4.2.6.RELEASE\spring-aop-4.2.6.RELEASE.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\com\fasterxml\jackson\core\jackson-databind\2.2.3\jackson-databind-2.2.3.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\redis\clients\jedis\2.6.2\jedis-2.6.2.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\javax\servlet\javax.servlet-api\3.0.1\javax.servlet-api-3.0.1.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\springframework\spring-oxm\4.2.5.RELEASE\spring-oxm-4.2.5.RELEASE.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\springframework\data\spring-data-keyvalue\1.1.1.RELEASE\spring-data-keyvalue-1.1.1.RELEASE.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\springframework\spring-test\4.2.6.RELEASE\spring-test-4.2.6.RELEASE.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\nutz\nutz\1.b.51\nutz-1.b.51.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\springframework\spring-core\4.2.6.RELEASE\spring-core-4.2.6.RELEASE.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\cglib\cglib-nodep\3.1\cglib-nodep-3.1.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\codehaus\jackson\jackson-all\1.8.5\jackson-all-1.8.5.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\aspectj\aspectjweaver\1.8.9\aspectjweaver-1.8.9.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\com\alibaba\fastjson\1.2.11\fastjson-1.2.11.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\junit\junit\4.11\junit-4.11.jar], FileSystemResourceLocation [root=D:\yanshu_dev\Java_New_Version\trunk\common\target\classes], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\com\zaxxer\HikariCP\2.3.5\HikariCP-2.3.5.jar], JarResourceLocation [jarPath=C:\Programs\jdk1.8.0_60\jre\lib\ext\access-bridge-64.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\ch\qos\logback\logback-classic\1.1.2\logback-classic-1.1.2.jar], JarResourceLocation [jarPath=C:\Programs\jdk1.8.0_60\jre\lib\management-agent.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\codehaus\jackson\jackson-core-asl\1.9.13\jackson-core-asl-1.9.13.jar], JarResourceLocation [jarPath=C:\Programs\jdk1.8.0_60\jre\lib\ext\zipfs.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\springframework\spring-webmvc\4.2.6.RELEASE\spring-webmvc-4.2.6.RELEASE.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\springframework\security\spring-security-core\4.1.0.RELEASE\spring-security-core-4.1.0.RELEASE.jar], JarResourceLocation [jarPath=C:\Programs\jdk1.8.0_60\jre\lib\ext\cldrdata.jar], JarResourceLocation [jarPath=C:\Programs\jdk1.8.0_60\jre\lib\plugin.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\slf4j\log4j-over-slf4j\1.7.10\log4j-over-slf4j-1.7.10.jar], JarResourceLocation [jarPath=C:\DevTool\IntelliJ IDEA 15.0.1\plugins\junit\lib\junit-rt.jar], JarResourceLocation [jarPath=C:\Programs\jdk1.8.0_60\jre\lib\jfr.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\slf4j\jcl-over-slf4j\1.7.19\jcl-over-slf4j-1.7.19.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\com\gexin\platform\gexin-rp-sdk-template\4.0.0.4\gexin-rp-sdk-template-4.0.0.4.jar], JarResourceLocation [jarPath=C:\Programs\jdk1.8.0_60\jre\lib\ext\sunmscapi.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\apache\geronimo\specs\geronimo-servlet_3.0_spec\1.0\geronimo-servlet_3.0_spec-1.0.jar], JarResourceLocation [jarPath=C:\Programs\jdk1.8.0_60\jre\lib\charsets.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\springframework\spring-web\4.2.6.RELEASE\spring-web-4.2.6.RELEASE.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\commons-pool\commons-pool\1.6\commons-pool-1.6.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\springframework\spring-context\4.2.6.RELEASE\spring-context-4.2.6.RELEASE.jar], JarResourceLocation [jarPath=C:\Programs\jdk1.8.0_60\jre\lib\ext\sunec.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\ch\qos\logback\logback-core\1.1.2\logback-core-1.1.2.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\joda-time\joda-time\2.7\joda-time-2.7.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\springframework\spring-context-support\4.2.5.RELEASE\spring-context-support-4.2.5.RELEASE.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\springframework\data\spring-data-commons\1.12.1.RELEASE\spring-data-commons-1.12.1.RELEASE.jar], JarResourceLocation [jarPath=C:\Programs\jdk1.8.0_60\jre\lib\jfxswt.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\springframework\spring-beans\4.2.6.RELEASE\spring-beans-4.2.6.RELEASE.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\springframework\security\spring-security-web\4.1.0.RELEASE\spring-security-web-4.1.0.RELEASE.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\com\fasterxml\jackson\core\jackson-annotations\2.2.3\jackson-annotations-2.2.3.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\slf4j\slf4j-api\1.7.10\slf4j-api-1.7.10.jar], JarResourceLocation [jarPath=C:\Programs\jdk1.8.0_60\jre\lib\rt.jar], JarResourceLocation [jarPath=C:\Programs\jdk1.8.0_60\jre\lib\jsse.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\javassist\javassist\3.19.0-GA\javassist-3.19.0-GA.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\com\fasterxml\jackson\core\jackson-core\2.2.3\jackson-core-2.2.3.jar], JarResourceLocation [jarPath=C:\Programs\jdk1.8.0_60\jre\lib\ext\jfxrt.jar], FileSystemResourceLocation [root=D:\yanshu_dev\Java_New_Version\trunk\web-app], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\springframework\spring-expression\4.2.6.RELEASE\spring-expression-4.2.6.RELEASE.jar], JarResourceLocation [jarPath=C:\Programs\jdk1.8.0_60\jre\lib\ext\sunjce_provider.jar], JarResourceLocation [jarPath=C:\Programs\jdk1.8.0_60\jre\lib\jce.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\commons-logging\commons-logging\1.2\commons-logging-1.2.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\springframework\data\spring-data-redis\1.7.1.RELEASE\spring-data-redis-1.7.1.RELEASE.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\codehaus\jackson\jackson-mapper-asl\1.9.13\jackson-mapper-asl-1.9.13.jar], JarResourceLocation [jarPath=C:\Programs\jdk1.8.0_60\jre\lib\resources.jar], JarResourceLocation [jarPath=C:\Programs\jdk1.8.0_60\jre\lib\javaws.jar], FileSystemResourceLocation [root=D:\yanshu_dev\Java_New_Version\trunk\data-core\target\classes], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\org\apache\commons\commons-pool2\2.0\commons-pool2-2.0.jar], JarResourceLocation [jarPath=C:\Programs\jdk1.8.0_60\jre\lib\ext\sunpkcs11.jar], JarResourceLocation [jarPath=D:\yanshu_dev\Java_New_Version\trunk\common\lib\sms-http.jar], FileSystemResourceLocation [root=D:\yanshu_dev\Java_New_Version\trunk\web-app\target\classes], JarResourceLocation [jarPath=C:\Programs\jdk1.8.0_60\jre\lib\ext\nashorn.jar], JarResourceLocation [jarPath=C:\develop\yanshuMaven\repositorys\com\gexin\platform\gexin-rp-sdk-http\4.0.1.2\gexin-rp-sdk-http-4.0.1.2.jar]] 
2016-06-16 14:03:15,258 [main] DEBUG org.nutz.resource.Scans - Found 1 resource by src( sqls/post.sql ) , regex( null ) 
2016-06-16 14:03:15,515 [main] DEBUG org.nutz.resource.Scans - Found 1 resource by src( sqls/user.sql ) , regex( null ) 
2016-06-16 14:03:15,775 [main] DEBUG org.nutz.resource.Scans - Found 1 resource by src( sqls/tag.sql ) , regex( null ) 
2016-06-16 14:03:16,033 [main] DEBUG org.nutz.resource.Scans - Found 1 resource by src( sqls/group.sql ) , regex( null ) 
2016-06-16 14:03:16,296 [main] DEBUG org.nutz.resource.Scans - Found 1 resource by src( sqls/system.sql ) , regex( null ) 
2016-06-16 14:03:16,554 [main] DEBUG org.nutz.resource.Scans - Found 1 resource by src( sqls/discover.sql ) , regex( null ) 
2016-06-16 14:03:16,813 [main] DEBUG org.nutz.resource.Scans - Found 1 resource by src( sqls/msg.sql ) , regex( null ) 
2016-06-16 14:03:17,070 [main] DEBUG org.nutz.resource.Scans - Found 1 resource by src( sqls/qiuAnswer.sql ) , regex( null ) 
2016-06-16 14:03:17,328 [main] DEBUG org.nutz.resource.Scans - Found 1 resource by src( sqls/userRemark.sql ) , regex( null ) 
2016-06-16 14:03:17,585 [main] DEBUG org.nutz.resource.Scans - Found 1 resource by src( sqls/v1/v1_post.sql ) , regex( null ) 
2016-06-16 14:03:17,587 [main] DEBUG org.nutz.dao.impl.FileSqlManager - Loading sqls from NutResource[post.sql] 
2016-06-16 14:03:17,844 [main] DEBUG org.nutz.dao.impl.FileSqlManager - Loading sqls from NutResource[user.sql] 
2016-06-16 14:03:17,901 [main] DEBUG org.nutz.dao.impl.FileSqlManager - Loading sqls from NutResource[tag.sql] 
2016-06-16 14:03:17,908 [main] DEBUG org.nutz.dao.impl.FileSqlManager - Loading sqls from NutResource[group.sql] 
2016-06-16 14:03:17,920 [main] DEBUG org.nutz.dao.impl.FileSqlManager - Loading sqls from NutResource[system.sql] 
2016-06-16 14:03:17,931 [main] DEBUG org.nutz.dao.impl.FileSqlManager - Loading sqls from NutResource[discover.sql] 
2016-06-16 14:03:17,934 [main] DEBUG org.nutz.dao.impl.FileSqlManager - Loading sqls from NutResource[msg.sql] 
2016-06-16 14:03:17,967 [main] DEBUG org.nutz.dao.impl.FileSqlManager - Loading sqls from NutResource[qiuAnswer.sql] 
2016-06-16 14:03:17,969 [main] DEBUG org.nutz.dao.impl.FileSqlManager - Loading sqls from NutResource[userRemark.sql] 
2016-06-16 14:03:17,972 [main] DEBUG org.nutz.dao.impl.FileSqlManager - Loading sqls from NutResource[v1_post.sql] 
2016-06-16 14:04:15,718 [Hikari Housekeeping Timer (pool springHikariCP)] DEBUG com.zaxxer.hikari.pool.HikariPool - Before cleanup pool stats springHikariCP (total=50, inUse=0, avail=50, waiting=0) 
2016-06-16 14:06:00,120 [main] DEBUG o.s.jdbc.datasource.DataSourceUtils - Fetching JDBC Connection from DataSource 
2016-06-16 14:06:00,121 [main] DEBUG o.n.dao.impl.sql.run.NutDaoExecutor - select count(*) as adoptCount from qiu_answer where uid =  and type =1 
2016-06-16 14:06:00,124 [Hikari Housekeeping Timer (pool springHikariCP)] DEBUG com.zaxxer.hikari.pool.HikariPool - After cleanup pool stats springHikariCP (total=50, inUse=1, avail=49, waiting=0) 
2016-06-16 14:06:00,124 [Hikari Housekeeping Timer (pool springHikariCP)] DEBUG com.zaxxer.hikari.pool.HikariPool - Before cleanup pool stats springHikariCP (total=50, inUse=1, avail=49, waiting=0) 
2016-06-16 14:06:00,125 [HikariCP connection filler (pool springHikariCP)] DEBUG com.zaxxer.hikari.pool.HikariPool - After fill pool stats springHikariCP (total=50, inUse=1, avail=49, waiting=0) 
2016-06-16 14:06:00,125 [Hikari Housekeeping Timer (pool springHikariCP)] DEBUG com.zaxxer.hikari.pool.HikariPool - After cleanup pool stats springHikariCP (total=50, inUse=1, avail=49, waiting=0) 
2016-06-16 14:06:00,125 [Hikari Housekeeping Timer (pool springHikariCP)] DEBUG com.zaxxer.hikari.pool.HikariPool - Before cleanup pool stats springHikariCP (total=50, inUse=1, avail=49, waiting=0) 
2016-06-16 14:06:00,125 [HikariCP connection filler (pool springHikariCP)] DEBUG com.zaxxer.hikari.pool.HikariPool - After fill pool stats springHikariCP (total=50, inUse=1, avail=49, waiting=0) 
2016-06-16 14:06:00,125 [Hikari Housekeeping Timer (pool springHikariCP)] DEBUG com.zaxxer.hikari.pool.HikariPool - After cleanup pool stats springHikariCP (total=50, inUse=1, avail=49, waiting=0) 
2016-06-16 14:06:00,125 [Hikari Housekeeping Timer (pool springHikariCP)] DEBUG com.zaxxer.hikari.pool.HikariPool - Before cleanup pool stats springHikariCP (total=50, inUse=1, avail=49, waiting=0) 
2016-06-16 14:06:00,125 [HikariCP connection filler (pool springHikariCP)] DEBUG com.zaxxer.hikari.pool.HikariPool - After fill pool stats springHikariCP (total=50, inUse=1, avail=49, waiting=0) 
2016-06-16 14:06:00,125 [Hikari Housekeeping Timer (pool springHikariCP)] DEBUG com.zaxxer.hikari.pool.HikariPool - After cleanup pool stats springHikariCP (total=50, inUse=1, avail=49, waiting=0) 
2016-06-16 14:06:00,125 [Hikari Housekeeping Timer (pool springHikariCP)] DEBUG com.zaxxer.hikari.pool.HikariPool - Before cleanup pool stats springHikariCP (total=50, inUse=1, avail=49, waiting=0) 
2016-06-16 14:06:00,126 [Hikari Housekeeping Timer (pool springHikariCP)] DEBUG com.zaxxer.hikari.pool.HikariPool - After cleanup pool stats springHikariCP (total=50, inUse=1, avail=49, waiting=0) 
2016-06-16 14:06:00,126 [HikariCP connection filler (pool springHikariCP)] DEBUG com.zaxxer.hikari.pool.HikariPool - After fill pool stats springHikariCP (total=50, inUse=1, avail=49, waiting=0) 
2016-06-16 14:06:00,126 [HikariCP connection filler (pool springHikariCP)] DEBUG com.zaxxer.hikari.pool.HikariPool - After fill pool stats springHikariCP (total=50, inUse=1, avail=49, waiting=0) 
2016-06-16 14:06:00,130 [main] DEBUG o.n.dao.impl.sql.run.NutDaoExecutor - SQLException 
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? and type =1' at line 1
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_60]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_60]
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_60]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:422) ~[na:1.8.0_60]
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) ~[mysql-connector-java-5.1.18.jar:na]
	at com.mysql.jdbc.Util.getInstance(Util.java:386) ~[mysql-connector-java-5.1.18.jar:na]
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052) ~[mysql-connector-java-5.1.18.jar:na]
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609) ~[mysql-connector-java-5.1.18.jar:na]
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541) ~[mysql-connector-java-5.1.18.jar:na]
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2002) ~[mysql-connector-java-5.1.18.jar:na]
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163) ~[mysql-connector-java-5.1.18.jar:na]
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2618) ~[mysql-connector-java-5.1.18.jar:na]
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568) ~[mysql-connector-java-5.1.18.jar:na]
	at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1557) ~[mysql-connector-java-5.1.18.jar:na]
	at com.zaxxer.hikari.proxy.StatementProxy.executeQuery(StatementProxy.java:99) ~[HikariCP-2.3.5.jar:na]
	at com.zaxxer.hikari.proxy.StatementJavassistProxy.executeQuery(StatementJavassistProxy.java) ~[HikariCP-2.3.5.jar:na]
	at org.nutz.dao.impl.sql.run.NutDaoExecutor._runSelect(NutDaoExecutor.java:195) ~[nutz-1.b.51.jar:na]
	at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:43) ~[nutz-1.b.51.jar:na]
	at org.nutz.dao.impl.DaoSupport$DaoExec.invoke(DaoSupport.java:249) [nutz-1.b.51.jar:na]
	at cc.yanshu.thething.nutz.config.NutzDaoRunner.run(NutzDaoRunner.java:18) [classes/:na]
	at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:204) [nutz-1.b.51.jar:na]
	at org.nutz.dao.impl.DaoSupport.execute(DaoSupport.java:182) [nutz-1.b.51.jar:na]
	at cc.yanshu.thething.dao.impl.QiuAnswerDaoImpl.fetchAdoptCount(QiuAnswerDaoImpl.java:21) [classes/:na]
	at cc.yanshu.thething.gate.impl.QiuAnswerGateImpl.fetchAdoptCount(QiuAnswerGateImpl.java:18) [classes/:na]
	at cc.yanshu.thething.service.impl.UserServiceImpl.fetchUserHomeInfo(UserServiceImpl.java:682) [classes/:na]
	at cc.yanshu.thething.service.impl.UserServiceImpl$$FastClassBySpringCGLIB$$ef0c6500.invoke(<generated>) [classes/:na]
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) [spring-core-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720) [spring-aop-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) [spring-aop-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) [spring-tx-4.2.5.RELEASE.jar:4.2.5.RELEASE]
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281) [spring-tx-4.2.5.RELEASE.jar:4.2.5.RELEASE]
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) [spring-tx-4.2.5.RELEASE.jar:4.2.5.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) [spring-aop-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) [spring-aop-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) [spring-aop-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655) [spring-aop-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at cc.yanshu.thething.service.impl.UserServiceImpl$$EnhancerBySpringCGLIB$$c83393f5.fetchUserHomeInfo(<generated>) [classes/:na]
	at cc.yanshu.thething.controller.UserController.userHome(UserController.java:541) [classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_60]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_60]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_60]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_60]
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) [spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) [spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) [spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:832) [spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:743) [spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) [spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:961) [spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:895) [spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967) [spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:858) [spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:575) [geronimo-servlet_3.0_spec-1.0.jar:1.0]
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843) [spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.test.web.servlet.TestDispatcherServlet.service(TestDispatcherServlet.java:65) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:668) [geronimo-servlet_3.0_spec-1.0.jar:1.0]
	at org.springframework.mock.web.MockFilterChain$ServletFilterProxy.doFilter(MockFilterChain.java:167) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:134) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.test.web.servlet.MockMvc.perform(MockMvc.java:155) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at cc.yanshu.thething.controller.UserControllerTest.testUserHome(UserControllerTest.java:194) [test-classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_60]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_60]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_60]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_60]
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) [junit-4.11.jar:na]
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.11.jar:na]
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) [junit-4.11.jar:na]
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) [junit-4.11.jar:na]
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) [junit-4.11.jar:na]
	at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) [junit-4.11.jar:na]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:254) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) [junit-4.11.jar:na]
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) [junit-4.11.jar:na]
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) [junit-4.11.jar:na]
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) [junit-4.11.jar:na]
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) [junit-4.11.jar:na]
	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309) [junit-4.11.jar:na]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:193) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.junit.runner.JUnitCore.run(JUnitCore.java:160) [junit-4.11.jar:na]
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117) [junit-rt.jar:na]
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234) [junit-rt.jar:na]
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74) [junit-rt.jar:na]
2016-06-16 14:06:00,131 [main] DEBUG o.n.dao.impl.sql.run.NutDaoExecutor - SQL NextException 
2016-06-16 14:06:00,131 [main] DEBUG o.s.jdbc.datasource.DataSourceUtils - Returning JDBC Connection to DataSource 
2016-06-16 14:06:00,132 [main] DEBUG o.s.w.s.m.m.a.ExceptionHandlerExceptionResolver - Resolving exception from handler [public cc.yanshu.thething.common.wrapper.ResponseWrapper cc.yanshu.thething.controller.UserController.userHome(java.lang.Long,org.springframework.http.HttpHeaders)]: org.nutz.dao.DaoException: !Nutz SQL Error: 'select count(*) as adoptCount from qiu_answer where uid =  and type =1'
PreparedStatement: 
'select count(*) as adoptCount from qiu_answer where uid = ? and type =1' 
2016-06-16 14:06:00,132 [main] DEBUG o.s.w.s.m.a.ResponseStatusExceptionResolver - Resolving exception from handler [public cc.yanshu.thething.common.wrapper.ResponseWrapper cc.yanshu.thething.controller.UserController.userHome(java.lang.Long,org.springframework.http.HttpHeaders)]: org.nutz.dao.DaoException: !Nutz SQL Error: 'select count(*) as adoptCount from qiu_answer where uid =  and type =1'
PreparedStatement: 
'select count(*) as adoptCount from qiu_answer where uid = ? and type =1' 
2016-06-16 14:06:00,132 [main] DEBUG o.s.w.s.m.s.DefaultHandlerExceptionResolver - Resolving exception from handler [public cc.yanshu.thething.common.wrapper.ResponseWrapper cc.yanshu.thething.controller.UserController.userHome(java.lang.Long,org.springframework.http.HttpHeaders)]: org.nutz.dao.DaoException: !Nutz SQL Error: 'select count(*) as adoptCount from qiu_answer where uid =  and type =1'
PreparedStatement: 
'select count(*) as adoptCount from qiu_answer where uid = ? and type =1' 
2016-06-16 14:06:00,133 [main] DEBUG o.s.t.w.s.TestDispatcherServlet - Could not complete request 
org.nutz.dao.DaoException: !Nutz SQL Error: 'select count(*) as adoptCount from qiu_answer where uid =  and type =1'
PreparedStatement: 
'select count(*) as adoptCount from qiu_answer where uid = ? and type =1'
	at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:90) ~[nutz-1.b.51.jar:na]
	at org.nutz.dao.impl.DaoSupport$DaoExec.invoke(DaoSupport.java:249) ~[nutz-1.b.51.jar:na]
	at cc.yanshu.thething.nutz.config.NutzDaoRunner.run(NutzDaoRunner.java:18) ~[classes/:na]
	at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:204) ~[nutz-1.b.51.jar:na]
	at org.nutz.dao.impl.DaoSupport.execute(DaoSupport.java:182) ~[nutz-1.b.51.jar:na]
	at cc.yanshu.thething.dao.impl.QiuAnswerDaoImpl.fetchAdoptCount(QiuAnswerDaoImpl.java:21) ~[classes/:na]
	at cc.yanshu.thething.gate.impl.QiuAnswerGateImpl.fetchAdoptCount(QiuAnswerGateImpl.java:18) ~[classes/:na]
	at cc.yanshu.thething.service.impl.UserServiceImpl.fetchUserHomeInfo(UserServiceImpl.java:682) ~[classes/:na]
	at cc.yanshu.thething.service.impl.UserServiceImpl$$FastClassBySpringCGLIB$$ef0c6500.invoke(<generated>) ~[classes/:na]
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720) ~[spring-aop-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) ~[spring-aop-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) ~[spring-tx-4.2.5.RELEASE.jar:4.2.5.RELEASE]
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281) ~[spring-tx-4.2.5.RELEASE.jar:4.2.5.RELEASE]
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) ~[spring-tx-4.2.5.RELEASE.jar:4.2.5.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) ~[spring-aop-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655) ~[spring-aop-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at cc.yanshu.thething.service.impl.UserServiceImpl$$EnhancerBySpringCGLIB$$c83393f5.fetchUserHomeInfo(<generated>) ~[classes/:na]
	at cc.yanshu.thething.controller.UserController.userHome(UserController.java:541) ~[classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_60]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_60]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_60]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_60]
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:832) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:743) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:961) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:895) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967) [spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:858) [spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:575) [geronimo-servlet_3.0_spec-1.0.jar:1.0]
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843) [spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.test.web.servlet.TestDispatcherServlet.service(TestDispatcherServlet.java:65) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:668) [geronimo-servlet_3.0_spec-1.0.jar:1.0]
	at org.springframework.mock.web.MockFilterChain$ServletFilterProxy.doFilter(MockFilterChain.java:167) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:134) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.test.web.servlet.MockMvc.perform(MockMvc.java:155) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at cc.yanshu.thething.controller.UserControllerTest.testUserHome(UserControllerTest.java:194) [test-classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_60]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_60]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_60]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_60]
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) [junit-4.11.jar:na]
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.11.jar:na]
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) [junit-4.11.jar:na]
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) [junit-4.11.jar:na]
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) [junit-4.11.jar:na]
	at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) [junit-4.11.jar:na]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:254) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) [junit-4.11.jar:na]
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) [junit-4.11.jar:na]
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) [junit-4.11.jar:na]
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) [junit-4.11.jar:na]
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) [junit-4.11.jar:na]
	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309) [junit-4.11.jar:na]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:193) [spring-test-4.2.6.RELEASE.jar:4.2.6.RELEASE]
	at org.junit.runner.JUnitCore.run(JUnitCore.java:160) [junit-4.11.jar:na]
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117) [junit-rt.jar:na]
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234) [junit-rt.jar:na]
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74) [junit-rt.jar:na]
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? and type =1' at line 1
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_60]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_60]
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_60]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:422) ~[na:1.8.0_60]
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) ~[mysql-connector-java-5.1.18.jar:na]
	at com.mysql.jdbc.Util.getInstance(Util.java:386) ~[mysql-connector-java-5.1.18.jar:na]
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052) ~[mysql-connector-java-5.1.18.jar:na]
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609) ~[mysql-connector-java-5.1.18.jar:na]
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541) ~[mysql-connector-java-5.1.18.jar:na]
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2002) ~[mysql-connector-java-5.1.18.jar:na]
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163) ~[mysql-connector-java-5.1.18.jar:na]
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2618) ~[mysql-connector-java-5.1.18.jar:na]
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568) ~[mysql-connector-java-5.1.18.jar:na]
	at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1557) ~[mysql-connector-java-5.1.18.jar:na]
	at com.zaxxer.hikari.proxy.StatementProxy.executeQuery(StatementProxy.java:99) ~[HikariCP-2.3.5.jar:na]
	at com.zaxxer.hikari.proxy.StatementJavassistProxy.executeQuery(StatementJavassistProxy.java) ~[HikariCP-2.3.5.jar:na]
	at org.nutz.dao.impl.sql.run.NutDaoExecutor._runSelect(NutDaoExecutor.java:195) ~[nutz-1.b.51.jar:na]
	at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:43) ~[nutz-1.b.51.jar:na]
	... 70 common frames omitted
2016-06-16 14:06:00,140 [main] DEBUG o.s.t.c.s.AbstractDirtiesContextTestExecutionListener - After test method: context [DefaultTestContext@2118cddf testClass = UserControllerTest, testInstance = cc.yanshu.thething.controller.UserControllerTest@67d32a54, testMethod = testUserHome@UserControllerTest, testException = org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.nutz.dao.DaoException: !Nutz SQL Error: 'select count(*) as adoptCount from qiu_answer where uid =  and type =1'
PreparedStatement: 
'select count(*) as adoptCount from qiu_answer where uid = ? and type =1', mergedContextConfiguration = [WebMergedContextConfiguration@17a7f733 testClass = UserControllerTest, locations = '{classpath:applicationContext.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.test.context.web.WebDelegatingSmartContextLoader', parent = [null]]], class annotated with @DirtiesContext [false] with mode [null], method annotated with @DirtiesContext [false] with mode [null]. 
2016-06-16 14:06:00,140 [main] DEBUG o.s.t.c.w.ServletTestExecutionListener - Resetting RequestContextHolder for test context [DefaultTestContext@2118cddf testClass = UserControllerTest, testInstance = cc.yanshu.thething.controller.UserControllerTest@67d32a54, testMethod = testUserHome@UserControllerTest, testException = org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.nutz.dao.DaoException: !Nutz SQL Error: 'select count(*) as adoptCount from qiu_answer where uid =  and type =1'
PreparedStatement: 
'select count(*) as adoptCount from qiu_answer where uid = ? and type =1', mergedContextConfiguration = [WebMergedContextConfiguration@17a7f733 testClass = UserControllerTest, locations = '{classpath:applicationContext.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.test.context.web.WebDelegatingSmartContextLoader', parent = [null]]]. 

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.nutz.dao.DaoException: !Nutz SQL Error: 'select count(*) as adoptCount from qiu_answer where uid =  and type =1'
PreparedStatement: 
'select count(*) as adoptCount from qiu_answer where uid = ? and type =1'

	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:979)
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:858)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:575)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
	at org.springframework.test.web.servlet.TestDispatcherServlet.service(TestDispatcherServlet.java:65)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
	at org.springframework.mock.web.MockFilterChain$ServletFilterProxy.doFilter(MockFilterChain.java:167)
	at org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:134)
	at org.springframework.test.web.servlet.MockMvc.perform(MockMvc.java:155)
	at cc.yanshu.thething.controller.UserControllerTest.testUserHome(UserControllerTest.java:194)
	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:497)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:254)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:193)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
Caused by: org.nutz.dao.DaoException: !Nutz SQL Error: 'select count(*) as adoptCount from qiu_answer where uid =  and type =1'
PreparedStatement: 
'select count(*) as adoptCount from qiu_answer where uid = ? and type =1'
	at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:90)
	at org.nutz.dao.impl.DaoSupport$DaoExec.invoke(DaoSupport.java:249)
	at cc.yanshu.thething.nutz.config.NutzDaoRunner.run(NutzDaoRunner.java:18)
	at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:204)
	at org.nutz.dao.impl.DaoSupport.execute(DaoSupport.java:182)
	at cc.yanshu.thething.dao.impl.QiuAnswerDaoImpl.fetchAdoptCount(QiuAnswerDaoImpl.java:21)
	at cc.yanshu.thething.gate.impl.QiuAnswerGateImpl.fetchAdoptCount(QiuAnswerGateImpl.java:18)
	at cc.yanshu.thething.service.impl.UserServiceImpl.fetchUserHomeInfo(UserServiceImpl.java:682)
	at cc.yanshu.thething.service.impl.UserServiceImpl$$FastClassBySpringCGLIB$$ef0c6500.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)
	at cc.yanshu.thething.service.impl.UserServiceImpl$$EnhancerBySpringCGLIB$$c83393f5.fetchUserHomeInfo(<generated>)
	at cc.yanshu.thething.controller.UserController.userHome(UserController.java:541)
	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:497)
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:832)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:743)
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:961)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:895)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)
	... 37 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? and type =1' at line 1
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
	at com.mysql.jdbc.Util.getInstance(Util.java:386)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2002)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2618)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568)
	at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1557)
	at com.zaxxer.hikari.proxy.StatementProxy.executeQuery(StatementProxy.java:99)
	at com.zaxxer.hikari.proxy.StatementJavassistProxy.executeQuery(StatementJavassistProxy.java)
	at org.nutz.dao.impl.sql.run.NutDaoExecutor._runSelect(NutDaoExecutor.java:195)
	at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:43)
	... 70 more


看上去你传入的sql就是下面这个, 并没有带@uid和@type之类带参数

select count(*) as adoptCount from qiu_answer where uid =  and type =1 

改一下,加一行看看输出啥

Sql sql = createSQL(NAME_SPACE,"fetchAdoptCount");
// 这里插入一行 ------------------------
log.info("源SQL= "+sql.getSourceSql());
//----------------------------------
 sql.params().set("uid", uid);
 sql.setCallback(Sqls.callback.integer());
 nutDao.execute(sql);
 return sql.getNumber().intValue();

@wendal

2016-06-16 14:31:02,084 [main] INFO  c.y.t.dao.impl.QiuAnswerDaoImpl - 源SQL= select count(*) as adoptCount from qiu_answer where uid = @uid and type =1 

看不出什么问题来, 换新版nutz试试?

我写了个testcase试了一下,能pass。 所以,要么版本问题,要么createSQL有问题

    @Test
    public void test_fetch_count() {
        Dao dao = ioc.get(Dao.class);
        
        // 删表重建
        dao.drop("qiu_answer");
        dao.execute(Sqls.create("create table qiu_answer (uid int, type int)"));
        
        
        Sql sql = Sqls.create("select count(*) as adoptCount from qiu_answer where uid = @uid and type =1 ");
        sql.params().set("uid", 1);
        sql.setCallback(Sqls.callback.integer());
        dao.execute(sql);
        int count = sql.getNumber().intValue();
        assertEquals(0, count);
    }

@wendal
我换了最新的版本就没问题啦,那如果是版本问题,是什么样的问题呢? 我对于版本和配置问题,经验好少,向你们学习一下

@qq_326fa09e 不清楚,比对一下NutSql的commit log吧

添加回复
请先登陆
回到顶部