error using curl command

Hi all DHIS2 Members,
I tried all my heart.

but it is still meet the problem.

Inline image 1

1.json (1.38 KB)

···

On Tue, Sep 8, 2015 at 11:58 AM, channara rin rin.channara@gmail.com wrote:

plz check my attached file. I already change to UTF-8.

On Tue, Sep 8, 2015 at 11:56 AM, channara rin rin.channara@gmail.com wrote:

Hi jason,
I remove my gow and then download from github gow.

and then i run again. i got this problem


c:\Program Files (x86)\Gow\bin>curl -d @ppp.json “localhost:8080/dhis/api/trackedEntityInstances” -X POST -H “Content-Type: application/json” -u admin:***** -v

  • Hostname was NOT found in DNS cache
  • Trying ::1…
  • Connected to localhost (::1) port 8080 (#0)
  • Server auth using Basic with user ‘admin’

POST /dhis/api/trackedEntityInstances HTTP/1.1

Authorization: Basic YWRtaW46TmFyYXZ5bHVjazc=

User-Agent: curl/7.35.0

Host: localhost:8080

Accept: /

Content-Type: application/json

Content-Length: 3498

Expect: 100-continue

< HTTP/1.1 100 Continue

< HTTP/1.1 500 Internal Server Error

  • Server Apache-Coyote/1.1 is not blacklisted

< Server: Apache-Coyote/1.1

< X-XSS-Protection: 1; mode=block

< X-Frame-Options: DENY

< X-Content-Type-Options: nosniff

< Set-Cookie: JSESSIONID=E02D93CACBE26EEB7E417B338359FF8B; Path=/dhis/; HttpOnly

< Content-Type: text/html;charset=utf-8

< Content-Language: en

< Transfer-Encoding: chunked

< Date: Tue, 08 Sep 2015 04:54:19 GMT

< Connection: close

<

Apache Tomcat/7.0.64 - Error report

HTTP Status 500 - Can not deserialize instance of org.hisp.dhis.dxf2.events.trackedentity.TrackedEntityInstance out of START_ARRAY token


type Exception report

message Can not deserialize instance of org.hisp.dhis.dxf2.events.trackedentity.TrackedEntityInstance out of START_ARRAY token

description The server encountered an internal error that prevented it from fulfilling this request.

exception

com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of org.hisp.dhis.dxf2.events.trackedentity.TrackedEntityInstance out of START_ARRAY token

at [Source: [ { "trackedEntity": "PtPf474EHLM", "orgUnit": "NcA7HpabeAG", "attributes": [ { "attribute": "jZbsh2zpVWa", "value": "0201" }, { "attribute": "j9sScvXsXVO", "value": "ABC" }, { "attribute": "szmBW8EDWLx", "value": "Male" }, { "attribute": "adZnoplDPyx", "value": "48" }, { "attribute": "j16LxVcr8hV", "value": "1967-08-31" }, { "attribute": "T82mY6tjGVY", "value": "Married" }, { "attribute": "pyX2F5mjX5L", "value": "Siem Reap" }, { "attribute": "CakCGhhkSJK", "value": "Siem Reap" }, { "attribute": "zAKBPz96mci", "value": "Siem Reap" }, { "attribute": "VstyNjHv8KM", "value": "AB" }, { "attribute": "SmHt9k5t501", "value": "AB" }, { "attribute": "CQqQwvsiZsg", "value": "AB" }, { "attribute": "HVcRcWAW55I", "value": "ART" }, { "attribute": "RtAymQ0PT5p", "value": "410" }, { "attribute": "ZSEdw9AHbIC", "value": "1641" }, { "attribute": "JQtRizheDhD", "value": "2005-04-11" } ] }, { "trackedEntity": "PtPf474EHLM", "orgUnit": "NcA7HpabeAG", "attributes": [ { "attribute": "jZbsh2zpVWa", "value": "0202" }, { "attribute": "j9sScvXsXVO", "value": "DEF" }, { "attribute": "szmBW8EDWLx", "value": "Male" }, { "attribute": "adZnoplDPyx", "value": "42" }, { "attribute": "j16LxVcr8hV", "value": "1973-08-31" }, { "attribute": "T82mY6tjGVY", "value": "Married" }, { "attribute": "pyX2F5mjX5L", "value": "Siem Reap" }, { "attribute": "CakCGhhkSJK", "value": "Siem Reap" }, { "attribute": "zAKBPz96mci", "value": "Siem Reap" }, { "attribute": "VstyNjHv8KM", "value": "AB" }, { "attribute": "SmHt9k5t501", "value": "AB" }, { "attribute": "CQqQwvsiZsg", "value": "AB" }, { "attribute": "HVcRcWAW55I", "value": "ART" }, { "attribute": "RtAymQ0PT5p", "value": "423" }, { "attribute": "ZSEdw9AHbIC", "value": "457" }, { "attribute": "JQtRizheDhD", "value": "2005-06-17" } ] }]; line: 1, column: 1]

com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:148)

com.fasterxml.jackson.databind.DeserializationContext.mappingException(DeserializationContext.java:835)

com.fasterxml.jackson.databind.DeserializationContext.mappingException(DeserializationContext.java:831)

com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromArray(BeanDeserializerBase.java:1229)

com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:165)

com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:144)

com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3562)

com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2578)

org.hisp.dhis.dxf2.events.trackedentity.JacksonTrackedEntityInstanceService.fromJson(JacksonTrackedEntityInstanceService.java:83)

org.hisp.dhis.dxf2.events.trackedentity.JacksonTrackedEntityInstanceService.addTrackedEntityInstanceJson(JacksonTrackedEntityInstanceService.java:133)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

java.lang.reflect.Method.invoke(Unknown Source)

org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)

org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)

org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)

org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)

com.sun.proxy.$Proxy175.addTrackedEntityInstanceJson(Unknown Source)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

