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
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)
...
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
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