[
http://jira.codehaus.org/browse/JIBX-197?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dennis Sosnoski resolved JIBX-197.
----------------------------------
Assignee: Dennis Sosnoski
Resolution: Fixed
Fix Version/s: JiBX 1.1.6
This is really a usage error, since there's no way to make sense of text values
inside an unordered grouping. I've added a validation check for this condition,
and have also updated the documentation to say that this is prohibited.
> Error running binding compiler: Method call on invalid structure
> ----------------------------------------------------------------
>
> Key: JIBX-197
> URL: http://jira.codehaus.org/browse/JIBX-197
> Project: JiBX
> Issue Type: Bug
> Affects Versions: JiBX 1.1.5
> Environment: Windows XP SP2, JDK 1.4.2
> Reporter: Günther Wieser
> Assignee: Dennis Sosnoski
> Fix For: JiBX 1.1.6
>
> Attachments: JBOrdered.zip
>
>
> when using the following binding, a compiletime error occurs:
> <?xml version="1.0" encoding="ISO-8859-2"?>
> <binding>
> <mapping name="Data" class="structure.StructureParentData"
> ordered="false" flexible="true">
> <structure name="structure" field="structureChild"
> type="structure.StructureChildData"/>
> </mapping>
> <!-- this will cause an error during compile time -->
> <mapping ordered="false" class="structure.StructureChildData"
> abstract="true">
> <!-- this works -->
> <!-- <mapping ordered="true" class="structure.StructureChildData"
> abstract="true"> -->
> <!-- this works, too -->
> <!-- <mapping class="structure.StructureChildData" abstract="true">-->
> <value style="text" field="content"/>
> <value style="attribute" field="attribute" name="attribute"/>
> </mapping>
> </binding>
> problem seems to be that ordered is set to "false" but a value tag
> with style="text" exists. when we set ordered="true" or do not specify
> the order parameter, everything works fine.
> the stacktrace is:
> [bind] Generating code for mapping structure.StructureParentData
> [bind] Error running binding compiler
> [bind] org.jibx.runtime.JiBXException: Method call on invalid structure
> [bind] at
> org.jibx.binding.def.ValueChild.genContentPresentTest(ValueChild.java: 798)
> [bind] at
> org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:234)
> [bind] at
> org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:798)
> [bind] at
> org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:943)
> [bind] at
> org.jibx.binding.def.PassThroughComponent.genContentUnmarshal(PassThroughComponent.java:111)
> [bind] at
> org.jibx.binding.def.BaseMappingWrapper.genContentUnmarshal(BaseMappingWrapper.java:73)
> [bind] at
> org.jibx.binding.def.PassThroughComponent.genContentUnmarshal(PassThroughComponent.java:111)
> [bind] at
> org.jibx.binding.def.MappingReference.genContentUnmarshal(MappingReference.java:223)
> [bind] at
> org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:190)
> [bind] at
> org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:798)
> [bind] at
> org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:943)
> [bind] at
> org.jibx.binding.def.ComponentProperty.genContentUnmarshal(ComponentProperty.java:225)
> [bind] at
> org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:314)
> [bind] at
> org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:252)
> [bind] at
> org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:798)
> [bind] at
> org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:943)
> [bind] at
> org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:314)
> [bind] at
> org.jibx.binding.def.MappingDefinition.generateUnmarshalImplementation(MappingDefinition.java:640)
> [bind] at
> org.jibx.binding.def.MappingDefinition.generateCode(MappingDefinition.java:851)
> [bind] at
> org.jibx.binding.def.DefinitionContext.generateCode(DefinitionContext.java:669)
> [bind] at
> org.jibx.binding.def.BindingDefinition.generateCode(BindingDefinition.java:661)
> [bind] at org.jibx.binding.Compile.compile(Compile.java:305)
> [bind] at org.jibx.binding.ant.CompileTask.execute(CompileTask.java:248)
> [bind] at
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
> [bind] at org.apache.tools.ant.Task.perform(Task.java:364)
> [bind] at org.apache.tools.ant.Target.execute(Target.java:341)
> [bind] at org.apache.tools.ant.Target.performTasks(Target.java:369)
> [bind] at
> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
> [bind] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
> [bind] at
> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
> [bind] at
> org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
> [bind] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
> [bind] at
> org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
> [bind] at
> org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
> Junit test and ant build are available in the attached zip file. the JUnit
> test calls the compiler directly, but the Path
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
jibx-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-devs