java.lang.reflect.Method.invoke(Unknown Source)

org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)

org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)

org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)

com.sun.proxy.$Proxy127.addTrackedEntityInstanceJson(Unknown Source)

org.hisp.dhis.webapi.controller.event.TrackedEntityInstanceController.postTrackedEntityInstanceJson(TrackedEntityInstanceController.java:357)

org.hisp.dhis.webapi.controller.event.TrackedEntityInstanceController$$FastClassBySpringCGLIB$$cfbc2606.invoke(<generated>)

org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)

org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:717)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:64)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653)

org.hisp.dhis.webapi.controller.event.TrackedEntityInstanceController$$EnhancerBySpringCGLIB$$930005f.postTrackedEntityInstanceJson(<generated>)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

java.lang.reflect.Method.invoke(Unknown Source)

org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)

org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)

org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)

org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776)

org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705)

org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)

org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)

org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)

org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)

org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869)

javax.servlet.http.HttpServlet.service(HttpServlet.java:650)

org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)

javax.servlet.http.HttpServlet.service(HttpServlet.java:731)

org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)

org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)

org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:201)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.CorsFilter.doFilter(CorsFilter.java:93)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.CustomAuthenticationFilter.doFilter(CustomAuthenticationFilter.java:64)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter.doFilter(OAuth2AuthenticationProcessingFilter.java:140)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.AutomaticAccessFilter.doFilter(AutomaticAccessFilter.java:115)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:57)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)

org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)

org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)

org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)

org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:82)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:151)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.64 logs.


Apache Tomcat/7.0.64

* Closing connection 0


On Tue, Sep 8, 2015 at 11:37 AM, channara rin rin.channara@gmail.com wrote:

YES, i do this afew days already. it still has problem
Could you help me

If i log with browser with username and password. i can log in.

OR i use DHIS2 version or tomcat version wrong?

Here is my teamviewer:

ID:804 884 570

Password: 6659

On Tue, Sep 8, 2015 at 1:24 AM, Jason Pickering jason.p.pickering@gmail.com wrote:

That payload, executed against the demo server, does not result in that error. Are you 100% sure your username and password are correct as the error indicates clearly it is an authentication issue.

We have been on this simple topic for days now. Can you provide access to your server toa development team member to diagnose what the problem or problems are?

Regards,

Jason

On Mon, Sep 7, 2015, 17:20 channara rin rin.channara@gmail.com wrote:

Yes, i changed alredy to make very my json. now is valide.
But it is still error using curl command. it always display this messge like below:

On Mon, Sep 7, 2015 at 5:52 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi ,
This should work.

{

“trackedEntity”: “PtPf474EHLM”,

“orgUnit”: “NcA7HpabeAG”,

“attributes”: [{

“attribute”: “jZbsh2zpVWa”,

“value”: “0201”

}, {

“attribute”: “j9sScvXsXVO”,

“value”: “Name of Person”

}, {

“attribute”: “szmBW8EDWLx”,

“value”: “Male”

}, {

“attribute”: “adZnoplDPyx”,

“value”: “48”

}, {

“attribute”: “j16LxVcr8hV”,

“value”: “1967-08-31”

}, {

“attribute”: “T82mY6tjGVY”,

“value”: “Married”

}, {

“attribute”: “pyX2F5mjX5L”,

“value”: “Siem Reap”

}, {

“attribute”: “CakCGhhkSJK”,

“value”: “Siem Reap”

}, {

“attribute”: “zAKBPz96mci”,

“value”: “Siem Reap”

}, {

“attribute”: “VstyNjHv8KM”,

“value”: “%u1782%u17C4%u1780%u1785%u1780”

}, {

“attribute”: “SmHt9k5t501”,

“value”: “%u1782%u17C4%u1780%u1785%u1780”

}, {

“attribute”: “CQqQwvsiZsg”,

“value”: “%u1797%u17BC%u1798%u17B7%A0%u178F%u17D2%u179A%u1796%u17B6%u17C6%u1784%u179F%u17C1%u17C7”

}, {

“attribute”: “HVcRcWAW55I”,

“value”: “ART”

}, {

“attribute”: “RtAymQ0PT5p”,

“value”: “410”

}, {

“attribute”: “ZSEdw9AHbIC”,

“value”: “1641”

}, {

“attribute”: “JQtRizheDhD”,

“value”: “2005-04-11”

}]

}

Also,you also had an extra comma after {

“attribute”: “JQtRizheDhD”,

“value”: “2005-04-11”

}

Please use http://jsonlint.com/ to verfiy your JSON.

Regards,

Jason

On Mon, Sep 7, 2015 at 12:49 PM, channara rin rin.channara@gmail.com wrote:

it doesn’t work.


Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049

On Mon, Sep 7, 2015 at 5:48 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

Do not use BOM. Just utf-8.

On 7 September 2015 at 11:44, channara rin rin.channara@gmail.com wrote:

so which encoding should i choose? now default is “UTF-8-BOM”

On Mon, Sep 7, 2015 at 5:42 PM, channara rin rin.channara@gmail.com wrote:

OH!, ok let me check character-set

Hi Morten, when i add -v. i got this message.

On Mon, Sep 7, 2015 at 5:39 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi Channara,

You must properly encode your Khmer characters. Maybe Morten can say more about this, but I am pretty sure it has something to do with this.

Here is the actual text (not screenshot), which indicates an error related to some invalid characters.

Regards,

Jason

jason@jason-Precision-M2800:~/Downloads$ curl -d @1.jsonhttps://apps.dhis2.org/demo/api/trackedEntityInstances” -X POST -H “Content-Type: application/json” -u admin:district

Apache Tomcat/7.0.63 - Error report

