Hi Anurag, You probably don't actually need the extends="..." on the <mapping> in this case. It seems like a lot of people use this unnecessarily, and that sometimes creates problems. It's only really needed when you're doing the equivalent of schema substitution groups, to implement polymorphism. So try taking off the extends and see if that helps.
It's still a nasty bug in the binding compiler that this can occur at all, though. Can you try this using the current JiBX 1.2 beta 1 test release (in the "test" package on the download page https://sourceforge.net/project/showfiles.php?group_id=69358)? I think I'd encountered this issue and fixed it during the development of the 1.2 code, but I'll add in another check for the condition which could cause this for the upcoming beta 2 release. I don't understand your other issue, that "JIBX fails to find classes that are included as dependent projects when I run the compile option". Can you explain this in more detail? - Dennis Dennis M. Sosnoski SOA and Web Services in Java Training and Consulting http://www.sosnoski.com - http://www.sosnoski.co.nz Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117 Anurag Khanna wrote: > > Hi – > > > > I’m trying to compile my object which has a superclass that implements > interfaces. I’ve tried running both the command as well as Ant options > but the error remains the same. The structure of my hierarchy is > > > > 1. AbstractClass A implements Interface > 2. Class B extends A implements Serializable > 3. Both classes are in different packages. > 4. I can run the compiler on the base class and it works fine. The > same works fine for the subclass if I remove the inheritance > [extends] from the subclass. > > > > I’ve tried the various extension tricks mentioned on the site but get > the same stack trace. My binding.xml is as below > > > > <?xml version="1.0" encoding="UTF-8"?> > > <binding> > > <!--<mapping class="com.ClassA" abstract="true" > > type-name="A"> > > <value name="creationDate" field="creationDate" usage="required"/> > > ... > > </mapping>--> > > <include path="bindingExt.xml"/> // moved the commented code above > to a different bindingExt.xml. Doesn’t work even if I remove the > comments and the > > <mapping name="test" // <include> tag. > > class="com.vo.ClassB" > > extends="com.ClassA"> > > <structure map-as="A"/> > > <value name="name" field="name" usage="required"/> > > ... > > </mapping> > > </binding> > > > > Here is the stack trace: Can someone point me to what am I doing wrong > here. > > > > [_bind_] Running binding compiler version jibx_1_1_6a > > [_bind_] Error running binding compiler > > [_bind_] _java.lang.NullPointerException_ > > [_bind_] at > org.jibx.binding.model.ClassHierarchyContext.accumulateInterfaces(_ClassHierarchyContext.java:88_) > > [_bind_] at > org.jibx.binding.model.ClassHierarchyContext.accumulateInterfaces(_ClassHierarchyContext.java:94_) > > [_bind_] at > org.jibx.binding.model.ClassHierarchyContext.addTypedComponent(_ClassHierarchyContext.java:116_) > > [_bind_] at > org.jibx.binding.model.DefinitionContext.addTemplate(_DefinitionContext.java:575_) > > [_bind_] at > org.jibx.binding.model.RegistrationVisitor.visit(_RegistrationVisitor.java:176_) > > [_bind_] at > org.jibx.binding.model.TreeContext.tourTree(_TreeContext.java:171_) > > [_bind_] at > org.jibx.binding.model.TreeContext.tourTree(_TreeContext.java:232_) > > [_bind_] at > org.jibx.binding.model.RegistrationVisitor.visitTree(_RegistrationVisitor.java:110_) > > [_bind_] at > org.jibx.binding.model.BindingElement.runValidation(_BindingElement.java:734_) > > [_bind_] at > org.jibx.binding.model.BindingElement.validateBinding(_BindingElement.java:799_) > > [_bind_] at > org.jibx.binding.Utility.validateBinding(_Utility.java:223_) > > [_bind_] at org.jibx.binding.Utility.loadBinding(_Utility.java:264_) > > [_bind_] at > org.jibx.binding.Utility.loadFileBinding(_Utility.java:408_) > > [_bind_] at org.jibx.binding.Compile.compile(_Compile.java:296_) > > [_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.helper.ProjectHelper2.parse(_ProjectHelper2.java:142_) > > [_bind_] at > org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.parseBuildFile(_InternalAntRunner.java:191_) > > [_bind_] at > org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(_InternalAntRunner.java:400_) > > [_bind_] at > org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(_InternalAntRunner.java:137_) > > > > Since I’m new to JIBX I don’t have an idea what exactly is going > wrong. Another thing is that JIBX fails to find classes that are > included as dependent projects when I run the compile option. > > > > Thanks & Regards, > > > > Anurag Khanna > > > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise > -Strategies to boost innovation and cut costs with open source participation > -Receive a $600 discount off the registration fee with the source code: SFAD > http://p.sf.net/sfu/XcvMzF8H > ------------------------------------------------------------------------ > > _______________________________________________ > jibx-users mailing list > jibx-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jibx-users > ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users