Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: JiBX 1.2.3
-
Fix Version/s: None
-
Component/s: core
-
Labels:None
-
Number of attachments :
Description
Attempting to bind gives this:
[bind] java.lang.StackOverflowError
[bind] at org.apache.bcel.generic.LocalVariableGen.<init>(LocalVariableGen.java:91)
[bind] at org.apache.bcel.generic.MethodGen.addLocalVariable(MethodGen.java:293)
[bind] at org.apache.bcel.generic.MethodGen.addLocalVariable(MethodGen.java:324)
[bind] at org.apache.bcel.generic.MethodGen.<init>(MethodGen.java:165)
[bind] at org.jibx.binding.classes.MethodBuilder.<init>(MethodBuilder.java:166)
[bind] at org.jibx.binding.classes.ExceptionMethodBuilder.<init>(ExceptionMethodBuilder.java:59)
[bind] at org.jibx.binding.classes.ContextMethodBuilder.<init>(ContextMethodBuilder.java:78)
[bind] at org.jibx.binding.def.ObjectBinding.genContentPresenceMethod(ObjectBinding.java:818)
[bind] at org.jibx.binding.def.ObjectBinding.genContentPresentTest(ObjectBinding.java:1024)
[bind] at org.jibx.binding.def.PassThroughComponent.genContentPresentTest(PassThroughComponent.java:106)
[bind] at org.jibx.binding.def.PassThroughComponent.genContentPresentTest(PassThroughComponent.java:106)
[bind] at org.jibx.binding.def.NestedBase.genContentPresentTest(NestedBase.java:202)
[bind] at org.jibx.binding.def.ObjectBinding.genContentPresenceMethod(ObjectBinding.java:828)
[bind] at org.jibx.binding.def.ObjectBinding.genContentPresentTest(ObjectBinding.java:1024)
[bind] at org.jibx.binding.def.PassThroughComponent.genContentPresentTest(PassThroughComponent.java:106)
[bind] at org.jibx.binding.def.PassThroughComponent.genContentPresentTest(PassThroughComponent.java:106)
[bind] at org.jibx.binding.def.NestedBase.genContentPresentTest(NestedBase.java:202)
[bind] at org.jibx.binding.def.ObjectBinding.genContentPresenceMethod(ObjectBinding.java:828)
[bind] at org.jibx.binding.def.ObjectBinding.genContentPresentTest(ObjectBinding.java:1024)
[bind] at org.jibx.binding.def.PassThroughComponent.genContentPresentTest(PassThroughComponent.java:106)
[bind] at org.jibx.binding.def.PassThroughComponent.genContentPresentTest(PassThroughComponent.java:106)
[bind] at org.jibx.binding.def.NestedBase.genContentPresentTest(NestedBase.java:202)
... repeat ad naseum ...
I'm sure there is some error in my binding files, but unfortunately there are 81 files I'm dealing with so without a real error message there's no way for me to figure out what the real problem is.
Please fix the binding logic to detect infinite loops and return a reasonable error message.
Thanks.
I finally figured out the problem. I had a mapping like this:
<include path="bar.xml"/> <mapping abstract="true" type-name="foo" class="org.dellroad.Foo"> <structure map-as="foo"/> <!-- should be bar instead of foo --> ... </mapping>so the mapping was trying to include itself. Obviously wrong, but it took a long time to find that typo. A better error message would have helped.