translation issues...

0 views
Skip to first unread message

Ashok Hariharan

unread,
May 26, 2009, 7:54:49 AM5/26/09
to akomantoso-dev
Hi Luca,

I am still having issues running the translator ...


1) There is no output document being produced - the output document
for the translation according to the unit test is "resultAKN_db.xml" -
but this file is never produced. if i delete the existing one on the
file systm and run the test i get this exception :

java.util.MissingResourceException: Can't find resource for bundle
org.un.bungeni.translators.localization.Messages, key
PROBLEM_DESCRIPTION_LEFT
at java.util.ResourceBundle.getObject(ResourceBundle.java:384)
at java.util.ResourceBundle.getObject(ResourceBundle.java:381)
at java.util.ResourceBundle.getString(ResourceBundle.java:344)
at org.un.bungeni.translators.utility.exceptionmanager.ExceptionManager.error(ExceptionManager.java:112)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown
Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown
Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttributes(Unknown
Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown
Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.un.bungeni.translators.utility.schemavalidator.SchemaValidator.validate(SchemaValidator.java:110)
at org.un.bungeni.translators.odttoakn.translator.OATranslator.translate(OATranslator.java:139)
at translatortest.OATranslatorTest.testTranslate(OATranslatorTest.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

2) While debugging it i realized it was writing the translation output
to a temp file in the tmp folder ... so i made a copy of that.
In the output xml i found these issues :

a) I removed a heading for one of the motions and translated it, and i
got the output xml as follows :

<subdivision id="motion1">
<p>Adoption of 35TH CPA(Africa Region) Report</p>

(i.e. it put a <p> instead of a <heading> .. which is fine.)

The problem is the validator never returns an error for the missing heading.

b) the <references...> block is empty

c) i found a heading with a blank ref :

<subdivision id="motion2">
<heading>
<ref href="">
Adoption of Report of First and Second Sessions of Pan African Parliament
</ref>
</heading>

Why is the blank <ref> being generated ?

Ashok

Luca Cervone

unread,
May 26, 2009, 8:59:30 AM5/26/09
to akomant...@googlegroups.com
Dear Ashok, 
Below my replies. 


Hi Luca,

I am still having issues running the translator ...


1) There is no output document being produced - the output document
for the translation according to the unit test is "resultAKN_db.xml" -
but this file is never produced.  if i delete the existing one on the
file systm and run the test i get this exception :

java.util.MissingResourceException: Can't find resource for bundle
org.un.bungeni.translators.localization.Messages, key
PROBLEM_DESCRIPTION_LEFT
at java.util.ResourceBundle.getObject(ResourceBundle.java:384)
...

This problem is due to the fact that perhaps you have not upgraded the code with the new one. 
The message PROBLEM_DESCRIPTION_LEFT is one of the messages that I have recently added. 


2) While debugging it i realized it was writing the translation output
to a temp file in the tmp folder ... so i made a copy of that.
In the output xml i found these issues :

a) I removed a heading for one of the motions and translated it, and i
got the output xml as follows :

<subdivision id="motion1">
<p>Adoption of 35TH CPA(Africa Region) Report</p>

(i.e. it put a <p> instead of a <heading> .. which is fine.)

The problem is the validator never returns an error for the missing heading.



Yes is correct. The heading element is facultative not mandatory. 

b) the <references...> block is empty


Yeah, yeah, I leave set the translator to do not fill the reference block for test purposes. I'll fix it now.


c) i found a heading with a blank ref :

<subdivision id="motion2">
<heading>
<ref href="">
Adoption of Report of First and Second Sessions of Pan African Parliament
</ref>
</heading>

Why is the blank <ref> being generated ?


If you remember, we had to argue about these problem of the ref. Because of the ref in the ODF do not have a reference. You told to me that you had to think how to link them to the database. 
If you have fixed this problem tell me, so I can fix it. 
However, perhaps I can set the translator to remove the ref if they have a blank href ... what do you think about this? 

Let me now. 
In the meanwhile I'll fix the problem of the reference block. 

Ciao
Luca




Ashok




Luca Cervone
Web and XML solutions designer

e-mail:     cervo...@gmail.com

mobile phone:    0039 348 26 27 545
home   phone:  0039 051 199 82 854

skype:   cervoneluca



Luca Cervone

unread,
May 26, 2009, 9:03:30 AM5/26/09
to akomant...@googlegroups.com
Dear Ashok, 
I have fixed the problem of the references.
Let me know if now everything works fine. 

Ciao
Luca


Luca Cervone
Web and XML solutions designer

e-mail:     cervo...@gmail.com

Ashok Hariharan

unread,
Jun 3, 2009, 2:57:49 AM6/3/09
to akomantoso-dev
Hi Luca,

I was still getting this MissingResourceException error ....

i debugged it and the problem is that the message strings are not
synchronized across the message files... some message strings are
missing in some files. e.g. the message "PROBLEM_DESCRIPTION_LEFT" is
missing in the en_US messages file and so it crashes....

secondly i don't understand why you have implemented message bundles
as java source files ? instead if you use property message bundles you
just require a single class and multiple message bundle property files
(which are just key, value text files ... the idea being we want to
separate display strings from source code --- in your case they are
all in the same file, so if we add a new message we have to rebuild
the whole application etc... ) -- and they have an automatic fall-back
mechanism in case there is a missing message string.

Ashok

Reply all
Reply to author
Forward
0 new messages