HTTP Status 500 - Unexpected character ('' (code 65279 / 0xfeff)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')


type Exception report

message Unexpected character ('' (code 65279 / 0xfeff)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')

description The server encountered an internal error that prevented it from fulfilling this request.

exception

com.fasterxml.jackson.core.JsonParseException: Unexpected character ('' (code 65279 / 0xfeff)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')

at [Source: {"trackedEntity":"PtPf474EHLM","orgUnit":"NcA7HpabeAG","attributes":[{"attribute":"jZbsh2zpVWa","value":"0201"},{"attribute":"j9sScvXsXVO","value":"Name of Person"},{"attribute":"szmBW8EDWLx","value":"Male"},{"attribute":"adZnoplDPyx","value":"48"},{"attribute":"j16LxVcr8hV","value":"1967-08-31"},{"attribute":"T82mY6tjGVY","value":"Married"},{"attribute":"pyX2F5mjX5L","value":"Siem Reap"},{"attribute":"CakCGhhkSJK","value":"Siem Reap"},{"attribute":"zAKBPz96mci","value":"Siem Reap"},{"attribute":"VstyNjHv8KM","value":"គោកចក"},{"attribute":"SmHt9k5t501","value":"គោកចក"},{"attribute":"CQqQwvsiZsg","value":"ភូមិ ត្រពាំងសេះ"},{"attribute":"HVcRcWAW55I","value":"ART"},{"attribute":"RtAymQ0PT5p","value":"410"},{"attribute":"ZSEdw9AHbIC","value":"1641"},{"attribute":"JQtRizheDhD","value":"2005-04-11"},]}; line: 1, column: 2]

com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1487)

com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:518)

com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:447)

com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1461)

com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:683)

com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:3602)

com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3547)

com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2578)

org.hisp.dhis.dxf2.events.trackedentity.JacksonTrackedEntityInstanceService.fromJson(JacksonTrackedEntityInstanceService.java:83)

org.hisp.dhis.dxf2.events.trackedentity.JacksonTrackedEntityInstanceService.addTrackedEntityInstanceJson(JacksonTrackedEntityInstanceService.java:133)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

java.lang.reflect.Method.invoke(Method.java:497)

org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)

org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)

org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)

org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)

com.sun.proxy.$Proxy177.addTrackedEntityInstanceJson(Unknown Source)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

java.lang.reflect.Method.invoke(Method.java:497)

org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)

org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)

org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)

com.sun.proxy.$Proxy127.addTrackedEntityInstanceJson(Unknown Source)

org.hisp.dhis.webapi.controller.event.TrackedEntityInstanceController.postTrackedEntityInstanceJson(TrackedEntityInstanceController.java:357)

org.hisp.dhis.webapi.controller.event.TrackedEntityInstanceController$$FastClassBySpringCGLIB$$cfbc2606.invoke(<generated>)

org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)

org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:717)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:64)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653)

org.hisp.dhis.webapi.controller.event.TrackedEntityInstanceController$$EnhancerBySpringCGLIB$$ab43fc35.postTrackedEntityInstanceJson(<generated>)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

java.lang.reflect.Method.invoke(Method.java:497)

org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)

org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)

org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)

org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776)

org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705)

org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)

org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)

org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)

org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)

org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869)

javax.servlet.http.HttpServlet.service(HttpServlet.java:650)

org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)

javax.servlet.http.HttpServlet.service(HttpServlet.java:731)

org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)

org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)

org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:201)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.CorsFilter.doFilter(CorsFilter.java:93)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.CustomAuthenticationFilter.doFilter(CustomAuthenticationFilter.java:64)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter.doFilter(OAuth2AuthenticationProcessingFilter.java:140)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.AutomaticAccessFilter.doFilter(AutomaticAccessFilter.java:115)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:57)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)

org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)

org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)

org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)

org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:82)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:151)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.63 logs.


Apache Tomcat/7.0.63

jason@jason-Precision-M2800:~/Downloads$

On Mon, Sep 7, 2015 at 12:24 PM, channara rin rin.channara@gmail.com wrote:

hi morten,
if i coding with PHP use CURL command. i still get the following error. and my json in attached file.

By the way, i use apache v8 and DHIS2 v2.20


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049

On Fri, Sep 4, 2015 at 3:58 PM, channara rin rin.channara@gmail.com wrote:

If i tried use test with -u … that is work fine. but if i add more function like -X POST -d -v… it doesn’t work…

On Fri, Sep 4, 2015 at 3:55 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

Hi Channara

I just had a look at your original mail and I see that the user admin was recognized so it means the curl option was ok but some issue with the password. My guess is that you have some strange characters in the password which are being expanded/interpreted by the shell.

Try quoting like:

-u “admin:xxxxx”

or

-u ‘admin:xxxxx’

On 4 September 2015 at 09:46, channara rin rin.channara@gmail.com wrote:

Hi Morten,
Hi tried test with user:password first. but still error.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Thu, Sep 3, 2015 at 11:43 PM, channara rin rin.channara@gmail.com wrote:

yes, it work too.

On Thu, Sep 3, 2015 at 6:45 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

Try to test with something simpler

curl -u user:pass http://server/api/dataElements

And see if it works


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp


Morten

On Thu, Sep 3, 2015 at 5:23 PM, Knut Staring knutst@gmail.com wrote:

Channara, are you using GOW?

https://github.com/bmatzelle/gow

On Thu, Sep 3, 2015 at 12:08 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

I have also seen weird issues on window versions of cURL where -u user:pass is required to be FIRST (mac/linux should be fine)


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Knut Staring

Dept. of Informatics, University of Oslo

Norway: +4791880522

Skype: knutstar

http://dhis2.org


Morten

On Thu, Sep 3, 2015 at 5:07 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

Hi Channara

The man page for curl indicates that the format of the command is:

curl

Try moving your url to the end of the line, after the options. Also you might want to add “http://localhost.…”


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On 3 September 2015 at 11:01, channara rin rin.channara@gmail.com wrote:

Hi DHIS2 friends,
i tried use curl command to import tracker, but i got error.

