google-code-export / flies

Automatically exported from code.google.com/p/flies
GNU Lesser General Public License v2.1
2 stars 0 forks source link

py publican push followed by mvn publican-push causes 500 internal error on server #256

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create sample-project, version 1.1
2. cd client/flies-maven-plugin/flies-maven-demo
3. ~/src/flies-python-client/flies publican push
4. mvn flies:publican-push -B

What is the expected output?
successful import

What do you see instead?
internal error 500

What version of the client *and* server are you using? (Displayed at the
bottom of the web page; please include timestamp.) On what operating
system?

server: version UNKNOWN (UNKNOWN), api 1.2-SNAPSHOT, probably revision 
b4a4c4028c0d 
client: flies-maven-plugin:1.2-SNAPSHOT

Please use labels and text to provide additional information.

16:39:08,836 ERROR [HibernateExceptionMapper] Hibernate Exception in REST 
request
org.hibernate.PropertyValueException: not-null property references a null or 
transient value: net.openl10n.flies.model.HSimpleComment.comment
        at org.hibernate.engine.Nullability.checkNullability(Nullability.java:95)
        at org.hibernate.event.def.DefaultFlushEntityEventListener.scheduleUpdate(DefaultFlushEntityEventListener.java:292)
        at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:151)
        at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:219)
        at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:99)
        at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:49)
        at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
        at org.hibernate.search.impl.FullTextSessionImpl.flush(FullTextSessionImpl.java:345)
        at org.jboss.seam.persistence.HibernateSessionProxy.flush(HibernateSessionProxy.java:187)
        at org.hibernate.search.impl.FullTextSessionImpl.flush(FullTextSessionImpl.java:345)
        at org.jboss.seam.persistence.HibernateSessionProxy.flush(HibernateSessionProxy.java:187)
        at net.openl10n.flies.dao.AbstractDAOImpl.flush(AbstractDAOImpl.java:100)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
        at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
        at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
        at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
        at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
        at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
        at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
        at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
        at net.openl10n.flies.dao.DocumentDAO_$$_javassist_seam_23.flush(DocumentDAO_$$_javassist_seam_23.java)
        at net.openl10n.flies.rest.service.TranslationResourcesService.putResource(TranslationResourcesService.java:400)

Original issue reported on code.google.com by sean.flanigan@gmail.com on 23 Feb 2011 at 6:48

GoogleCodeExporter commented 9 years ago
It turns out that the Python client has been populating the field 
extractedComment in HPotEntryData/PotEntryHeader, but the Maven client has been 
populating the ordinary comment in HTextFlow/SimpleComment.  In other words, 
the data model has two fields which represent the same PO value.  

If Maven is used to import a file after Python, the textflows try to replace 
the existing extractedComment with a null, and the server doesn't handle this 
correctly, hence the internal error.

Since the SimpleComment is more general (not specific to gettext format), we 
should use it, and deprecate HPotEntryData.extractedComment.

We should:
1. change Python client to use the SimpleComment when pushing/pulling, not the 
extractedComment field of PotEntryHeader
2. change server to ignore extractedComment in HPotEntryData/PotEntryHeader, 
thus avoiding the internal error.  (We will remove the database column in Flies 
1.3.)

Original comment by sean.flanigan@gmail.com on 24 Feb 2011 at 7:32

GoogleCodeExporter commented 9 years ago
This issue was closed by revision e4c3c74381.

Original comment by sean.flanigan@gmail.com on 24 Feb 2011 at 8:13