[
http://jira.codehaus.org/browse/JIBX-169?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dennis Sosnoski resolved JIBX-169.
----------------------------------
Assignee: Dennis Sosnoski
Resolution: Fixed
Fix Version/s: JiBX 1.1.6
I've verified that the supplied binding compiles with the current CVS code,
after some earlier fixes to the name handling. The test program fails when it
tries to create an unmarshaller for the output-only binding (and I've also
corrected the error message for this case, which previously had marshaller and
unmarshaller reversed).
The problem reported by Ingo Wilken is not really an issue, since the JiBX
unmarshalling code correctly requires distinct names for each concrete
<mapping> definition. I don't know how this ever could have worked with 1.0.2,
but the only way to define multiple <mappings> with the same name now is to use
separate binding definitions. If you split your current binding into two, and
compile them in a single execution of the binding compiler, that should work.
> Binding compile of two classes with same element name fails with NPE in
> NameAttributes.equals although output only
> ------------------------------------------------------------------------------------------------------------------
>
> Key: JIBX-169
> URL: http://jira.codehaus.org/browse/JIBX-169
> Project: JiBX
> Issue Type: Bug
> Components: core
> Affects Versions: JiBX 1.1.5
> Environment: Windows XP, Java 1.5.0_10
> Reporter: Andrew Harris
> Assignee: Dennis Sosnoski
> Fix For: JiBX 1.1.6
>
> Attachments: outboundBindIssue.zip
>
>
> Just tried upgrading to JIBX 1.1.5 from 1.0.1 and hit this problem.
> I have a binding that is direction="output" and I have three hibernate
> classes that map to the same element name.
> When I try to bind compile, there is an exception thrown because the equals
> method in NameAttributes, when the name is the same, resorts to the namespace
> to distinguish the two objects, but the namespace has not been set on either
> of them.
> [java] Error running binding compiler
> [java] java.lang.NullPointerException
> [java] at
> org.jibx.binding.model.NameAttributes.equals(NameAttributes.java:184)
> [java] at java.util.HashMap.eq(HashMap.java:299)
> [java] at java.util.HashMap.containsKey(HashMap.java:381)
> [java] at
> org.jibx.binding.model.DefinitionContext.addMappedName(DefinitionContext.java:551)
> [java] at
> org.jibx.binding.model.RegistrationVisitor.visit(RegistrationVisitor.java:183)
> [java] at
> org.jibx.binding.model.TreeContext.tourTree(TreeContext.java:171)
> [java] at
> org.jibx.binding.model.TreeContext.tourTree(TreeContext.java:232)
> [java] at
> org.jibx.binding.model.RegistrationVisitor.visitTree(RegistrationVisitor.java:96)
> [java] at
> org.jibx.binding.model.BindingElement.runValidation(BindingElement.java:755)
> [java] at
> org.jibx.binding.model.BindingElement.validateBinding(BindingElement.java:819)
> [java] at org.jibx.binding.Utility.validateBinding(Utility.java:228)
> [java] at org.jibx.binding.Utility.loadBinding(Utility.java:269)
> [java] at org.jibx.binding.Utility.loadFileBinding(Utility.java:413)
> [java] at org.jibx.binding.Compile.compile(Compile.java:296)
> [java] at org.jibx.binding.Compile.main(Compile.java:385)
> I understand that it is not possible to unmarshal an incoming element to one
> of multiple classes, since there is not enough information to figure out
> which class to instantiate. But it would be useful to be able to marshal
> multiple classes to the same element name.
> The attached code has a target outputIssue that causes the exception
--
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