can you help me what is problem?

***THIS IS COMMAND RUNNING:

***THIS IS CONSOLE in APACHE


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Hi Jason,
I tried my best, if i copy your json file above, it work fine. But when i go to look data, it like in picture below. so what should i do. I think the problem of importing is characterset. so how can i do?

image

image

image

image

image

image

···

On Mon, Sep 7, 2015 at 5:52 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi ,
This should work.

{

“trackedEntity”: “PtPf474EHLM”,

“orgUnit”: “NcA7HpabeAG”,

“attributes”: [{

“attribute”: “jZbsh2zpVWa”,

“value”: “0201”

}, {

“attribute”: “j9sScvXsXVO”,

“value”: “Name of Person”

}, {

“attribute”: “szmBW8EDWLx”,

“value”: “Male”

}, {

“attribute”: “adZnoplDPyx”,

“value”: “48”

}, {

“attribute”: “j16LxVcr8hV”,

“value”: “1967-08-31”

}, {

“attribute”: “T82mY6tjGVY”,

“value”: “Married”

}, {

“attribute”: “pyX2F5mjX5L”,

“value”: “Siem Reap”

}, {

“attribute”: “CakCGhhkSJK”,

“value”: “Siem Reap”

}, {

“attribute”: “zAKBPz96mci”,

“value”: “Siem Reap”

}, {

“attribute”: “VstyNjHv8KM”,

“value”: “%u1782%u17C4%u1780%u1785%u1780”

}, {

“attribute”: “SmHt9k5t501”,

“value”: “%u1782%u17C4%u1780%u1785%u1780”

}, {

“attribute”: “CQqQwvsiZsg”,

“value”: “%u1797%u17BC%u1798%u17B7%A0%u178F%u17D2%u179A%u1796%u17B6%u17C6%u1784%u179F%u17C1%u17C7”

}, {

“attribute”: “HVcRcWAW55I”,

“value”: “ART”

}, {

“attribute”: “RtAymQ0PT5p”,

“value”: “410”

}, {

“attribute”: “ZSEdw9AHbIC”,

“value”: “1641”

}, {

“attribute”: “JQtRizheDhD”,

“value”: “2005-04-11”

}]

}

Also,you also had an extra comma after {

“attribute”: “JQtRizheDhD”,

“value”: “2005-04-11”

}

Please use http://jsonlint.com/ to verfiy your JSON.

Regards,

Jason

On Mon, Sep 7, 2015 at 12:49 PM, channara rin rin.channara@gmail.com wrote:

it doesn’t work.


Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049

On Mon, Sep 7, 2015 at 5:48 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

Do not use BOM. Just utf-8.

On 7 September 2015 at 11:44, channara rin rin.channara@gmail.com wrote:

so which encoding should i choose? now default is “UTF-8-BOM”

On Mon, Sep 7, 2015 at 5:42 PM, channara rin rin.channara@gmail.com wrote:

OH!, ok let me check character-set

Hi Morten, when i add -v. i got this message.

On Mon, Sep 7, 2015 at 5:39 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi Channara,

You must properly encode your Khmer characters. Maybe Morten can say more about this, but I am pretty sure it has something to do with this.

Here is the actual text (not screenshot), which indicates an error related to some invalid characters.

Regards,

Jason

jason@jason-Precision-M2800:~/Downloads$ curl -d @1.jsonhttps://apps.dhis2.org/demo/api/trackedEntityInstances” -X POST -H “Content-Type: application/json” -u admin:district

Apache Tomcat/7.0.63 - Error report

HTTP Status 500 - Unexpected character ('' (code 65279 / 0xfeff)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')


type Exception report

message Unexpected character ('' (code 65279 / 0xfeff)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')

description The server encountered an internal error that prevented it from fulfilling this request.

exception

com.fasterxml.jackson.core.JsonParseException: Unexpected character ('' (code 65279 / 0xfeff)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')

at [Source: {"trackedEntity":"PtPf474EHLM","orgUnit":"NcA7HpabeAG","attributes":[{"attribute":"jZbsh2zpVWa","value":"0201"},{"attribute":"j9sScvXsXVO","value":"Name of Person"},{"attribute":"szmBW8EDWLx","value":"Male"},{"attribute":"adZnoplDPyx","value":"48"},{"attribute":"j16LxVcr8hV","value":"1967-08-31"},{"attribute":"T82mY6tjGVY","value":"Married"},{"attribute":"pyX2F5mjX5L","value":"Siem Reap"},{"attribute":"CakCGhhkSJK","value":"Siem Reap"},{"attribute":"zAKBPz96mci","value":"Siem Reap"},{"attribute":"VstyNjHv8KM","value":"គោកចក"},{"attribute":"SmHt9k5t501","value":"គោកចក"},{"attribute":"CQqQwvsiZsg","value":"ភូមិ ត្រពាំងសេះ"},{"attribute":"HVcRcWAW55I","value":"ART"},{"attribute":"RtAymQ0PT5p","value":"410"},{"attribute":"ZSEdw9AHbIC","value":"1641"},{"attribute":"JQtRizheDhD","value":"2005-04-11"},]}; line: 1, column: 2]

com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1487)

com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:518)

com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:447)

com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1461)

com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:683)

com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:3602)

com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3547)

com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2578)

org.hisp.dhis.dxf2.events.trackedentity.JacksonTrackedEntityInstanceService.fromJson(JacksonTrackedEntityInstanceService.java:83)

org.hisp.dhis.dxf2.events.trackedentity.JacksonTrackedEntityInstanceService.addTrackedEntityInstanceJson(JacksonTrackedEntityInstanceService.java:133)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

java.lang.reflect.Method.invoke(Method.java:497)

org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)

org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)

org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)

org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)

com.sun.proxy.$Proxy177.addTrackedEntityInstanceJson(Unknown Source)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

