Skip to content

Instantly share code, notes, and snippets.

@amichaelgrant
amichaelgrant / gist:3965350
Created October 27, 2012 17:07 — forked from svmehta/gist:3835969
mongoose atomicity question
// add comment function
function addComment(req, res) {
PostModel.findById(req.params.postId, function (err, foundPost) {
if(err) {
return handleError(err)
}
var commentObj = {
user: req.session.userId,
@amichaelgrant
amichaelgrant / gist:4412492
Created December 30, 2012 11:52
Accessing Expressjs sessions in with signed cookies nowjs
r
root@cnocgrant-OptiPlex-380:/media/DATA/CORENETT/mifosx/mifosx/mifosng-provider# gradle clean tomcatRunWar
Creating properties on demand (a.k.a. dynamic properties) has been deprecated and is scheduled to be removed in Gradle 2.0. Please read http://gradle.org/docs/current/dsl/org.gradle.api.plugins.ExtraPropertiesExtension.html for information on the replacement for dynamic properties.
Deprecated dynamic property: "configFile" on "task ':tomcatStop'", value: "/media/DATA/CORENETT/m...".
Deprecated dynamic property: "httpPort" on "task ':tomcatStop'", value: "8080".
Deprecated dynamic property: "httpsPort" on "task ':tomcatStop'", value: "8443".
Deprecated dynamic property: "enableSSL" on "task ':tomcatStop'", value: "true".
:clean
:compileJava
/media/DATA/CORENETT/mifosx/mifosx/mifosng-provider/src/test/java/org/mifosplatform/portfolio/loanaccount/DecliningBalanceMethodLoanScheduleGeneratorTest.java:6: package org.junit does not exist
import org.junit.Before;
HTTP Status 500 - Could not get JDBC Connection; nested exception is org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password: YES))
type Exception report
message Could not get JDBC Connection; nested exception is org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password: YES))
description The server encountered an internal error that prevented it from fulfilling this request.
exception
createClient -->{"officeId":1,"firstname":"Michael","lastname":"Grant","externalId":"Not-so-much","dateFormat":"dd MMMM yyyy","joiningDate":"13 June 2013"}
HTTP URL -->https://localhost:8443/mifosng-provider/api/v1/clients
HTTP Status Line ->HTTP/1.1 400 Bad Request
HTTP Line ->Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
HTTP Line ->Content-Type: application/json
HTTP Line ->Transfer-Encoding: chunked
HTTP Line ->Date: Wed, 23 Jan 2013 17:07:00 GMT
HTTP Line ->null
{"developerMessage":"The request was invalid. This typically will happen due to validation errors which are provided.","developerDocLink":"https://github.com/keithwoodlock/mifosx/wiki/HTTP-API-Error-codes","httpStatusCode":"400","defaultUserMessage":"Validation errors exist.","userMessageGlobalisationCode":"validation.msg.validation.errors.exist","errors":[{"developerMessage":"The parameter joiningDate is not supported.","defaultUserMessage":"The parameter joiningDate is not supported.","userMessageGlobalisationCode":"error.m
@amichaelgrant
amichaelgrant / gist:4610953
Created January 23, 2013 17:48
This happens when executing this commands from the UI Reports -> Client Reports ->Run
Response Text: {"developerMessage":"The request caused a data integrity issue to be fired by the database.","developerDocLink":"https://github.com/keithwoodlock/mifosx/wiki/HTTP-API-Error-codes","httpStatusCode":"403","defaultUserMessage":"Unknown column 'c.joining_date' in 'field list'","userMessageGlobalisationCode":"error.msg.sql.error","errors":[{"developerMessage":"Unknown column 'c.joining_date' in 'field list'","defaultUserMessage":"Unknown column 'c.joining_date' in 'field list'","userMessageGlobalisationCode":"error.msg.sql.error","parameterName":"Sql: select x.* from (select ounder.`name` as \"Office/Branch\", concat(c.lastname, if(c.firstname > \"\", concat(\", \", c.firstname), \"\")) as \"Name\", \r\nc.joining_date as \"Joining Date\"\r\nfrom m_office o \r\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, '%')\r\nand ounder.hierarchy like concat('.', '%')\r\njoin m_client c on c.office_id = ounder.id\r\nwhere o.id = 1\r\nand c.is_deleted=0\r\norder by ounder.hierarchy) x","value
{"dateFormat":"dd MMMM yyyy","locale":"en_GB","clientId":53,"productId":1,"interestType":1,"commencementDate":"29 jan 2013","lockinPeriodType":1,"lockinPeriod":12,"isLockinPeriodAllowed":false,"isPartialDepositAllowed":true,"minimumBalanceForWithdrawal":2.0,"interestCalculationMethod":1,"tenure":1,"tenureType":1,"savingInterestRate":0.1,"recurringInterestRate":0.5,"savingsDepositAmountPerPeriod":20.0,"digitsAfterDecimal":2,"currencyCode":"1","externalId":"ex-sav-id","frequency":1}
@amichaelgrant
amichaelgrant / gist:4706147
Created February 4, 2013 11:02
Mifosx deposit approval issued from web UI generates "No connection. Verify application is running" error. The logs show the following dump.
10:58:05.370 [http-bio-8443-exec-9] INFO o.m.i.s.f.TenantAwareBasicAuthenticationFilter - {"startTime":1359975485363,"totalTime":6,"method":"OPTIONS","url":"https://localhost:8443/mifosng-provider/api/v1/depositaccounts/1","parameters":{"associations":["all"]}}
Failed Query Report SQL=select da.id as id, da.external_id as externalId, da.client_id as clientId, da.product_id as productId, da.currency_code as currencyCode, da.currency_digits as currencyDigits, da.deposit_amount as depositAmount, da.status_enum as statusId, da.maturity_nominal_interest_rate as interestRate, da.tenure_months as termInMonths, da.projected_commencement_date as projectedCommencementDate, da.actual_commencement_date as actualCommencementDate, da.matures_on_date as maturedOn, da.projected_interest_accrued_on_maturity as projectedInterestAccrued, da.actual_interest_accrued as actualInterestAccrued, da.projected_total_maturity_amount as projectedMaturityAmount, da.actual_total_amount as actualMaturityAmount, da.interest_compounded_
@amichaelgrant
amichaelgrant / gist:4708307
Created February 4, 2013 17:54
savings account approval error
authPath -->https://localhost:8443/mifosng-provider/api/v1/authentication?username=mifos&password=password
HTTP Status Line ->HTTP/1.1 200 OK
HTTP Line ->Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
HTTP Line ->Content-Type: application/json
HTTP Line ->Transfer-Encoding: chunked
HTTP Line ->Date: Mon, 04 Feb 2013 17:49:08 GMT
HTTP Line ->null
data authToX ==>{"username":"mifos","userId":1,"base64EncodedAuthenticationKey":"bWlmb3M6cGFzc3dvcmQ\u003d","authenticated":true,"permissions":["ALL_FUNCTIONS"]}
u ==> mifos
key ==> bWlmb3M6cGFzc3dvcmQ=
@amichaelgrant
amichaelgrant / gist:4753857
Created February 11, 2013 11:01
Server logs when deploying mifos on tomcat 7 with SSL and JNDI setup
grant >> tail -f mifos-platform.log
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:730) ~[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:486) ~[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE]
... 46 common frames omitted
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [javax.sql.DataSource] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier(value=tenantDataSourceJndi)}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:949) ~[spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE]
at org.springframework.beans.factory