Hi Lenny, There are definitely users working with precompiled bindings, and I know this works correctly when using Ant (at least in the cases I've tried).
The error that you're getting "Classloader conflict for binding 'precompiledBindings' generally means that you've got different classpaths in use, and the jibx-run.jar is present on two different classloader paths (resulting in two copies of the same classes being loaded). When I looked into this code, though, I realized the way it's set up now may the cause of these problems - it doesn't necessarily delegate to the classloader used for loading the JiBX classes, and it really should. I'm not sure under what specific circumstances the error occurs, but I'm wondering if the Ant "bind" task usage is a problem here. Can you try changing your bindings to just invoked the binding compiler directly as a Java application, instead of using the Ant task? I'll be along the following lines: <java classname="org.jibx.binding.Compile" fork="yes" failonerror="true" classpathref="classpath"> <arg value="${basedir}/gen/src/binding.xml"/> </java> but with any additional command line arguments as needed (see http://jibx.sourceforge.net/bindcomp.html). When I've tested with precompiled bindings, I think I've done it this way. Let us know the results, if you're able to try this. - 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 lenny.boni...@barclayscapital.com wrote: > Thanks Karel. > > When I had read your previous post initially, I had gotten the > impression that this was a Maven specific problem/solution, which would > not apply to me. But I'll take a second look. > > However, if your solution works, does this mean that it is currently > impossible to use precompiled bindings? Can anyone out there verify > whether they have used precompiled bindings successfully, especially > when Maven is not involved? > > Thanks, > Lenny > > -----Original Message----- > From: Karel Alfonso [mailto:karel.alfo...@majitek.com] > Sent: Wednesday, April 22, 2009 12:48 AM > To: JiBX users > Subject: Re: [jibx-users] Simple Precompiled Binding Fails > > Hi Lenny, > > I had the same issue with precompiled bindings. Please refer to my > previous post: > http://www.mail-archive.com/jibx-users%40lists.sourceforge.net/msg03937. > html > there you can find a fix that involves rebuilding JiBX and using that > jar instead. > > Dennis mentioned he would take a look at it, si I think, most likely > it: > http://www.mail-archive.com/jibx-users%40lists.sourceforge.net/msg03949. > html > > Hope that helps, > > Cheers, > > Karel > > >> Hi guys, >> I am trying to get a simple precompiled binding (using ant) to work. >> This is the binding that is being called (precompiledBindings.xml) >> <binding package="com.mycompany.precompiled"> >> <mapping...> >> </binding> >> >> This is the binding that is using the precompiled binding >> (bindings.xml) <binding package="com.mycompany.usingprecompiled"> >> <include path="precompiledBindings.xml" precompiled="true"/> >> <mapping...> </binding> >> >> Here is the exception: >> [bind] *** Error during code generation for file 'bindings.xml' - >> please enter a bug report for this error in Jira if the problem is not >> > > >> listed as fixed on the online status page *** >> [bind] org.jibx.runtime.JiBXException: Classloader conflict for >> binding 'precompiledBindings' - factory does not implement required >> interface >> [bind] at >> >> > org.jibx.runtime.BindingDirectory.getFactory(BindingDirectory.java:269) > >> [bind] at >> org.jibx.binding.def.BindingBuilder.unmarshalInclude(BindingBuilder.ja >> va >> :2002) >> [bind] at >> org.jibx.binding.def.BindingBuilder.unmarshalBindingDefinition(Binding >> Bu >> ilder.java:2099) >> [bind] at >> org.jibx.binding.Utility.loadBinding(Utility.java:314) >> [bind] at >> org.jibx.binding.Utility.loadFileBinding(Utility.java:431) >> [bind] at org.jibx.binding.Compile.compile(Compile.java:212) >> [bind] at >> org.jibx.binding.ant.CompileTask.execute(CompileTask.java:248) >> [bind] at >> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) >> [bind] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown >> Source) >> [bind] at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess >> or >> Impl.java:25) >> [bind] at java.lang.reflect.Method.invoke(Method.java:585) >> [bind] at >> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java >> :1 >> 05) >> [bind] at org.apache.tools.ant.Task.perform(Task.java:348) >> [bind] at org.apache.tools.ant.Target.execute(Target.java:357) >> [bind] at >> org.apache.tools.ant.Target.performTasks(Target.java:385) >> [bind] at >> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329) >> [bind] at >> org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleC >> he >> ckExecutor.java:38) >> [bind] at >> org.eclipse.ant.internal.ui.antsupport.EclipseSingleCheckExecutor.exec >> ut >> eTargets(EclipseSingleCheckExecutor.java:30) >> [bind] at >> org.apache.tools.ant.Project.executeTargets(Project.java:1181) >> [bind] at >> org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416) >> [bind] at >> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) >> [bind] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native >> Method) >> [bind] at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j >> av >> a:39) >> [bind] at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess >> or >> Impl.java:25) >> [bind] at java.lang.reflect.Method.invoke(Method.java:585) >> [bind] at >> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java >> :1 >> 05) >> [bind] at org.apache.tools.ant.Task.perform(Task.java:348) >> [bind] at org.apache.tools.ant.Target.execute(Target.java:357) >> [bind] at >> org.apache.tools.ant.Target.performTasks(Target.java:385) >> [bind] at >> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329) >> [bind] at >> org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleC >> he >> ckExecutor.java:38) >> [bind] at >> org.eclipse.ant.internal.ui.antsupport.EclipseSingleCheckExecutor.exec >> ut >> eTargets(EclipseSingleCheckExecutor.java:30) >> [bind] at >> org.apache.tools.ant.Project.executeTargets(Project.java:1181) >> [bind] at >> org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416) >> [bind] at >> org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105) >> [bind] at >> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) >> [bind] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native >> Method) >> [bind] at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j >> av >> a:39) >> [bind] at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess >> or >> Impl.java:25) >> [bind] at java.lang.reflect.Method.invoke(Method.java:585) >> [bind] at >> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java >> :1 >> 05) >> [bind] at org.apache.tools.ant.Task.perform(Task.java:348) >> [bind] at org.apache.tools.ant.Target.execute(Target.java:357) >> [bind] at >> org.apache.tools.ant.Target.performTasks(Target.java:385) >> [bind] at >> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329) >> [bind] at >> org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleC >> he >> ckExecutor.java:38) >> [bind] at >> org.eclipse.ant.internal.ui.antsupport.EclipseSingleCheckExecutor.exec >> ut >> eTargets(EclipseSingleCheckExecutor.java:30) >> [bind] at >> org.apache.tools.ant.Project.executeTargets(Project.java:1181) >> [bind] at >> org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416) >> [bind] at >> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) >> [bind] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native >> Method) >> [bind] at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j >> av >> a:39) >> [bind] at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess >> or >> Impl.java:25) >> [bind] at java.lang.reflect.Method.invoke(Method.java:585) >> [bind] at >> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java >> :1 >> 05) >> [bind] at org.apache.tools.ant.Task.perform(Task.java:348) >> [bind] at org.apache.tools.ant.Target.execute(Target.java:357) >> [bind] at >> org.apache.tools.ant.Target.performTasks(Target.java:385) >> [bind] at >> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329) >> [bind] at >> org.apache.tools.ant.Project.executeTarget(Project.java:1298) >> [bind] at >> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExec >> ut >> or.java:41) >> [bind] at >> org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeT >> ar >> gets(EclipseDefaultExecutor.java:32) >> [bind] at >> org.apache.tools.ant.Project.executeTargets(Project.java:1181) >> [bind] at >> org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalA >> nt >> Runner.java:423) >> [bind] at >> org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(Internal >> An >> tRunner.java:137) >> >> I'm sure its something silly. Can someone give me a hand? >> Thanks, >> Lenny >> _______________________________________________ >> >> This e-mail may contain information that is confidential, privileged >> or otherwise protected from disclosure. If you are not an intended >> recipient of this e-mail, do not duplicate or redistribute it by any >> means. Please delete it and any attachments and notify the sender that >> > > >> you have received it in error. Unless specifically indicated, this >> e-mail is not an offer to buy or sell or a solicitation to buy or sell >> > > >> any securities, investment products or other financial product or >> service, an official confirmation of any transaction, or an official >> statement of Barclays. Any views or opinions presented are solely >> those of the author and do not necessarily represent those of >> Barclays. This e-mail is subject to terms available at the following >> link: www.barcap.com/emaildisclaimer. By messaging with Barclays you >> consent to the foregoing. Barclays Capital is the investment banking >> division of Barclays Bank PLC, a company registered in England (number >> > > >> 1026167) with its registered office at 1 Churchill Place, London, >> E14 5HP. This email may relate to or be sent from other members of >> the Barclays Group. >> _______________________________________________ >> >> ---------------------------------------------------------------------- >> -------- Stay on top of everything new and different, both inside and >> around Java (TM) technology - register by April 22, and save $200 on >> the JavaOne (SM) conference, June 2-5, 2009, San Francisco. >> 300 plus technical and hands-on sessions. Register today. >> Use priority code J9JMT32. http://p.sf.net/sfu/p >> _______________________________________________ >> jibx-users mailing list >> jibx-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/jibx-users >> >> > > > ------------------------------------------------------------------------ > ------ > Stay on top of everything new and different, both inside and around Java > (TM) technology - register by April 22, and save $200 on the JavaOne > (SM) conference, June 2-5, 2009, San Francisco. > 300 plus technical and hands-on sessions. Register today. > Use priority code J9JMT32. http://p.sf.net/sfu/p > _______________________________________________ > jibx-users mailing list > jibx-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jibx-users > _______________________________________________ > > This e-mail may contain information that is confidential, privileged or > otherwise protected from disclosure. If you are not an intended recipient of > this e-mail, do not duplicate or redistribute it by any means. Please delete > it and any attachments and notify the sender that you have received it in > error. Unless specifically indicated, this e-mail is not an offer to buy or > sell or a solicitation to buy or sell any securities, investment products or > other financial product or service, an official confirmation of any > transaction, or an official statement of Barclays. Any views or opinions > presented are solely those of the author and do not necessarily represent > those of Barclays. This e-mail is subject to terms available at the following > link: www.barcap.com/emaildisclaimer. By messaging with Barclays you consent > to the foregoing. Barclays Capital is the investment banking division of > Barclays Bank PLC, a company registered in England (number 1026167) with its > registered office at 1 Churchill Place, London, E14 5HP. This email may > relate to or be sent from other members of the Barclays Group. > _______________________________________________ > > ------------------------------------------------------------------------------ > Stay on top of everything new and different, both inside and > around Java (TM) technology - register by April 22, and save > $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. > 300 plus technical and hands-on sessions. Register today. > Use priority code J9JMT32. http://p.sf.net/sfu/p > _______________________________________________ > jibx-users mailing list > jibx-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jibx-users > > ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensign option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users