java.lang.reflect.Method.invoke(Method.java:497)

org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)

org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)

org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)

com.sun.proxy.$Proxy127.addTrackedEntityInstanceJson(Unknown Source)

org.hisp.dhis.webapi.controller.event.TrackedEntityInstanceController.postTrackedEntityInstanceJson(TrackedEntityInstanceController.java:357)

org.hisp.dhis.webapi.controller.event.TrackedEntityInstanceController$$FastClassBySpringCGLIB$$cfbc2606.invoke(<generated>)

org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)

org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:717)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:64)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653)

org.hisp.dhis.webapi.controller.event.TrackedEntityInstanceController$$EnhancerBySpringCGLIB$$ab43fc35.postTrackedEntityInstanceJson(<generated>)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

java.lang.reflect.Method.invoke(Method.java:497)

org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)

org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)

org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)

org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776)

org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705)

org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)

org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)

org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)

org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)

org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869)

javax.servlet.http.HttpServlet.service(HttpServlet.java:650)

org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)

javax.servlet.http.HttpServlet.service(HttpServlet.java:731)

org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)

org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)

org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:201)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.CorsFilter.doFilter(CorsFilter.java:93)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.CustomAuthenticationFilter.doFilter(CustomAuthenticationFilter.java:64)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter.doFilter(OAuth2AuthenticationProcessingFilter.java:140)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.AutomaticAccessFilter.doFilter(AutomaticAccessFilter.java:115)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:57)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)

org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)

org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)

org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)

org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:82)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:151)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.63 logs.


Apache Tomcat/7.0.63

jason@jason-Precision-M2800:~/Downloads$

On Mon, Sep 7, 2015 at 12:24 PM, channara rin rin.channara@gmail.com wrote:

hi morten,
if i coding with PHP use CURL command. i still get the following error. and my json in attached file.

By the way, i use apache v8 and DHIS2 v2.20


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049

On Fri, Sep 4, 2015 at 3:58 PM, channara rin rin.channara@gmail.com wrote:

If i tried use test with -u … that is work fine. but if i add more function like -X POST -d -v… it doesn’t work…

On Fri, Sep 4, 2015 at 3:55 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

Hi Channara

I just had a look at your original mail and I see that the user admin was recognized so it means the curl option was ok but some issue with the password. My guess is that you have some strange characters in the password which are being expanded/interpreted by the shell.

Try quoting like:

-u “admin:xxxxx”

or

-u ‘admin:xxxxx’

On 4 September 2015 at 09:46, channara rin rin.channara@gmail.com wrote:

Hi Morten,
Hi tried test with user:password first. but still error.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Thu, Sep 3, 2015 at 11:43 PM, channara rin rin.channara@gmail.com wrote:

yes, it work too.

On Thu, Sep 3, 2015 at 6:45 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

Try to test with something simpler

curl -u user:pass http://server/api/dataElements

And see if it works


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp


Morten

On Thu, Sep 3, 2015 at 5:23 PM, Knut Staring knutst@gmail.com wrote:

Channara, are you using GOW?

https://github.com/bmatzelle/gow

On Thu, Sep 3, 2015 at 12:08 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

I have also seen weird issues on window versions of cURL where -u user:pass is required to be FIRST (mac/linux should be fine)


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Knut Staring

Dept. of Informatics, University of Oslo

Norway: +4791880522

Skype: knutstar

http://dhis2.org


Morten

On Thu, Sep 3, 2015 at 5:07 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

Hi Channara

The man page for curl indicates that the format of the command is:

curl

Try moving your url to the end of the line, after the options. Also you might want to add “http://localhost.…”


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On 3 September 2015 at 11:01, channara rin rin.channara@gmail.com wrote:

Hi DHIS2 friends,
i tried use curl command to import tracker, but i got error.

can you help me what is problem?

***THIS IS COMMAND RUNNING:

***THIS IS CONSOLE in APACHE


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Hi. Check your Tomcat server.xml file. Do you have URIEncoding=“UTF-8” enabled? At least we have narrowed the problem down…

image

image

image

image

image

image

···

On Mon, Sep 7, 2015 at 5:52 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi ,
This should work.

{

“trackedEntity”: “PtPf474EHLM”,

“orgUnit”: “NcA7HpabeAG”,

“attributes”: [{

“attribute”: “jZbsh2zpVWa”,

“value”: “0201”

}, {

“attribute”: “j9sScvXsXVO”,

“value”: “Name of Person”

}, {

“attribute”: “szmBW8EDWLx”,

“value”: “Male”

}, {

“attribute”: “adZnoplDPyx”,

“value”: “48”

}, {

“attribute”: “j16LxVcr8hV”,

“value”: “1967-08-31”

}, {

“attribute”: “T82mY6tjGVY”,

“value”: “Married”

}, {

“attribute”: “pyX2F5mjX5L”,

“value”: “Siem Reap”

}, {

“attribute”: “CakCGhhkSJK”,

“value”: “Siem Reap”

}, {

“attribute”: “zAKBPz96mci”,

“value”: “Siem Reap”

}, {

“attribute”: “VstyNjHv8KM”,

“value”: “%u1782%u17C4%u1780%u1785%u1780”

}, {

“attribute”: “SmHt9k5t501”,

“value”: “%u1782%u17C4%u1780%u1785%u1780”

}, {

“attribute”: “CQqQwvsiZsg”,

“value”: “%u1797%u17BC%u1798%u17B7%A0%u178F%u17D2%u179A%u1796%u17B6%u17C6%u1784%u179F%u17C1%u17C7”

}, {

“attribute”: “HVcRcWAW55I”,

“value”: “ART”

}, {

“attribute”: “RtAymQ0PT5p”,

“value”: “410”

}, {

“attribute”: “ZSEdw9AHbIC”,

“value”: “1641”

}, {

“attribute”: “JQtRizheDhD”,

“value”: “2005-04-11”

}]

}

