Hello all. I'm having a bit of difficulty with binding a class that implements an Interface which extends another interface. I believe that in castor there is a feature, "derive-by-type", which allows you to do this. I have not see this referenced in the JiBX documentation. Has anyone else experienced this problem? Below is a sample from the binding and a snippet from the classes, as well as the exception I'm receiving.
binding:
<structure name="product" set-method="setProduct" get-method="getProduct" type="IProduct">
<structure name="simpleOption" type="SimpleOption">
...
</structure>
</structure>
class/interfaces:
public class FxSimpleOption implements IFxSimpleOption {
. . .
}
public interface IFxSimpleOption extends IProduct {
. . .
}
public interface IProduct extends Serializable {
. . .
}
exception thrown:
jibx:bind:
[echo] Running Jibx binding compiler.
Error: No compatible mapping defined for type com.jpmorgan.fort.tradeport.domain.model.impl.FxSimpleOption for structure element at (line 33, col 11, in binding.xml)
Error running binding compiler
org.jibx.runtime.JiBXException: Binding binding.xml is unusable because of validation errors
at org.jibx.binding.Utility.loadBinding(Utility.java:361)
at org.jibx.binding.Utility.loadFileBinding(Utility.java:389)
at org.jibx.binding.Compile.compile(Compile.java:294)
at org.jibx.binding.ant.CompileTask.execute(CompileTask.java:248)
at org.apache.tools.ant.Task.perform(Task.java:341)
at org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:185)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
at org.apache.commons.jelly.tags.core.OtherwiseTag.doTag(OtherwiseTag.java:87)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
at org.apache.commons.jelly.tags.core.ChooseTag.doTag(ChooseTag.java:84)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTag.java:79)
at org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.performAction(MavenGoalTag.java:110)
at com.werken.werkz.Goal.fire(Goal.java:639)
at com.werken.werkz.Goal.attain(Goal.java:575)
at com.werken.werkz.WerkzProject.attainGoal(WerkzProject.java:193)
at org.apache.maven.jelly.tags.werkz.MavenAttainGoalTag.doTag(MavenAttainGoalTag.java:127)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
at com.werken.werkz.jelly.PostGoalTag$1.firePostGoal(PostGoalTag.java:87)
at com.werken.werkz.Goal.firePostGoalCallbacks(Goal.java:710)
at com.werken.werkz.Goal.fire(Goal.java:654)
at com.werken.werkz.Goal.attain(Goal.java:575)
at com.werken.werkz.Goal.attainPrecursors(Goal.java:488)
at com.werken.werkz.Goal.attain(Goal.java:573)
at com.werken.werkz.Goal.attainPrecursors(Goal.java:488)
at com.werken.werkz.Goal.attain(Goal.java:573)
at org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:671)
at org.apache.maven.MavenSession.attainGoals(MavenSession.java:263)
at org.apache.maven.cli.App.doMain(App.java:488)
at org.apache.maven.cli.App.main(App.java:1239)
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.werken.forehead.Forehead.run(Forehead.java:551)
at com.werken.forehead.Forehead.main(Forehead.java:581)
Am I missing/overlooking something?
Many thanks for suggestions/input!
Best Regards,
Simone
This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any comments or statements made herein do not necessarily reflect those of JPMorgan Chase & Co., its subsidiaries and affiliates.
