I am trying to map a fairly large set of domain objects using JiBX and I
have run into a tricky situation. I have an abstract base class called
DomainObjectTranslation that contains a locale for a translation. Then
there are different subclasses of DomainObjectTranslation like
FeatureTypeTranslation, CurrencyTranslation, etc.
My first problem is that java.util.Locale doesn't have a no-arg
constructor, so as far as I can tell, I have to do a custom marshaller
for DomainObjectTranslation. Added on top of this is the complication
that the locale values appear as attributes, like:
<featureTypeTranslation isoLanguageCode="de" isoCountryCode="DE">
I believe that I can do this with a custom marshaller and have written
one. It appears, though, that I can't use a custom marshaller for the
abstract base class while using regular JiBX mapping for the subclasses.
I'm not entirely surprised at this, but I am hoping that maybe there is
still a workable solution here. Anyway, I am getting this error when I
try to run the binding compiler:
Error running binding compiler
*** Error during code generation - please report this error on the JiBX
users list so that the condition can be caught during validation ***
java.lang.IllegalStateException: Internal error: no extension possible
at
org.jibx.binding.def.MappingDirect.addExtension(MappingDirect.java:120)
at
org.jibx.binding.def.MappingDefinition.linkMappings(MappingDefinition.java:258)
at
org.jibx.binding.def.DefinitionContext.linkMappings(DefinitionContext.java:623)
at
org.jibx.binding.def.BindingDefinition.generateCode(BindingDefinition.java:609)
at org.jibx.binding.Compile.compile(Compile.java:305)
at org.jibx.binding.Compile.main(Compile.java:384)
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:324)
at
com.intellij.rt.execution.application.AppMain.main(AppMain.java:86)
The relevant parts of my binding.xml are:
<mapping class="DomainObjectTranslation" abstract="true"
marshaller="DomainObjectTranslationMarshaller"
unmarshaller="DomainObjectTranslationMarshaller">
</mapping>
<mapping class="FeatureTypeTranslation" name="featureTypeTranslation"
extends="DomainObjectTranslation">
<structure map-as="DomainObjectTranslation"/>
<value name="description" field="featureDesc" usage="optional"/>
</mapping>
Any suggestions?
Mark
--
Got Love, Joy, Peace, Patience, Kindness, Goodness,
Faithfulness, Gentleness, and Self-control?
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users