[Mifos-issues] [JIRA] (MIFOSX-1756) Make it easy for Static Web Content such as the community-app to be served by the new standalone end-user server (not development)

14 views
Skip to first unread message

Michael Vorburger (JIRA)

unread,
Dec 13, 2014, 12:34:10 PM12/13/14
to mifos-...@lists.sourceforge.net
Michael Vorburger created an issue
 
Mifos X / Dev Task MIFOSX-1756
Make it easy for Static Web Content such as the community-app to be served by the new standalone end-user server (not development)
Issue Type: Dev Task Dev Task
Assignee: Unassigned
Created: 13/Dec/14 9:33 AM
Priority: Major Major
Reporter: Michael Vorburger

The new standalone "java -jar mifos.war" end-user server (see MIFOSX-1552 parent task and blog past linked from it) greatly simplify the first time set-up experience for non-technical Mifos users, as it completely removes the need to do ANY mysql and Tomcat etc. etc. set-up.

The biggest missing area is that this only covers the REST API back-end server. Ideally, Static Web Content for UIs such as the community-app should also as easily to be able to be served by the new standalone server. The focus here is for end-user, not for developers, as during development grunt serve will be what most people will continue to use.

According to http://spring.io/blog/2013/12/19/serving-static-web-content-with-spring-boot and http://docs.spring.io/spring-boot/docs/1.2.0.RELEASE/reference/htmlsingle/#boot-features-spring-mvc-static-content Spring boot can serve any static content present in a folder called /static or /public in its classpath.

What's missing is that we probably should start introducing a mifos.sh + mifos.bat launch script, which wraps "java -jar mifos.war" and does something like (I haven't tested this myself yet) "java -jar mifos.war -cp web", or "java -cp mifos.war:web ..mainclass.." if -jar and -cp cannot be combined. If the Gradle build script producing the dist could then be extended to have a web/ folder in which static content can be dropped, we'd be cool.

This could also be of interest for the upcoming SDK and plug-ins concept, for which I had done some work with Avik Ganguly; our idea there was to have a plugins/ folder and have said TBC script add all *.jar in that folder to the CP.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4-OD-11-014#64007-sha1:d74ee47)
Atlassian logo

Michael Vorburger (JIRA)

unread,
Dec 17, 2014, 10:14:09 AM12/17/14
to mifos-...@lists.sourceforge.net

Michael Vorburger (JIRA)

unread,
Dec 17, 2014, 10:15:10 AM12/17/14
to mifos-...@lists.sourceforge.net

Michael Vorburger (JIRA)

unread,
Dec 28, 2014, 4:13:29 PM12/28/14
to mifos-...@lists.sourceforge.net

Michael Vorburger (JIRA)

unread,
Dec 29, 2014, 8:01:12 PM12/29/14
to mifos-...@lists.sourceforge.net

Michael Vorburger (JIRA)

unread,
Mar 10, 2015, 7:20:10 AM3/10/15
to mifos-...@lists.sourceforge.net

Vishwas Babu A J (JIRA)

unread,
Apr 16, 2015, 8:48:10 PM4/16/15
to mifos-...@lists.sourceforge.net

Michael Vorburger : While trying this out (on a mac) , I see failure on some API's (as a result sections like reporting do not work)

Her's an example of a URL

https://localhost:8443/mifosng-provider/api/v1/runreports/reportCategoryList?R_reportCategory=Client&genericResultSet=false&parameterType=true&tenantIdentifier=default

and the error log

{  
   "timestamp":1429228005665,
   "status":500,
   "error":"Internal Server Error",
   "exception":"org.springframework.jdbc.BadSqlGrammarException",
   "message":"StatementCallback; bad SQL grammar [select x.* from (select parameter_sql as the_sql from stretchy_parameter where parameter_name = 'reportCategoryList') x]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'mifostenant-default.x' doesn't exist",
   "path":"/mifosng-provider/api/v1/runreports/reportCategoryList"
}
This message was sent by Atlassian JIRA (v6.4-OD-16-006#64014-sha1:e47e3fa)
Atlassian logo

Vishwas Babu A J (JIRA)

unread,
Apr 16, 2015, 8:55:14 PM4/16/15
to mifos-...@lists.sourceforge.net
Vishwas Babu A J edited a comment on Dev Task MIFOSX-1756
[~michael.vorburger] : While trying this out (on a mac) , I see failure on some API's (as a result sections like reporting do not work)



Her's an example of a URL


   "timestamp":1429228005665,
   "status":500,
   "error":"Internal Server Error",
   "exception":"org.springframework.jdbc.BadSqlGrammarException",
   "message":"StatementCallback; bad SQL grammar [select x.* from (select parameter_sql as the_sql from stretchy_parameter where parameter_name = 'reportCategoryList') x]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'mifostenant-default.x' doesn't exist",
   "path":"/mifosng-provider/api/v1/runreports/reportCategoryList"
}
{code}