Also,you also had an extra comma after {

“attribute”: “JQtRizheDhD”,

“value”: “2005-04-11”

}

Please use http://jsonlint.com/ to verfiy your JSON.

Regards,

Jason

On Mon, Sep 7, 2015 at 12:49 PM, channara rin rin.channara@gmail.com wrote:

it doesn’t work.


Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049

On Mon, Sep 7, 2015 at 5:48 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

Do not use BOM. Just utf-8.

On 7 September 2015 at 11:44, channara rin rin.channara@gmail.com wrote:

so which encoding should i choose? now default is “UTF-8-BOM”

On Mon, Sep 7, 2015 at 5:42 PM, channara rin rin.channara@gmail.com wrote:

OH!, ok let me check character-set

Hi Morten, when i add -v. i got this message.

On Mon, Sep 7, 2015 at 5:39 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi Channara,

You must properly encode your Khmer characters. Maybe Morten can say more about this, but I am pretty sure it has something to do with this.

Here is the actual text (not screenshot), which indicates an error related to some invalid characters.

Regards,

Jason

jason@jason-Precision-M2800:~/Downloads$ curl -d @1.jsonhttps://apps.dhis2.org/demo/api/trackedEntityInstances” -X POST -H “Content-Type: application/json” -u admin:district

Apache Tomcat/7.0.63 - Error report

HTTP Status 500 - Unexpected character ('' (code 65279 / 0xfeff)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')


type Exception report

message Unexpected character ('' (code 65279 / 0xfeff)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')

description The server encountered an internal error that prevented it from fulfilling this request.

exception

com.fasterxml.jackson.core.JsonParseException: Unexpected character ('' (code 65279 / 0xfeff)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')

at [Source: {"trackedEntity":"PtPf474EHLM","orgUnit":"NcA7HpabeAG","attributes":[{"attribute":"jZbsh2zpVWa","value":"0201"},{"attribute":"j9sScvXsXVO","value":"Name of Person"},{"attribute":"szmBW8EDWLx","value":"Male"},{"attribute":"adZnoplDPyx","value":"48"},{"attribute":"j16LxVcr8hV","value":"1967-08-31"},{"attribute":"T82mY6tjGVY","value":"Married"},{"attribute":"pyX2F5mjX5L","value":"Siem Reap"},{"attribute":"CakCGhhkSJK","value":"Siem Reap"},{"attribute":"zAKBPz96mci","value":"Siem Reap"},{"attribute":"VstyNjHv8KM","value":"គោកចក"},{"attribute":"SmHt9k5t501","value":"គោកចក"},{"attribute":"CQqQwvsiZsg","value":"ភូមិ ត្រពាំងសេះ"},{"attribute":"HVcRcWAW55I","value":"ART"},{"attribute":"RtAymQ0PT5p","value":"410"},{"attribute":"ZSEdw9AHbIC","value":"1641"},{"attribute":"JQtRizheDhD","value":"2005-04-11"},]}; line: 1, column: 2]

com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1487)

com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:518)

com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:447)

com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1461)

com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:683)

com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:3602)

com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3547)

com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2578)

org.hisp.dhis.dxf2.events.trackedentity.JacksonTrackedEntityInstanceService.fromJson(JacksonTrackedEntityInstanceService.java:83)

org.hisp.dhis.dxf2.events.trackedentity.JacksonTrackedEntityInstanceService.addTrackedEntityInstanceJson(JacksonTrackedEntityInstanceService.java:133)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

java.lang.reflect.Method.invoke(Method.java:497)

org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)

org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)

org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)

org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)

com.sun.proxy.$Proxy177.addTrackedEntityInstanceJson(Unknown Source)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

java.lang.reflect.Method.invoke(Method.java:497)

org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)

org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)

org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)

com.sun.proxy.$Proxy127.addTrackedEntityInstanceJson(Unknown Source)

org.hisp.dhis.webapi.controller.event.TrackedEntityInstanceController.postTrackedEntityInstanceJson(TrackedEntityInstanceController.java:357)

org.hisp.dhis.webapi.controller.event.TrackedEntityInstanceController$$FastClassBySpringCGLIB$$cfbc2606.invoke(<generated>)

org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)

org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:717)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:64)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653)

org.hisp.dhis.webapi.controller.event.TrackedEntityInstanceController$$EnhancerBySpringCGLIB$$ab43fc35.postTrackedEntityInstanceJson(<generated>)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

java.lang.reflect.Method.invoke(Method.java:497)

org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)

org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)

org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)

org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776)

org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705)

org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)

org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)

org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)

org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)

org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869)

javax.servlet.http.HttpServlet.service(HttpServlet.java:650)

org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)

javax.servlet.http.HttpServlet.service(HttpServlet.java:731)

org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)

org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)

org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:201)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.CorsFilter.doFilter(CorsFilter.java:93)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.CustomAuthenticationFilter.doFilter(CustomAuthenticationFilter.java:64)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter.doFilter(OAuth2AuthenticationProcessingFilter.java:140)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.AutomaticAccessFilter.doFilter(AutomaticAccessFilter.java:115)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:57)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)

org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)

org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)

org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)

org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:82)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:151)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.63 logs.


Apache Tomcat/7.0.63

jason@jason-Precision-M2800:~/Downloads$

On Mon, Sep 7, 2015 at 12:24 PM, channara rin rin.channara@gmail.com wrote:

hi morten,
if i coding with PHP use CURL command. i still get the following error. and my json in attached file.

By the way, i use apache v8 and DHIS2 v2.20


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049

On Fri, Sep 4, 2015 at 3:58 PM, channara rin rin.channara@gmail.com wrote:

If i tried use test with -u … that is work fine. but if i add more function like -X POST -d -v… it doesn’t work…

On Fri, Sep 4, 2015 at 3:55 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

Hi Channara

