OSDir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Wrong MySQL(The RuntimeException could not be mapped to a response, re-throwing to the HTTP container)


please assist on this request. I have identify the issue and solution to it
but i am seriously looking on the code "incubator-fineract" so that i can
update it. There is no "group by" on the Mysql query.

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: In
aggregated query without GROUP BY, expression #2 of SELECT list contains
nonaggregated column 'mifostenant-default.l.principal_amount'; this is
incompatible with sql_mode=only_full_group_by


/v1/runreports/ClientSummary","parameters":{"genericResultSet":["false"],"R_clientId":["10"]}}
197280 [http-bio-443-exec-1] ERROR o.s.b.context.web.ErrorPageFilter -
Forwarding to error page from request [/api/v1/runreports/ClientSummary]
due to exception [StatementCallback; bad SQL grammar [select x.* from
(SELECT x.* FROM m_client c, m_office o,
(
       SELECT a.loanCycle, a.activeLoans, b.lastLoanAmount,
d.activeSavings, d.totalSavings FROM
  (SELECT IFNULL(MAX(l.loan_counter),0) AS loanCycle, COUNT(l.id) AS
activeLoans FROM m_loan l WHERE l.loan_status_id=300 AND l.client_id=10) a,
  (SELECT count(l.id), IFNULL(l.principal_amount,0) AS 'lastLoanAmount'
FROM m_loan l WHERE l.client_id=10 AND l.disbursedon_date = (SELECT
IFNULL(MAX(disbursedon_date),NOW()) FROM m_loan where client_id=10 and
loan_status_id=300)) b,
 (SELECT COUNT(s.id) AS 'activeSavings',
IFNULL(SUM(s.account_balance_derived),0) AS 'totalSavings' FROM
m_savings_account s WHERE s.status_enum=300 AND s.client_id=10) d
) x
WHERE c.id=10 AND o.id = c.office_id AND o.hierarchy LIKE CONCAT('.', '%'))
x]; nested exception is
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: In aggregated
query without GROUP BY, expression #2 of SELECT list contains nonaggregated
column 'mifostenant-default.l.principal_amount'; this is incompatible with
sql_mode=only_full_group_by]
org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL
grammar [select x.* from (SELECT x.* FROM m_client c, m_office o,
(
       SELECT a.loanCycle, a.activeLoans, b.lastLoanAmount,
d.activeSavings, d.totalSavings FROM
  (SELECT IFNULL(MAX(l.loan_counter),0) AS loanCycle, COUNT(l.id) AS
activeLoans FROM m_loan l WHERE l.loan_status_id=300 AND l.client_id=10) a,
  (SELECT count(l.id), IFNULL(l.principal_amount,0) AS 'lastLoanAmount'
FROM m_loan l WHERE l.client_id=10 AND l.disbursedon_date = (SELECT
IFNULL(MAX(disbursedon_date),NOW()) FROM m_loan where client_id=10 and
loan_status_id=300)) b,
 (SELECT COUNT(s.id) AS 'activeSavings',
IFNULL(SUM(s.account_balance_derived),0) AS 'totalSavings' FROM
m_savings_account s WHERE s.status_enum=300 AND s.client_id=10) d
) x
WHERE c.id=10 AND o.id = c.office_id AND o.hierarchy LIKE CONCAT('.', '%'))
x]; nested exception is
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: In aggregated
query without GROUP BY, expression #2 of SELECT list contains nonaggregated
column 'mifostenant-default.l.principal_amount'; this is incompatible with
sql_mode=only_full_group_by
        at
org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:91)
~[spring-jdbc-4.0.7.RELEASE.jar:4.0.7.RELEASE]
        at
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
~[spring-jdbc-4.0.7.RELEASE.jar:4.0.7.RELEASE]
        at
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
~[spring-jdbc-4.0.7.RELEASE.jar:4.0.7.RELEASE]
        at
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:413)
~[spring-jdbc-4.0.7.RELEASE.jar:4.0.7.RELEASE]
        at
org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:468)
~[spring-jdbc-4.0.7.RELEASE.jar:4.0.7.RELEASE]
        at
org.springframework.jdbc.core.JdbcTemplate.queryForRowSet(JdbcTemplate.java:523)
~[spring-jdbc-4.0.7.RELEASE.jar:4.0.7.RELEASE]
        at
org.apache.fineract.infrastructure.dataqueries.service.GenericDataServiceImpl.fillGenericResultSet(GenericDataServiceImpl.java:59)
~[classes/:na]
        at
