Hi All,
I have the following JiBX binding definition:
<mapping name="name1" value-style="attribute"
class="p.a.c.k.a.g.e.ErrorClass"
extends="p.a.c.k.a.g.e.AbstractClass">
<structure map-as="p.a.c.k.a.g.e.AbstractClass"/>
<value name="name2" usage="required"
get-method="getName2" set-method="setName2"/>
<value name="name3" usage="optional"
get-method="isName3" set-method="setName3"
serializer="p.a.c.k.a.g.e.SerializerClass.name3Serializer"
deserializer="p.a.c.k.a.g.e.SerializerClass.name3Deserializer"/>
</mapping>
Which during JiBX compilation produces the following error:
[bind] Generating code for mapping p.a.c.k.a.g.e.OtherClass
[bind] Generating code for mapping p.a.c.k.a.g.e.ErrorClass
[bind] Error running binding compiler
[bind] java.lang.NoClassDefFoundError: p/a/c/k/a/g/e/MissingClass
[bind] at java.lang.Class.getDeclaredMethods0(Native Method)
[bind] at java.lang.Class.privateGetDeclaredMethods(Class.java:1655)
[bind] at java.lang.Class.getDeclaredMethod(Class.java:1262)
[bind] at org.jibx.binding.def.PrimitiveStringConversion.genToOptionalText(PrimitiveStringConversion.java:336)
[bind] at org.jibx.binding.def.StringConversion.genWriteOptional(StringConversion.java:326)
[bind] at org.jibx.binding.def.ValueChild.genMarshal(ValueChild.java:566)
[bind] at org.jibx.binding.def.ValueChild.genAttributeMarshal(ValueChild.java:653)
[bind] at org.jibx.binding.def.NestedStructure.genAttributeMarshal(NestedStructure.java:134)
[bind] at org.jibx.binding.def.ObjectBinding.genMarshalAttributeCall(ObjectBinding.java:679)
[bind] at org.jibx.binding.def.ObjectBinding.genAttributeMarshal(ObjectBinding.java:899)
[bind] at org.jibx.binding.def.ElementWrapper.genContentMarshal(ElementWrapper.java:343)
[bind] at org.jibx.binding.def.MappingDefinition.generateCode(MappingDefinition.java:632)
[bind] at org.jibx.binding.def.DefinitionContext.generateCode(DefinitionContext.java:604)
[bind] at org.jibx.binding.def.BindingDefinition.generateCode(BindingDefinition.java:611)
[bind] at org.jibx.binding.Compile.compile(Compile.java:305)
[bind] at org.jibx.binding.ant.CompileTask.execute(CompileTask.java:248)
The JiBX compilation is done through an Ant task:
<taskdef name="bind" classname="org.jibx.binding.ant.CompileTask"
classpathref="jibx-classpath"/>
<bind verbose="true" load="true" binding="jibx-bindings.xml">
<classpathset dir="classes"/>
<classpathset file="jarfile.jar"/>
</bind>
The jibx-classpath definitely contains p.a.c.k.a.g.e.MissingClass, so does jarfile.jar.
p.a.c.k.a.g.e.SerializerClass does not reference to p.a.c.k.a.g.e.MissingClass (at least not in a trivial way, I could not find the link between them, but this is a big system, anything can happen).
The interesting thing is that if I set the usage of name3 to be required instead of optional everything compiles fine.
Can anyone help me what to check or change?
Many thanks,
I.G.
I have the following JiBX binding definition:
<mapping name="name1" value-style="attribute"
class="p.a.c.k.a.g.e.ErrorClass"
extends="p.a.c.k.a.g.e.AbstractClass">
<structure map-as="p.a.c.k.a.g.e.AbstractClass"/>
<value name="name2" usage="required"
get-method="getName2" set-method="setName2"/>
<value name="name3" usage="optional"
get-method="isName3" set-method="setName3"
serializer="p.a.c.k.a.g.e.SerializerClass.name3Serializer"
deserializer="p.a.c.k.a.g.e.SerializerClass.name3Deserializer"/>
</mapping>
Which during JiBX compilation produces the following error:
[bind] Generating code for mapping p.a.c.k.a.g.e.OtherClass
[bind] Generating code for mapping p.a.c.k.a.g.e.ErrorClass
[bind] Error running binding compiler
[bind] java.lang.NoClassDefFoundError: p/a/c/k/a/g/e/MissingClass
[bind] at java.lang.Class.getDeclaredMethods0(Native Method)
[bind] at java.lang.Class.privateGetDeclaredMethods(Class.java:1655)
[bind] at java.lang.Class.getDeclaredMethod(Class.java:1262)
[bind] at org.jibx.binding.def.PrimitiveStringConversion.genToOptionalText(PrimitiveStringConversion.java:336)
[bind] at org.jibx.binding.def.StringConversion.genWriteOptional(StringConversion.java:326)
[bind] at org.jibx.binding.def.ValueChild.genMarshal(ValueChild.java:566)
[bind] at org.jibx.binding.def.ValueChild.genAttributeMarshal(ValueChild.java:653)
[bind] at org.jibx.binding.def.NestedStructure.genAttributeMarshal(NestedStructure.java:134)
[bind] at org.jibx.binding.def.ObjectBinding.genMarshalAttributeCall(ObjectBinding.java:679)
[bind] at org.jibx.binding.def.ObjectBinding.genAttributeMarshal(ObjectBinding.java:899)
[bind] at org.jibx.binding.def.ElementWrapper.genContentMarshal(ElementWrapper.java:343)
[bind] at org.jibx.binding.def.MappingDefinition.generateCode(MappingDefinition.java:632)
[bind] at org.jibx.binding.def.DefinitionContext.generateCode(DefinitionContext.java:604)
[bind] at org.jibx.binding.def.BindingDefinition.generateCode(BindingDefinition.java:611)
[bind] at org.jibx.binding.Compile.compile(Compile.java:305)
[bind] at org.jibx.binding.ant.CompileTask.execute(CompileTask.java:248)
The JiBX compilation is done through an Ant task:
<taskdef name="bind" classname="org.jibx.binding.ant.CompileTask"
classpathref="jibx-classpath"/>
<bind verbose="true" load="true" binding="jibx-bindings.xml">
<classpathset dir="classes"/>
<classpathset file="jarfile.jar"/>
</bind>
The jibx-classpath definitely contains p.a.c.k.a.g.e.MissingClass, so does jarfile.jar.
p.a.c.k.a.g.e.SerializerClass does not reference to p.a.c.k.a.g.e.MissingClass (at least not in a trivial way, I could not find the link between them, but this is a big system, anything can happen).
The interesting thing is that if I set the usage of name3 to be required instead of optional everything compiles fine.
Can anyone help me what to check or change?
Many thanks,
I.G.
Lycos email has now 300 Megabytes of free storage... Get it now at mail.lycos.co.uk