I just had a look at your original mail and I see that the user admin was recognized so it means the curl option was ok but some issue with the password. My guess is that you have some strange characters in the password which are being expanded/interpreted by the shell.

Try quoting like:

-u “admin:xxxxx”

or

-u ‘admin:xxxxx’

On 4 September 2015 at 09:46, channara rin rin.channara@gmail.com wrote:

Hi Morten,
Hi tried test with user:password first. but still error.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Thu, Sep 3, 2015 at 11:43 PM, channara rin rin.channara@gmail.com wrote:

yes, it work too.

On Thu, Sep 3, 2015 at 6:45 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

Try to test with something simpler

curl -u user:pass http://server/api/dataElements

And see if it works


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp


Morten

On Thu, Sep 3, 2015 at 5:23 PM, Knut Staring knutst@gmail.com wrote:

Channara, are you using GOW?

https://github.com/bmatzelle/gow

On Thu, Sep 3, 2015 at 12:08 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

I have also seen weird issues on window versions of cURL where -u user:pass is required to be FIRST (mac/linux should be fine)


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Knut Staring

Dept. of Informatics, University of Oslo

Norway: +4791880522

Skype: knutstar

http://dhis2.org


Morten

On Thu, Sep 3, 2015 at 5:07 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

Hi Channara

The man page for curl indicates that the format of the command is:

curl

Try moving your url to the end of the line, after the options. Also you might want to add “http://localhost.…”


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On 3 September 2015 at 11:01, channara rin rin.channara@gmail.com wrote:

Hi DHIS2 friends,
i tried use curl command to import tracker, but i got error.

can you help me what is problem?

***THIS IS COMMAND RUNNING:

***THIS IS CONSOLE in APACHE


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

YES, i can import.
Thank alot JASON.

By the way, i can import only record. but if i want to import many records, what should i do? plz check my attached file. i have two records. and for curl command is still the sampe for many records?

123.json (3.88 KB)

···

On Tue, Sep 8, 2015 at 4:14 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi. Check your Tomcat server.xml file. Do you have URIEncoding=“UTF-8” enabled? At least we have narrowed the problem down…

On Tue, Sep 8, 2015, 09:36 channara rin rin.channara@gmail.com wrote:

Hi Jason,
I tried my best, if i copy your json file above, it work fine. But when i go to look data, it like in picture below. so what should i do. I think the problem of importing is characterset. so how can i do?

On Mon, Sep 7, 2015 at 5:52 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi ,
This should work.

{

“trackedEntity”: “PtPf474EHLM”,

“orgUnit”: “NcA7HpabeAG”,

“attributes”: [{

“attribute”: “jZbsh2zpVWa”,

“value”: “0201”

}, {

“attribute”: “j9sScvXsXVO”,

“value”: “Name of Person”

}, {

“attribute”: “szmBW8EDWLx”,

“value”: “Male”

}, {

“attribute”: “adZnoplDPyx”,

“value”: “48”

}, {

“attribute”: “j16LxVcr8hV”,

“value”: “1967-08-31”

}, {

“attribute”: “T82mY6tjGVY”,

“value”: “Married”

}, {

“attribute”: “pyX2F5mjX5L”,

“value”: “Siem Reap”

}, {

“attribute”: “CakCGhhkSJK”,

“value”: “Siem Reap”

}, {

“attribute”: “zAKBPz96mci”,

“value”: “Siem Reap”

}, {

“attribute”: “VstyNjHv8KM”,

“value”: “%u1782%u17C4%u1780%u1785%u1780”

}, {

“attribute”: “SmHt9k5t501”,

“value”: “%u1782%u17C4%u1780%u1785%u1780”

}, {

“attribute”: “CQqQwvsiZsg”,

“value”: “%u1797%u17BC%u1798%u17B7%A0%u178F%u17D2%u179A%u1796%u17B6%u17C6%u1784%u179F%u17C1%u17C7”

}, {

“attribute”: “HVcRcWAW55I”,

“value”: “ART”

}, {

“attribute”: “RtAymQ0PT5p”,

“value”: “410”

}, {

“attribute”: “ZSEdw9AHbIC”,

“value”: “1641”

}, {

“attribute”: “JQtRizheDhD”,

“value”: “2005-04-11”

}]

}

Also,you also had an extra comma after {

“attribute”: “JQtRizheDhD”,

“value”: “2005-04-11”

}

Please use http://jsonlint.com/ to verfiy your JSON.

Regards,

Jason

On Mon, Sep 7, 2015 at 12:49 PM, channara rin rin.channara@gmail.com wrote:

it doesn’t work.


Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049

On Mon, Sep 7, 2015 at 5:48 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

Do not use BOM. Just utf-8.

On 7 September 2015 at 11:44, channara rin rin.channara@gmail.com wrote:

so which encoding should i choose? now default is “UTF-8-BOM”

On Mon, Sep 7, 2015 at 5:42 PM, channara rin rin.channara@gmail.com wrote:

OH!, ok let me check character-set

Hi Morten, when i add -v. i got this message.

On Mon, Sep 7, 2015 at 5:39 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi Channara,

You must properly encode your Khmer characters. Maybe Morten can say more about this, but I am pretty sure it has something to do with this.

Here is the actual text (not screenshot), which indicates an error related to some invalid characters.

Regards,

Jason

jason@jason-Precision-M2800:~/Downloads$ curl -d @1.jsonhttps://apps.dhis2.org/demo/api/trackedEntityInstances” -X POST -H “Content-Type: application/json” -u admin:district

Apache Tomcat/7.0.63 - Error report