The detailed log

{code}
6:46:45.662 [http-nio-8443-exec-10] ERROR c.s.j.s.container.ContainerResponse - The RuntimeException could not be mapped to a response, re-throwing to the HTTP container
org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [select x.* from (select parameter_sql as the_sql from stretchy_parameter where parameter_name = 'reportCategoryList') x]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'mifostenant-default.x' doesn't exist
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231) ~[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.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.mifosplatform.infrastructure.dataqueries.service.ReadReportingServiceImpl.getSql(ReadReportingServiceImpl.java:223) ~[classes!/:na]
at org.mifosplatform.infrastructure.dataqueries.service.ReadReportingServiceImpl.getSQLtoRun(ReadReportingServiceImpl.java:195) ~[classes!/:na]
at org.mifosplatform.infrastructure.dataqueries.service.ReadReportingServiceImpl.retrieveGenericResultset(ReadReportingServiceImpl.java:184) ~[classes!/:na]
at org.mifosplatform.infrastructure.dataqueries.api.RunreportsApiResource.runReport(RunreportsApiResource.java:107) ~[classes!/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_40]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_40]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_40]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_40]
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]
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) ~[jersey-server-1.17.jar!/:1.17]
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302) ~[jersey-server-1.17.jar!/:1.17]
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) ~[jersey-server-1.17.jar!/:1.17]
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108) ~[jersey-server-1.17.jar!/:1.17]
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) ~[jersey-server-1.17.jar!/:1.17]
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) ~[jersey-server-1.17.jar!/:1.17]
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1511) [jersey-server-1.17.jar!/:1.17]
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1442) [jersey-server-1.17.jar!/:1.17]
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391) [jersey-server-1.17.jar!/:1.17]
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381) [jersey-server-1.17.jar!/:1.17]
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416) [jersey-servlet-1.17.jar!/:1.17]
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538) [jersey-servlet-1.17.jar!/:1.17]
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716) [jersey-servlet-1.17.jar!/:1.17]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) [tomcat-embed-core-7.0.55.jar!/:7.0.55]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) [tomcat-embed-core-7.0.55.jar!/:7.0.55]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [tomcat-embed-core-7.0.55.jar!/:7.0.55]
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:108) [spring-security-web-3.2.5.RELEASE.jar!/:3.2.5.RELEASE]
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84) [spring-security-web-3.2.5.RELEASE.jar!/:3.2.5.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [tomcat-embed-core-7.0.55.jar!/:7.0.55]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [tomcat-embed-core-7.0.55.jar!/:7.0.55]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-3.2.5.RELEASE.jar!/:3.2.5.RELEASE]
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118) [spring-security-web-3.2.5.RELEASE.jar!/:3.2.5.RELEASE]
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84) [spring-security-web-3.2.5.RELEASE.jar!/:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.5.RELEASE.jar!/:3.2.5.RELEASE]
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113) [spring-security-web-3.2.5.RELEASE.jar!/:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.5.RELEASE.jar!/:3.2.5.RELEASE]
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113) [spring-security-web-3.2.5.RELEASE.jar!/:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.5.RELEASE.jar!/:3.2.5.RELEASE]
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154) [spring-security-web-3.2.5.RELEASE.jar!/:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.5.RELEASE.jar!/:3.2.5.RELEASE]
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50) [spring-security-web-3.2.5.RELEASE.jar!/:3.2.5.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.0.7.RELEASE.jar!/:4.0.7.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.5.RELEASE.jar!/:3.2.5.RELEASE]
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:201) [spring-security-web-3.2.5.RELEASE.jar!/:3.2.5.RELEASE]
at org.mifosplatform.infrastructure.security.filter.TenantAwareBasicAuthenticationFilter.doFilter(TenantAwareBasicAuthenticationFilter.java:126) [classes!/:na]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.5.RELEASE.jar!/:3.2.5.RELEASE]
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) [spring-security-web-3.2.5.RELEASE.jar!/:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.5.RELEASE.jar!/:3.2.5.RELEASE]
at org.springframework.security.web.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:144) [spring-security-web-3.2.5.RELEASE.jar!/:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.5.RELEASE.jar!/:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192) [spring-security-web-3.2.5.RELEASE.jar!/:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160) [spring-security-web-3.2.5.RELEASE.jar!/:3.2.5.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [tomcat-embed-core-7.0.55.jar!/:7.0.55]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [tomcat-embed-core-7.0.55.jar!/:7.0.55]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) [tomcat-embed-core-7.0.55.jar!/:7.0.55]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) [tomcat-embed-core-7.0.55.jar!/:7.0.55]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) [tomcat-embed-core-7.0.55.jar!/:7.0.55]
at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:683) [tomcat-embed-core-7.0.55.jar!/:7.0.55]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) [tomcat-embed-core-7.0.55.jar!/:7.0.55]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) [tomcat-embed-core-7.0.55.jar!/:7.0.55]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) [tomcat-embed-core-7.0.55.jar!/:7.0.55]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) [tomcat-embed-core-7.0.55.jar!/:7.0.55]
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070) [tomcat-embed-core-7.0.55.jar!/:7.0.55]
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611) [tomcat-embed-core-7.0.55.jar!/:7.0.55]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1736) [tomcat-embed-core-7.0.55.jar!/:7.0.55]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1695) [tomcat-embed-core-7.0.55.jar!/:7.0.55]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_40]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_40]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-7.0.55.jar!/:7.0.55]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_40]
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'mifostenant-default.x' doesn't exist
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_40]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_40]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_40]
at java.lang.reflect.Constructor.newInstance(Constructor.java:422) ~[na:1.8.0_40]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) ~[mysql-connector-java-5.1.27.jar!/:na]
at com.mysql.jdbc.Util.getInstance(Util.java:386) ~[mysql-connector-java-5.1.27.jar!/:na]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054) ~[mysql-connector-java-5.1.27.jar!/:na]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237) ~[mysql-connector-java-5.1.27.jar!/:na]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169) ~[mysql-connector-java-5.1.27.jar!/:na]
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2617) ~[mysql-connector-java-5.1.27.jar!/:na]
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2778) ~[mysql-connector-java-5.1.27.jar!/:na]
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2819) ~[mysql-connector-java-5.1.27.jar!/:na]
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2768) ~[mysql-connector-java-5.1.27.jar!/:na]
at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1612) ~[mysql-connector-java-5.1.27.jar!/:na]
at com.mysql.jdbc.Field.getCollation(Field.java:493) ~[mysql-connector-java-5.1.27.jar!/:na]
at com.mysql.jdbc.ResultSetMetaData.isCaseSensitive(ResultSetMetaData.java:567) ~[mysql-connector-java-5.1.27.jar!/:na]
at com.sun.rowset.CachedRowSetImpl.initMetaData(CachedRowSetImpl.java:722) ~[na:1.8.0_40]
at com.sun.rowset.CachedRowSetImpl.populate(CachedRowSetImpl.java:639) ~[na:1.8.0_40]
at org.springframework.jdbc.core.SqlRowSetResultSetExtractor.createSqlRowSet(SqlRowSetResultSetExtractor.java:81) ~[spring-jdbc-4.0.7.RELEASE.jar!/:4.0.7.RELEASE]
at org.springframework.jdbc.core.SqlRowSetResultSetExtractor.extractData(SqlRowSetResultSetExtractor.java:64) ~[spring-jdbc-4.0.7.RELEASE.jar!/:4.0.7.RELEASE]
at org.springframework.jdbc.core.SqlRowSetResultSetExtractor.extractData(SqlRowSetResultSetExtractor.java:46) ~[spring-jdbc-4.0.7.RELEASE.jar!/:4.0.7.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:457) ~[spring-jdbc-4.0.7.RELEASE.jar!/:4.0.7.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:402) ~[spring-jdbc-4.0.7.RELEASE.jar!/:4.0.7.RELEASE]
... 72 common frames omitted

{code}

Note that I am able to connect to the MariaDB instance and execute the query successfully. Also, the regular installation wherein the platfrom talks to a MySQL database does not have this issue
Reply all
Reply to author
Forward
0 new messages