In continuation to my mail below, I've
tried running the compile option using the beta release and here are my
worries:
1.
As mentioned in my previous mail, the compiler is unable
to resolve the referenced project classes. If I manually copy the referenced
classes in this project, the compiler runs fine.
2.
Another thing regarding the Ant build option. As per the information
on the site, whenever I add the <taskdef .. to my build file, the jibx
target is the first task that runs even if it is not the first task that should
run. Any idea how can I suppress it to run after some default tasks, like other
ant tasks using "depends" attribute?
Thanks for your help and suggestions.
Anurag Khanna
-----Original Message-----
From: Anurag Khanna [mailto:
Sent: Monday, February 16, 2009 10:09 AM
To: 'Dennis Sosnoski'
Subject: RE: [jibx-users] FW: NullPointerException when running binding
compiler
Hi Dennis -
Thanks for the reply, though I had tried running the compiler without
using the "extends" keyword first and after failing to make it work went
for the latter. I shall try working with the beta package and let you know if
it works as suggested by you.
On the "JIBX fails to find classes
that are included as dependent projects when I run the compile
option" -
What I meant was that my project set up
uses one project referring another project as project dependency while setting
class path for the project. Now when I run the compiler on this dependent
project, the referenced project classes are not seen by the binding compiler
and it throws off an error. One of the Jibx users had replied that they use a
workaround for this problem and copy the dependent classes while running the
Ant task by using unzip task, which is not what I want.
-----Original Message-----
From: Dennis Sosnoski [mailto:dms@sosnoski.com]
Sent: Saturday, February 14, 2009 7:45 AM
To:
Subject: Re: [jibx-users] FW: NullPointerException when running binding
compiler
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
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,
> -OSBC tackles the biggest issue in open source: Open Sourcing the
> -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
>
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>