HTTP Status 500 - Unexpected character ('' (code 65279 / 0xfeff)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')


type Exception report

message Unexpected character ('' (code 65279 / 0xfeff)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')

description The server encountered an internal error that prevented it from fulfilling this request.

exception

com.fasterxml.jackson.core.JsonParseException: Unexpected character ('' (code 65279 / 0xfeff)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')

at [Source: {"trackedEntity":"PtPf474EHLM","orgUnit":"NcA7HpabeAG","attributes":[{"attribute":"jZbsh2zpVWa","value":"0201"},{"attribute":"j9sScvXsXVO","value":"Name of Person"},{"attribute":"szmBW8EDWLx","value":"Male"},{"attribute":"adZnoplDPyx","value":"48"},{"attribute":"j16LxVcr8hV","value":"1967-08-31"},{"attribute":"T82mY6tjGVY","value":"Married"},{"attribute":"pyX2F5mjX5L","value":"Siem Reap"},{"attribute":"CakCGhhkSJK","value":"Siem Reap"},{"attribute":"zAKBPz96mci","value":"Siem Reap"},{"attribute":"VstyNjHv8KM","value":"គោកចក"},{"attribute":"SmHt9k5t501","value":"គោកចក"},{"attribute":"CQqQwvsiZsg","value":"ភូមិ ត្រពាំងសេះ"},{"attribute":"HVcRcWAW55I","value":"ART"},{"attribute":"RtAymQ0PT5p","value":"410"},{"attribute":"ZSEdw9AHbIC","value":"1641"},{"attribute":"JQtRizheDhD","value":"2005-04-11"},]}; line: 1, column: 2]

com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1487)

com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:518)

com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:447)

com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1461)

com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:683)

com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:3602)

com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3547)

com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2578)

org.hisp.dhis.dxf2.events.trackedentity.JacksonTrackedEntityInstanceService.fromJson(JacksonTrackedEntityInstanceService.java:83)

org.hisp.dhis.dxf2.events.trackedentity.JacksonTrackedEntityInstanceService.addTrackedEntityInstanceJson(JacksonTrackedEntityInstanceService.java:133)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

java.lang.reflect.Method.invoke(Method.java:497)

org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)

org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)

org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)

org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)

com.sun.proxy.$Proxy177.addTrackedEntityInstanceJson(Unknown Source)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

java.lang.reflect.Method.invoke(Method.java:497)

org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)

org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)

org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)

com.sun.proxy.$Proxy127.addTrackedEntityInstanceJson(Unknown Source)

org.hisp.dhis.webapi.controller.event.TrackedEntityInstanceController.postTrackedEntityInstanceJson(TrackedEntityInstanceController.java:357)

org.hisp.dhis.webapi.controller.event.TrackedEntityInstanceController$$FastClassBySpringCGLIB$$cfbc2606.invoke(<generated>)

org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)

org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:717)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:64)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653)

org.hisp.dhis.webapi.controller.event.TrackedEntityInstanceController$$EnhancerBySpringCGLIB$$ab43fc35.postTrackedEntityInstanceJson(<generated>)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

java.lang.reflect.Method.invoke(Method.java:497)

org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)

org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)

org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)

org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776)

org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705)

org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)

org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)

org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)

org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)

org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869)

javax.servlet.http.HttpServlet.service(HttpServlet.java:650)

org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)

javax.servlet.http.HttpServlet.service(HttpServlet.java:731)

org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)

org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)

org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:201)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.CorsFilter.doFilter(CorsFilter.java:93)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.CustomAuthenticationFilter.doFilter(CustomAuthenticationFilter.java:64)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter.doFilter(OAuth2AuthenticationProcessingFilter.java:140)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.AutomaticAccessFilter.doFilter(AutomaticAccessFilter.java:115)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:57)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)

org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)

org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)

org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)

org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:82)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:151)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.63 logs.


Apache Tomcat/7.0.63

jason@jason-Precision-M2800:~/Downloads$

On Mon, Sep 7, 2015 at 12:24 PM, channara rin rin.channara@gmail.com wrote:

hi morten,
if i coding with PHP use CURL command. i still get the following error. and my json in attached file.

By the way, i use apache v8 and DHIS2 v2.20


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049

On Fri, Sep 4, 2015 at 3:58 PM, channara rin rin.channara@gmail.com wrote:

If i tried use test with -u … that is work fine. but if i add more function like -X POST -d -v… it doesn’t work…

On Fri, Sep 4, 2015 at 3:55 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

Hi Channara

I just had a look at your original mail and I see that the user admin was recognized so it means the curl option was ok but some issue with the password. My guess is that you have some strange characters in the password which are being expanded/interpreted by the shell.

Try quoting like:

-u “admin:xxxxx”

or

-u ‘admin:xxxxx’

On 4 September 2015 at 09:46, channara rin rin.channara@gmail.com wrote:

Hi Morten,
Hi tried test with user:password first. but still error.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Thu, Sep 3, 2015 at 11:43 PM, channara rin rin.channara@gmail.com wrote:

yes, it work too.

On Thu, Sep 3, 2015 at 6:45 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

Try to test with something simpler

curl -u user:pass http://server/api/dataElements

And see if it works


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp


Morten

On Thu, Sep 3, 2015 at 5:23 PM, Knut Staring knutst@gmail.com wrote:

Channara, are you using GOW?

https://github.com/bmatzelle/gow

On Thu, Sep 3, 2015 at 12:08 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

I have also seen weird issues on window versions of cURL where -u user:pass is required to be FIRST (mac/linux should be fine)


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Knut Staring

Dept. of Informatics, University of Oslo

Norway: +4791880522

Skype: knutstar

http://dhis2.org


Morten

On Thu, Sep 3, 2015 at 5:07 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

Hi Channara

The man page for curl indicates that the format of the command is:

curl

Try moving your url to the end of the line, after the options. Also you might want to add “http://localhost.…”


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On 3 September 2015 at 11:01, channara rin rin.channara@gmail.com wrote:

Hi DHIS2 friends,
i tried use curl command to import tracker, but i got error.

can you help me what is problem?

***THIS IS COMMAND RUNNING:

***THIS IS CONSOLE in APACHE


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp