getNamedStructure returns null instead of throwing exception

Details

Description

I think this mainly has to do with the using/label stuff which you are reworking. I was trying to troubleshoot a couple of issues with the xsd2jibx servlet example, but the NullPointerException that the JiBX binding compiler was throwing wasn't very helpful.

Activity

Yes, the code was definitely bad. I've changed it to check when it reaches the outermost context and throw an exception in this case. Let me know if you get a chance to confirm that this now works properly.

Dennis Sosnoski
added a comment - 19/Apr/04 2:35 AM Yes, the code was definitely bad. I've changed it to check when it reaches the outermost context and throw an exception in this case. Let me know if you get a chance to confirm that this now works properly.

org.jibx.runtime.JiBXException: Referenced label "examplePerson" not defined
at org.jibx.binding.def.DefinitionContext.getNamedStructure(DefinitionContext.java:366)
at org.jibx.binding.def.DefinitionContext.getNamedStructure(DefinitionContext.java:369)
at org.jibx.binding.def.DefinitionContext.getNamedStructure(DefinitionContext.java:369)
at org.jibx.binding.def.StructureReference.setLinkages(StructureReference.java:111)
at org.jibx.binding.def.ElementWrapper.setLinkages(ElementWrapper.java:443)
at org.jibx.binding.def.NestedStructure.setLinkages(NestedStructure.java:219)
at org.jibx.binding.def.PassThroughComponent.setLinkages(PassThroughComponent.java:140)
at org.jibx.binding.def.ObjectBinding.setLinkages(ObjectBinding.java:752)
at org.jibx.binding.def.ElementWrapper.setLinkages(ElementWrapper.java:443)
at org.jibx.binding.def.MappingDefinition.setLinkages(MappingDefinition.java:678)
at org.jibx.binding.def.DefinitionContext.setLinkages(DefinitionContext.java:624)
at org.jibx.binding.def.BindingDefinition.generateCode(BindingDefinition.java:524)
at org.jibx.binding.Compile.compile(Compile.java:283)
at org.jibx.binding.Compile.main(Compile.java:341)