I remember observing the same behavior you mention here. In my case I explode the jar, bind the mapping and then recreate the jar.
The .class file is modified by the binding operation so it made sense to me that it is accessed directly (not within a .jar).
Still, it would be nice if it can be done as my goal is to instrument classes contained in a jar directly.
My 2 cents,
Stephane
On 11/13/06,
Dominik Götzelmann <[EMAIL PROTECTED]> wrote:
Dear all,
I have a binding definition, that describes the mapping of a class. That
works fine, if the MyClass.class file is in the project itself.
If the MyClass.class file is packed into an jar-archive, the CompileTask
returns a NullPointerException.
The ant task:
<target name="xml_binding" description="Generate binding files for JiBX">
<taskdef name="bind" classname="org.jibx.binding.ant.CompileTask "
classpathref="class.path" />
<bind verbose="true" load="true">
<bindingfileset dir="${source-dir}" includes="**/*Binding.xml" />
<classpathset dir="${lib-dir}/MyProject.jar" />
<classpathset dir="${class-dir}" />
</bind>
</target>
This is the output:
[bind] Using the following paths:
[bind] T:\Sources\lib\MyProject.jar
[bind] T:\Sources\bin
[bind] Using the following binding paths:
[bind] T:\Sources\src\MyBinding.xml
[bind] Error running binding compiler
[bind] java.lang.NullPointerException
[bind] at
org.jibx.binding.classes.MungedClass.checkDirectory (MungedClass.java:240)
[bind] at
org.jibx.binding.classes.BoundClass.getInstance(BoundClass.java:421)
[bind] at
org.jibx.binding.classes.BoundClass.getInstance(BoundClass.java:460)
[bind] at org.jibx.binding.def.ObjectBinding .<init>(ObjectBinding.java:232)
[bind] at
org.jibx.binding.def.BindingBuilder.unmarshalObjectBinding(BindingBuilder.java:852)
[bind] at
org.jibx.binding.def.BindingBuilder.unmarshalMapping(BindingBuilder.java :1513)
[bind] at
org.jibx.binding.def.BindingBuilder.unmarshalMappings(BindingBuilder.java:944)
[bind] at
org.jibx.binding.def.BindingBuilder.unmarshalBindingDefinition(BindingBuilder.java:1722)
[bind] at org.jibx.binding.Utility.loadBinding (Utility.java:308)
[bind] at org.jibx.binding.Utility.loadFileBinding(Utility.java:389)
[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.Target.performTasks(Target.java:369)
[bind] at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[bind] at org.apache.tools.ant.Project.executeTarget(Project.java :1185)
[bind] at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[bind] at
org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java :32)
[bind] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[bind] at
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[bind] at
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main (InternalAntRunner.java:137)
BUILD FAILED
T:\Sources\build.xml:456: JiBXException in JiBX binding compilation
Does anyone have a clue, what I´m doing wrong?
Thanks, Dominik
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users