mohan-nishit / opendatakit

Automatically exported from code.google.com/p/opendatakit
0 stars 0 forks source link

Badly parsed form is partially saved in database #171

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Upload v0.93 compatible form into Aggregate. Parser complains about formId
2. Change xmlns for my instance model to id. Upload again. Server throws 
java.lang.IllegalStateException
3. Return to list forms. The bad form is listed.
4. Attempt to delete the bad form, cannot delete

What is the expected output? What do you see instead?
- I expect that if a form upload fails, the form is not listed at /www/forms. 
Instead, I see the form listed
- I expect to be able to delete the bad/partial form, but cannot (however, I 
can delete other forms that uploaded with no errors)

What version of the product are you using? On what operating system?
- Alpha 3 v1.0
- Windows 7 + tomcat + mysql from alpha installer

Please provide any additional information below.
- attaching v0.93 compatible form
- parse error on this form during upload:

java.lang.IllegalStateException: Form id 
elem+uuid:e2fd091d-5731-4961-bed3-4fe48435a739(00000001) Child already defined 
for ordinal 13
    org.opendatakit.aggregate.datamodel.FormDataModel.setChild(FormDataModel.java:382)
    org.opendatakit.aggregate.form.FormDefinition.<init>(FormDefinition.java:600)
    org.opendatakit.aggregate.parser.FormParserForJavaRosa.initHelper(FormParserForJavaRosa.java:519)
    org.opendatakit.aggregate.parser.FormParserForJavaRosa.<init>(FormParserForJavaRosa.java:274)
    org.opendatakit.aggregate.servlet.FormUploadServlet.doPost(FormUploadServlet.java:194)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
    org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
    org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    org.springframework.security.web.authentication.www.DigestAuthenticationFilter.doFilter(DigestAuthenticationFilter.java:319)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
    org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
    org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

Original issue reported on code.google.com by stuartmo...@gmail.com on 20 Jan 2011 at 11:32

Attachments:

GoogleCodeExporter commented 9 years ago
The error is being thrown in org.opendatakit.aggregate.datamodel.FormDataModel: 
http://goo.gl/Z3Szs Its not clear to me how to map "ordinal 13" with a specific 
xml node in my form.

Since there are loops and branches in this ODK form, I suspect the error might 
be coming from a loose namespace in my v0.93 that needs to be tightened up in 
v1.0. Not sure, but likely?

With the new stricter XML, is there a new stricter ODK Validator?

Original comment by stuartmo...@gmail.com on 20 Jan 2011 at 11:40

GoogleCodeExporter commented 9 years ago

Original comment by wbrune...@gmail.com on 18 Feb 2011 at 11:48

GoogleCodeExporter commented 9 years ago
This was an internal error in the form parser.  Fixed in Alpha 5.

Original comment by mitchellsundt@gmail.com on 22 Feb 2011 at 5:53