org.apache.fineract.infrastructure.dataqueries.service.ReadReportingServiceImpl.retrieveGenericResultset(ReadReportingServiceImpl.java:181)
~[classes/:na]
        at
org.apache.fineract.infrastructure.dataqueries.api.RunreportsApiResource.runReport(RunreportsApiResource.java:121)
~[classes/:na]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
~[na:1.8.0_171]
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
~[na:1.8.0_171]
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[na:1.8.0_171]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_171]
        at
com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
~[jersey-server-1.17.jar:1.17]
        at
com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
~[jersey-server-1.17.jar:1.17]



On Sat, Jun 9, 2018 at 3:25 PM, Ed Cable <edcable@xxxxxxxxx> wrote:

> Emmanuel,
>
> Please start a new message thread if you have a different support query.
> You can do so my creating a new email with a relevant subject line and
> sending it to the respective mailing list.
>
> We need to keep each discussion thread relevant and on-topic. Thank you
> for using the mailing lists though!
>
> Cheers,
>
> Ed
>
> On Sat, Jun 9, 2018 at 3:00 AM Emmanuel Njoku <einjoku@xxxxxxxxx> wrote:
>
>> who can assist me on this error message. I obtain this message after
>> creation of new Data table mapped to client*.*
>>
>>
>> Jun 09, 2018 10:45:22 AM com.sun.jersey.spi.container.ContainerResponse
>> mapMappableContainerException
>> SEVERE: The RuntimeException could not be mapped to a response,
>> re-throwing
>> to the HTTP container
>> java.lang.NullPointerException
>> at
>> org.apache.fineract.infrastructure.security.utils.SQLInjectionValidator.
>> validateSQLInput(SQLInjectionValidator.java:36)
>> at
>> org.apache.fineract.infrastructure.security.utils.ColumnValidator.
>> validateSqlInjection(ColumnValidator.java:95)
>> at
>> org.apache.fineract.infrastructure.dataqueries.service.
>> ReadWriteNonCoreDataServiceImpl.retrieveDataTableGenericResultSet(
>> ReadWriteNonCoreDataServiceImpl.java:1190)
>> 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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection
>> (AopUtils.java:317)
>> at
>> org.springframework.aop.framework.JdkDynamicAopProxy.
>> invoke(JdkDynamicAopProxy.java:201)
>> at com.sun.proxy.$Proxy148.retrieveDataTableGenericResultSet(Unknown
>> Source)
>> at
>> org.apache.fineract.infrastructure.dataqueries.api.DatatablesApiResource.
>> getDatatable(DatatablesApiResource.java:174)
>> 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
>> com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(
>> JavaMethodInvokerFactory.java:60)
>> at
>> com.sun.jersey.server.impl.model.method.dispatch.
>> AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(
>> AbstractResourceMethodDispatchProvider.java:185)
>> at
>> com.sun.jersey.server.impl.model.method.dispatch.
>> ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.
>> java:75)
>> at
>> com.sun.jersey.server.impl.uri.rules.HttpMethodRule.
>> accept(HttpMethodRule.java:302)
>> at
>> com.sun.jersey.server.impl.uri.rules.RightHandPathRule.
>> accept(RightHandPathRule.java:147)
>> at
>> com.sun.jersey.server.impl.uri.rules.ResourceClassRule.
>> accept(ResourceClassRule.java:108)
>> at
>> com.sun.jersey.server.impl.uri.rules.RightHandPathRule.
>> accept(RightHandPathRule.java:147)
>> at
>> com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(
>> RootResourceClassesRule.java:84)
>> at
>> com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(
>> WebApplicationImpl.java:1511)
>> at
>> com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(
>> WebApplicationImpl.java:1442)
>> at
>> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(
>> WebApplicationImpl.java:1391)
>> at
>> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(
>> WebApplicationImpl.java:1381)
>> at
>> com.sun.jersey.spi.container.servlet.WebComponent.service(
>> WebComponent.java:416)
>> at
>> com.sun.jersey.spi.container.servlet.ServletContainer.
>> service(ServletContainer.java:538)
>> at
>> com.sun.jersey.spi.container.servlet.ServletContainer.
>> service(ServletContainer.java:716)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
>> ApplicationFilterChain.java:303)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(
>> ApplicationFilterChain.java:208)
>> at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
>> ApplicationFilterChain.java:241)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(
>> ApplicationFilterChain.java:208)
>> at
>> org.springframework.security.web.access.intercept.
>> FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:108)
>> at
>> org.springframework.security.web.access.intercept.
>> FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
>> ApplicationFilterChain.java:241)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(
>> ApplicationFilterChain.java:208)
>> at
>> org.springframework.security.web.FilterChainProxy$
>> VirtualFilterChain.doFilter(FilterChainProxy.java:330)
>> at
>> org.springframework.security.web.access.intercept.
>> FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
>> at
>> org.springframework.security.web.access.intercept.
>> FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
>> at
>> org.springframework.security.web.FilterChainProxy$
>> VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>> at
>> org.springframework.security.web.access.ExceptionTranslationFilter.
>> doFilter(ExceptionTranslationFilter.java:113)
>> at
>> org.springframework.security.web.FilterChainProxy$
>> VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>> at
>> org.springframework.security.web.authentication.
>> AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.
>> java:113)
>> at
>> org.springframework.security.web.FilterChainProxy$
>> VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>> at
>> org.springframework.security.web.servletapi.
>> SecurityContextHolderAwareRequestFilter.doFilter(
>> SecurityContextHolderAwareRequestFilter.java:154)
>> at
>> org.springframework.security.web.FilterChainProxy$
>> VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>> at
>> org.apache.fineract.infrastructure.security.filter.
>> TwoFactorAuthenticationFilter.doFilter(TwoFactorAuthenticationFilter.
>> java:122)
>> at
>> org.springframework.security.web.FilterChainProxy$
>> VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>> at
>> org.springframework.security.web.context.request.async.
>> WebAsyncManagerIntegrationFilter.doFilterInternal(
>> WebAsyncManagerIntegrationFilter.java:50)
>> at
>> org.springframework.web.filter.OncePerRequestFilter.
>> doFilter(OncePerRequestFilter.java:107)
>> at
>> org.springframework.security.web.FilterChainProxy$
>> VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>> at
>> org.springframework.security.web.authentication.www.
>> BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:201)
>> at
>> org.apache.fineract.infrastructure.security.filter.
>> TenantAwareBasicAuthenticationFilter.doFilter(
>> TenantAwareBasicAuthenticationFilter.java:153)
>> at
>> org.springframework.security.web.FilterChainProxy$
>> VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>> at
>> org.springframework.security.web.context.SecurityContextPersistenceFilt
>> er.doFilter(SecurityContextPersistenceFilter.java:87)
>> at
>> org.springframework.security.web.FilterChainProxy$
>> VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>> at
>> org.springframework.security.web.access.channel.ChannelProcessingFilter.
>> doFilter(ChannelProcessingFilter.java:144)
>> at
>> org.springframework.security.web.FilterChainProxy$
>> VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>> at
>> org.springframework.security.web.FilterChainProxy.doFilterInternal(
>> FilterChainProxy.java:192)
>> at
>> org.springframework.security.web.FilterChainProxy.doFilter(
>> FilterChainProxy.java:160)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
>> ApplicationFilterChain.java:241)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(
>> ApplicationFilterChain.java:208)
>> at
>> org.springframework.boot.context.web.ErrorPageFilter.
>> doFilter(ErrorPageFilter.java:108)
>> at
>> org.springframework.boot.context.web.ErrorPageFilter.
>> access$000(ErrorPageFilter.java:58)
>> at
>> org.springframework.boot.context.web.ErrorPageFilter$1.doFilterInternal(
>> ErrorPageFilter.java:87)
>> at
>> org.springframework.web.filter.OncePerRequestFilter.
>> doFilter(OncePerRequestFilter.java:107)
>> at
>> org.springframework.boot.context.web.ErrorPageFilter.
>> doFilter(ErrorPageFilter.java:100)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
>> ApplicationFilterChain.java:241)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(
>> ApplicationFilterChain.java:208)
>> at
>> org.apache.catalina.core.StandardWrapperValve.invoke(
>> StandardWrapperValve.java:219)
>> at
>> org.apache.catalina.core.StandardContextValve.invoke(
>> StandardContextValve.java:110)
>> at
>> org.apache.catalina.authenticator.AuthenticatorBase.invoke(
>> AuthenticatorBase.java:506)
>> at
>> org.apache.catalina.core.StandardHostValve.invoke(
>> StandardHostValve.java:169)
>> at
>> org.apache.catalina.valves.ErrorReportValve.invoke(
>> ErrorReportValve.java:103)
>> at org.apache.catalina.valves.AccessLogValve.invoke(
>> AccessLogValve.java:962)
>> at
>> org.apache.catalina.core.StandardEngineValve.invoke(
>> StandardEngineValve.java:116)
>> at
>> org.apache.catalina.connector.CoyoteAdapter.service(
>> CoyoteAdapter.java:445)
>> at
>> org.apache.coyote.http11.AbstractHttp11Processor.process(
>> AbstractHttp11Processor.java:1115)
>> at
>> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.
>> process(AbstractProtocol.java:637)
>> at
>> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.
>> run(JIoEndpoint.java:318)
>> at
>> java.util.concurrent.ThreadPoolExecutor.runWorker(
>> ThreadPoolExecutor.java:1149)
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(
>> ThreadPoolExecutor.java:624)
>> at
>> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(
>> TaskThread.java:61)
>> at java.lang.Thread.run(Thread.java:748)
>>
>> On Sat, Jun 9, 2018 at 7:20 AM, Raunak Sett <sett.raunak@xxxxxxxxx>
>> wrote:
>>
>> > We should use Angular Material. We should have consistent experience
>> > across all platforms and given that we are already following material
>> > design guidelines on a lot of our android clients as well as web. So it
>> > would be easier if we just have a common UI/UX guidelines for the
>> > consistency.
>> >
>> > On Fri, Jun 8, 2018 at 10:13 PM Abhay Chawla <abhay.chawla97@xxxxxxxxx>
>> > wrote:
>> >
>> >> Hello everyone,
>> >>
>> >> After some discussion, Anwesh and I have a come up with the following
>> >> points regarding the decision to use Angular Material or bootswatch and
>> >> ng-bootstrap for the new MifosX Web App (Angular 6):
>> >>
>> >> 1) ng-bootstrap is a wrapper over bootstrap.js which contains a set of
>> >> Angular Directives that can be implemented without any dependencies on
>> >> jQuery or popper.js  https://ng-bootstrap.github.io/#/home
>> >> 2) Bootswatch provides a collection of themes(21 + 1 default) for
>> >> Bootstrap  https://github.com/thomaspark/bootswatch/
>> >> 3) Bootswatch provides with an API which can be integrated with the
>> >> platform for theme configuration easily and provide the organizations
>> with
>> >> a choice from these 21 themes  https://bootswatch.com/api/4.json
>> >> 4) We are currently using the bootswatch material theme to compete and
>> >> provide with a similar kind of look as by angular-material
>> >> 5) New themes if required can be configured easily using bootstrap, as
>> a
>> >> simple example I have created a demonstration here:
>> https://abhaychawla.
>> >> github.io/angular-theme/
>> >> 6) We can also provide instructions so that the organizations will be
>> >> able to clone the project, create their own custom theme, build the
>> app and
>> >> use that theme.
>> >> 7) Overall, ng-bootstrap and bootswatch built on top of bootstrap are
>> >> easy to implement and could be modified and used to suit our needs
>> >>
>> >> 8) On the other hand, angular-material provides with 4 inbuilt material
>> >> themes to chose from  https://material.angular.io/
>> >> 9) More custom themes can be configured according to organizations
>> needs
>> >> using angular-material as well but it will be a bit more complex
>> >> 10) Overall, angular-material will be more time consuming and a little
>> >> difficult to implement
>> >>
>> >> We would like to share this with the community and get their opinion
>> >> regarding our choice of design framework so that we can finalize the
>> same
>> >> as soon as possible in the initial stage of the project.
>> >>
>> >> Looking forward to your responses.
>> >>
>> >> Thanks
>> >> Abhay.
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google
>> Groups
>> >> "Mifos Google Summer of Code 2018" group.
>> >> To unsubscribe from this group and stop receiving emails from it, send
>> an
>> >> email to gsoc-2018+unsubscribe@xxxxxxxxx.
>> >>
>> >
>> >
>> > --
>> > Raunak Sett
>> >
>> > ------------------------------------------------------------
>> > ------------------
>> > Check out the vibrant tech community on one of the world's most
>> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> > Mifos-developer mailing list
>> > mifos-developer@xxxxxxxxxxxxxxxxxxxxx
>> > Unsubscribe or change settings at:
>> > https://lists.sourceforge.net/lists/listinfo/mifos-developer
>> >
>>
>
>
> --
> *Ed Cable*
> President/CEO, Mifos Initiative
> edcable@xxxxxxxxx | Skype: edcable | Mobile: +1.484.477.8649
>
> *Collectively Creating a World of 3 Billion Maries | *http://mifos.org
> <http://facebook.com/mifos>  <http://www.twitter.com/mifos>
>
>