Could you make the reproduce much easier?

In your case, we could not know what's inside
"  conn = driver.connect(aresDataSourceConfig.getUrl(),
kylinRepoDO.getProperties());
            state = kylinRepoDO.getState();
            logger.info(request.getSql());
            rs = state.executeQuery(request.getSql());"

Could you just write some test code against JDBC statement and have a try?

2017-03-06 20:05 GMT-08:00 yangchao <ychao...@163.com>:

> sql单独执行没有问题, 在多条并发执行的query后,会爆出来下面的异常
>
> 我的java代码:
> public JSONArray findApiStatistic(ApiRequest request) {
>         JSONArray jsonArray = null;
>         try {
>             KylinRepoDO kylinRepoDO = makeKylinRepoDO();
>             driver = kylinRepoDO.getDriver();
>             conn = driver.connect(aresDataSourceConfig.getUrl(),
> kylinRepoDO.getProperties());
>             state = kylinRepoDO.getState();
>             logger.info(request.getSql());
>             rs = state.executeQuery(request.getSql());
>             String[] itemsArr = request.getItems().split(",");
>             jsonArray = new JSONArray();
>             while (rs.next()) {
>                 JSONObject jsonObject = new JSONObject();
>                 for (int i = 0; i < itemsArr.length; i++) {
>                     jsonObject.put(itemsArr[i], rs.getString(i + 1));
>                 }
>                 jsonArray.add(jsonObject);
>             }
>             logger.info("project:" + request.getProject() + ", cube:" +
> request.getCube() + ", items:" + jsonArray.size());
>         }  catch (Exception e) {
>             logger.error("ApiKylinRepository.findApiStatistic meet
> exception!", e);
>         } finally {
>             destroy(conn, state, rs);
>         }
>
>         if (null == jsonArray) {
>             logger.warn("query result is null!");
>             return null;
>         }
>
>         return jsonArray;
>     }
>
>
> log:Ares 2017-03-07 09:06:09.023 ERROR 1 [2-51005-exec-12]
> c.y.b.a.r.k.ApiKylinRepository           : []
> ApiKylinRepository.findApiStatistic meet exception!
> log:
> log:java.sql.SQLException: Statement did not return a result set
> log:    at
> org.apache.kylin.jdbc.shaded.org.apache.calcite.avatica.
> Helper.createException(Helper.java:60)
> log:    at
> org.apache.kylin.jdbc.shaded.org.apache.calcite.avatica.
> AvaticaStatement.executeQuery(AvaticaStatement.java:210)
> log:    at
> com.yiran.bigdata.ares.repository.kylin.ApiKylinRepository.
> findApiStatistic(ApiKylinRepository.java:37)
> log:    at
> com.yiran.bigdata.ares.repository.kylin.ApiKylinRepository$$
> FastClassBySpringCGLIB$$cb58c343.invoke(<generated>)
> log:    at
> org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
> log:    at
> org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.
> invokeJoinpoint(CglibAopProxy.java:720)
> log:    at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
> ReflectiveMethodInvocation.java:157)
> log:    at
> org.springframework.dao.support.PersistenceExceptionTranslatio
> nInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
> log:    at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
> ReflectiveMethodInvocation.java:179)
> log:    at
> org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.
> intercept(CglibAopProxy.java:655)
> log:    at
> com.yiran.bigdata.ares.repository.kylin.ApiKylinRepository$$
> EnhancerBySpringCGLIB$$ed35dbdc.findApiStatistic(<generated>)
> log:    at
> com.yiran.bigdata.ares.biz.api.impl.ApiStatisticServiceImpl.
> queryApiStatistic(ApiStatisticServiceImpl.java:23)
> log:    at
> com.yiran.bigdata.ares.api.controller.ApiController.
> queryItemList(ApiController.java:46)
> log:    at
> com.yiran.bigdata.ares.api.controller.ApiController$$
> FastClassBySpringCGLIB$$87241bd7.invoke(<generated>)
> log:    at
> org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
> log:    at
> org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.
> invokeJoinpoint(CglibAopProxy.java:720)
> log:    at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
> ReflectiveMethodInvocation.java:157)
> log:    at
> org.springframework.aop.aspectj.MethodInvocationProceedingJoin
> Point.proceed(MethodInvocationProceedingJoinPoint.java:85)
> log:    at
> com.yiran.bigdata.ares.api.aop.SignAspect.validate(SignAspect.java:43)
> log:    at sun.reflect.GeneratedMethodAccessor60.invoke(Unknown Source)
> log:    at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
> log:    at java.lang.reflect.Method.invoke(Method.java:498)
> log:    at
> org.springframework.aop.aspectj.AbstractAspectJAdvice.
> invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
> log:    at
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(
> AbstractAspectJAdvice.java:610)
> log:    at
> org.springframework.aop.aspectj.AspectJAroundAdvice.
> invoke(AspectJAroundAdvice.java:68)
> log:    at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
> ReflectiveMethodInvocation.java:168)
> log:    at
> com.yiran.bigdata.ares.api.aop.LoggerAspect.invoke(LoggerAspect.java:70)
> log:    at
> com.yiran.bigdata.ares.api.aop.LoggerAspect.logerOut(LoggerAspect.java:58)
> log:    at sun.reflect.GeneratedMethodAccessor59.invoke(Unknown Source)
> log:    at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
> log:    at java.lang.reflect.Method.invoke(Method.java:498)
> log:    at
> org.springframework.aop.aspectj.AbstractAspectJAdvice.
> invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
> log:    at
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(
> AbstractAspectJAdvice.java:610)
> log:    at
> org.springframework.aop.aspectj.AspectJAroundAdvice.
> invoke(AspectJAroundAdvice.java:68)
> log:    at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
> ReflectiveMethodInvocation.java:168)
> log:    at
> org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(
> ExposeInvocationInterceptor.java:92)
> log:    at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
> ReflectiveMethodInvocation.java:179)
> log:    at
> org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.
> intercept(CglibAopProxy.java:655)
> log:    at
> com.yiran.bigdata.ares.api.controller.ApiController$$
> EnhancerBySpringCGLIB$$a5ee472.queryItemList(<generated>)
> log:    at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source)
> log:    at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
> log:    at java.lang.reflect.Method.invoke(Method.java:498)
> log:    at
> org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(
> InvocableHandlerMethod.java:222)
> log:    at
> org.springframework.web.method.support.InvocableHandlerMethod.
> invokeForRequest(InvocableHandlerMethod.java:137)
> log:    at
> org.springframework.web.servlet.mvc.method.annotation.
> ServletInvocableHandlerMethod.invokeAndHandle(
> ServletInvocableHandlerMethod.java:110)
> log:    at
> org.springframework.web.servlet.mvc.method.annotation.
> RequestMappingHandlerAdapter.invokeHandlerMethod(
> RequestMappingHandlerAdapter.java:814)
> log:    at
> org.springframework.web.servlet.mvc.method.annotation.
> RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.
> java:737)
> log:    at
> org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.
> handle(AbstractHandlerMethodAdapter.java:85)
> log:    at
> org.springframework.web.servlet.DispatcherServlet.
> doDispatch(DispatcherServlet.java:959)
> log:    at
> org.springframework.web.servlet.DispatcherServlet.
> doService(DispatcherServlet.java:893)
> log:    at
> org.springframework.web.servlet.FrameworkServlet.processRequest(
> FrameworkServlet.java:969)
> log:    at
> org.springframework.web.servlet.FrameworkServlet.
> doPost(FrameworkServlet.java:871)
> log:    at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
> log:    at
> org.springframework.web.servlet.FrameworkServlet.
> service(FrameworkServlet.java:845)
> log:    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
> log:    at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:291)
> log:    at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:206)
> log:    at
> org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
> log:    at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:239)
> log:    at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:206)
> log:    at
> com.dianping.cat.servlet.CatFilter$Context.handle(CatFilter.java:404)
> log:    at
> com.dianping.cat.servlet.CatFilter$CatHandler$3.handle(CatFilter.java:219)
> log:    at
> com.dianping.cat.servlet.CatFilter$Context.handle(CatFilter.java:402)
> log:    at
> com.dianping.cat.servlet.CatFilter$CatHandler$4.handle(CatFilter.java:314)
> log:    at
> com.dianping.cat.servlet.CatFilter$Context.handle(CatFilter.java:402)
> log:    at
> com.dianping.cat.servlet.CatFilter$CatHandler$2.handle(CatFilter.java:202)
> log:    at
> com.dianping.cat.servlet.CatFilter$Context.handle(CatFilter.java:402)
> log:    at
> com.dianping.cat.servlet.CatFilter$CatHandler$1.handle(CatFilter.java:110)
> log:    at
> com.dianping.cat.servlet.CatFilter$Context.handle(CatFilter.java:402)
> log:    at com.dianping.cat.servlet.CatFilter.doFilter(CatFilter.java:48)
> log:    at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:239)
> log:    at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:206)
> log:    at
> org.springframework.web.filter.RequestContextFilter.doFilterInternal(
> RequestContextFilter.java:99)
> log:    at
> org.springframework.web.filter.OncePerRequestFilter.
> doFilter(OncePerRequestFilter.java:107)
> log:    at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:239)
> log:    at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:206)
> log:    at
> org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(
> HttpPutFormContentFilter.java:87)
> log:    at
> org.springframework.web.filter.OncePerRequestFilter.
> doFilter(OncePerRequestFilter.java:107)
> log:    at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:239)
> log:    at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:206)
> log:    at
> org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(
> HiddenHttpMethodFilter.java:77)
> log:    at
> org.springframework.web.filter.OncePerRequestFilter.
> doFilter(OncePerRequestFilter.java:107)
> log:    at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:239)
> log:    at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:206)
> log:    at
> org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(
> CharacterEncodingFilter.java:121)
> log:    at
> org.springframework.web.filter.OncePerRequestFilter.
> doFilter(OncePerRequestFilter.java:107)
> log:    at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:239)
> log:    at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:206)
> log:    at
> org.apache.catalina.core.StandardWrapperValve.invoke(
> StandardWrapperValve.java:212)
> log:    at
> org.apache.catalina.core.StandardContextValve.invoke(
> StandardContextValve.java:106)
> log:    at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(
> AuthenticatorBase.java:502)
> log:    at
> org.apache.catalina.core.StandardHostValve.invoke(
> StandardHostValve.java:141)
> log:    at
> org.apache.catalina.valves.ErrorReportValve.invoke(
> ErrorReportValve.java:79)
> log:    at
> org.apache.catalina.core.StandardEngineValve.invoke(
> StandardEngineValve.java:88)
> log:    at
> org.apache.catalina.connector.CoyoteAdapter.service(
> CoyoteAdapter.java:521)
> log:    at
> org.apache.coyote.http11.AbstractHttp11Processor.process(
> AbstractHttp11Processor.java:1096)
> log:    at
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.
> process(AbstractProtocol.java:674)
> log:    at
> org.apache.tomcat.util.net.Nio2Endpoint$SocketProcessor.
> doRun(Nio2Endpoint.java:1074)
> log:    at
> org.apache.tomcat.util.net.Nio2Endpoint$SocketProcessor.
> run(Nio2Endpoint.java:1033)
> log:    at
> java.util.concurrent.ThreadPoolExecutor.runWorker(
> ThreadPoolExecutor.java:1142)
> log:    at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(
> ThreadPoolExecutor.java:617)
> log:    at
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(
> TaskThread.java:61)
> log:    at java.lang.Thread.run(Thread.java:745)
>
> --
> View this message in context: http://apache-kylin.74782.x6.
> nabble.com/kylin-jdbc-meet-exception-tp7368.html
> Sent from the Apache Kylin mailing list archive at Nabble.com.
>

Reply via email to