← Back to team overview

dhis2-devs team mailing list archive

Re: not successful importing

 

Hi morten,

thank you, after I remove -v. I can process successful.

but I have one question: if the file json is encode as UTF-8. it is not working, it will get the error like below. IF we convert to UTF-8 without BOM, we got successful. IF SO, how can I coding to make auto importing?


************************

<html><head><title>Apache Tomcat/7.0.54 - Error report</title><style><!--H1 {fon
t-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:
22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525
D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;backgro
und-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;col
or:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:w
hite;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;backgroun
d:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR
{color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - Unexpected char
acter ('' (code 65279 / 0xfeff)): expected a valid value (number, String, arr
ay, object, 'true', 'false' or 'null')</h1><HR size="1" noshade="noshade"><p><b>
type</b> Exception report</p><p><b>message</b> <u>Unexpected character ('' (c
ode 65279 / 0xfeff)): expected a valid value (number, String, array, object, 'tr
ue', 'false' or 'null')</u></p><p><b>description</b> <u>The server encountered a
n internal error that prevented it from fulfilling this request.</u></p><p><b>ex
ception</b> <pre>com.fasterxml.jackson.core.JsonParseException: Unexpected chara
cter ('' (code 65279 / 0xfeff)): expected a valid value (number, String, arra
y, object, 'true', 'false' or 'null')
 at [Source: java.io.StringReader@6300f379; line: 1, column: 2]
        com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:15
24)
        com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMin
imalBase.java:557)
        com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(
ParserMinimalBase.java:475)
        com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(Re
aderBasedJsonParser.java:1415)
        com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBa
sedJsonParser.java:679)
        com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper
.java:3031)
        com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMappe
r.java:2978)
        com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:
2098)
        org.hisp.dhis.dxf2.events.trackedentity.JacksonTrackedEntityInstanceServ
ice.fromJson(JacksonTrackedEntityInstanceService.java:79)
        org.hisp.dhis.dxf2.events.trackedentity.JacksonTrackedEntityInstanceServ
ice.addTrackedEntityInstanceJson(JacksonTrackedEntityInstanceService.java:140)
        sun.reflect.GeneratedMethodAccessor620.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.invokeJoinp
oint(ReflectiveMethodInvocation.java:183)
        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Ref
lectiveMethodInvocation.java:150)
        org.springframework.transaction.interceptor.TransactionInterceptor$1.pro
ceedWithInvocation(TransactionInterceptor.java:96)
        org.springframework.transaction.interceptor.TransactionAspectSupport.inv
okeWithinTransaction(TransactionAspectSupport.java:260)
        org.springframework.transaction.interceptor.TransactionInterceptor.invok
e(TransactionInterceptor.java:94)
        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Ref
lectiveMethodInvocation.java:172)
        org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAo
pProxy.java:204)
        com.sun.proxy.$Proxy113.addTrackedEntityInstanceJson(Unknown Source)
        org.hisp.dhis.webapi.controller.event.TrackedEntityInstanceController.po
stTrackedEntityInstanceJson(TrackedEntityInstanceController.java:280)
        org.hisp.dhis.webapi.controller.event.TrackedEntityInstanceController$$F
astClassBySpringCGLIB$$cfbc2606.invoke(&lt;generated&gt;)
        org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)


        org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.in
vokeJoinpoint(CglibAopProxy.java:700)
        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Ref
lectiveMethodInvocation.java:150)
        org.springframework.security.access.intercept.aopalliance.MethodSecurity
Interceptor.invoke(MethodSecurityInterceptor.java:64)
        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Ref
lectiveMethodInvocation.java:172)
        org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedIntercepto
r.intercept(CglibAopProxy.java:633)
        org.hisp.dhis.webapi.controller.event.TrackedEntityInstanceController$$E
nhancerBySpringCGLIB$$e2aa883b.postTrackedEntityInstanceJson(&lt;generated&gt;)
        sun.reflect.GeneratedMethodAccessor618.invoke(Unknown Source)
        sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        java.lang.reflect.Method.invoke(Unknown Source)
        org.springframework.web.method.support.InvocableHandlerMethod.invoke(Inv
ocableHandlerMethod.java:215)
        org.springframework.web.method.support.InvocableHandlerMethod.invokeForR
equest(InvocableHandlerMethod.java:132)
        org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHa
ndlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
        org.springframework.web.servlet.mvc.method.annotation.RequestMappingHand
lerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745)
        org.springframework.web.servlet.mvc.method.annotation.RequestMappingHand
lerAdapter.handleInternal(RequestMappingHandlerAdapter.java:685)
        org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.
handle(AbstractHandlerMethodAdapter.java:80)
        org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherS
ervlet.java:919)
        org.springframework.web.servlet.DispatcherServlet.doService(DispatcherSe
rvlet.java:851)
        org.springframework.web.servlet.FrameworkServlet.processRequest(Framewor
kServlet.java:953)
        org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet
.java:855)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
        org.springframework.web.servlet.FrameworkServlet.service(FrameworkServle
t.java:829)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doF
ilter(FilterChainProxy.java:330)
        org.springframework.security.web.access.intercept.FilterSecurityIntercep
tor.invoke(FilterSecurityInterceptor.java:118)
        org.springframework.security.web.access.intercept.FilterSecurityIntercep
tor.doFilter(FilterSecurityInterceptor.java:84)
        org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doF
ilter(FilterChainProxy.java:342)
        org.springframework.security.web.access.ExceptionTranslationFilter.doFil
ter(ExceptionTranslationFilter.java:113)
        org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doF
ilter(FilterChainProxy.java:342)
        org.springframework.security.web.session.SessionManagementFilter.doFilte
r(SessionManagementFilter.java:103)
        org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doF
ilter(FilterChainProxy.java:342)
        org.springframework.security.web.authentication.AnonymousAuthenticationF
ilter.doFilter(AnonymousAuthenticationFilter.java:113)
        org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doF
ilter(FilterChainProxy.java:342)
        org.springframework.security.web.servletapi.SecurityContextHolderAwareRe
questFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
        org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doF
ilter(FilterChainProxy.java:342)
        org.springframework.security.web.savedrequest.RequestCacheAwareFilter.do
Filter(RequestCacheAwareFilter.java:45)
        org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doF
ilter(FilterChainProxy.java:342)
        org.springframework.security.web.authentication.www.BasicAuthenticationF
ilter.doFilter(BasicAuthenticationFilter.java:201)
        org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doF
ilter(FilterChainProxy.java:342)
        org.springframework.security.web.authentication.AbstractAuthenticationPr
ocessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
        org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doF
ilter(FilterChainProxy.java:342)
        org.springframework.security.web.authentication.AbstractAuthenticationPr
ocessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
        org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doF
ilter(FilterChainProxy.java:342)
        org.hisp.dhis.security.filter.CustomAuthenticationFilter.doFilter(Custom
AuthenticationFilter.java:64)
        org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doF
ilter(FilterChainProxy.java:342)
        org.springframework.security.web.authentication.logout.LogoutFilter.doFi
lter(LogoutFilter.java:110)
        org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doF
ilter(FilterChainProxy.java:342)
        org.hisp.dhis.security.filter.AutomaticAccessFilter.doFilter(AutomaticAc
cessFilter.java:113)
        org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doF
ilter(FilterChainProxy.java:342)
        org.springframework.security.web.context.request.async.WebAsyncManagerIn
tegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
        org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequ
estFilter.java:106)
        org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doF
ilter(FilterChainProxy.java:342)
        org.springframework.security.web.context.SecurityContextPersistenceFilte
r.doFilter(SecurityContextPersistenceFilter.java:87)
        org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doF
ilter(FilterChainProxy.java:342)
        org.springframework.security.web.FilterChainProxy.doFilterInternal(Filte
rChainProxy.java:192)
        org.springframework.security.web.FilterChainProxy.doFilter(FilterChainPr
oxy.java:160)
        org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(Dele
gatingFilterProxy.java:343)
        org.springframework.web.filter.DelegatingFilterProxy.doFilter(Delegating
FilterProxy.java:260)
        org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFil
terInternal(OpenSessionInViewFilter.java:151)
        org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequ
estFilter.java:106)
        org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(
CharacterEncodingFilter.java:88)
        org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequ
estFilter.java:106)
</pre></p><p><b>note</b> <u>The full stack trace of the root cause is available
in the Apache Tomcat/7.0.54 logs.</u></p><HR size="1" noshade="noshade"><h3>Apac
he Tomcat/7.0.54</h3></body></html>
C:\Program Files (x86)\Gow\bin>

************************


Thank you

CHANNARA





From: Morten Olav Hansen
Sent: ‎Thursday‎, ‎August‎ ‎14‎, ‎2014 ‎12‎:‎11‎ ‎Evening
To: channara rin
Cc: DHIS 2 Developers list





Hi



curl -V only gives the version, if you want verbose, its -v




--
Morten



On Thu, Aug 14, 2014 at 11:42 AM, <rin.channara@xxxxxxxxx> wrote:




Hi all dev,

I am using DHIS2:

Version:2.16Build revision:16253Build date:2014-07-28 01:07



When I import Trackedentityinstance through “curl” command for importing into localhost of DHIS2. I got the below text:




curl -d @track.json "http://localhost:8080/dhis/api/trackedEntityInstances"; -X POST -H "Content-Type:application/json" -u admin:xxxxx -V




*********************************

curl 7.27.0 (i386-pc-win32) libcurl/7.27.0 OpenSSL/1.0.0j zlib/1.2.7 libidn/1.18
 libssh2/1.4.2 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtmp
rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate IDN Largefile NTLM SSL SSPI libz

*********************************




thank you

Channara









_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp

References