Hi everyone again, Tyring to get a successful binding compilation referencing a precompiled binding I decided to use the JiBX Ant tasks through the ant-run maven plugin.
Again, I ran into the same classloader conflict error, which makes me think the problem is related to the way Maven and JiBXbinding compiler load the classes that somehow end up loading IBindingFactory in different classloaders. I could only run a successful binding compilation from the command line, doing "java -cp ... orj.jibx.binding.Compile .." The maven JiBX plugin is very simple in its implementation and nothing in it points to an improper handling of the classloaders. It's only the combination of the Maven plugin execution and JiBX binding compilation that generates the issue. Has anyone been able to use precompiled bindings using the maven JiBX plugin? Thanks again, Karel > Hi everyone, > > I'm working on a simple solution where I have two projects and one > reuses classes already bound (precompiled) in the other project. I'm > using JiBX version 1.2.1 > > Let's say I have a precompiled binding in projectA, projecta-binding.xml > > <binding package="com.projecta"> > <mapping name="a" class="...A"> > .... > </mapping> > </binding> > > Then projectB defines a binding that requires using class A from > projectA already compiled, projectb-binding.xml > > <binding> > <include path="projecta-binding.xml" precompiled="true" /> > > <mapping name="b" class="....B"> > <structure .... map-as="...A" /> > </mapping> > </binding> > > However when I do "mvn clean install" (using the 1.2.1 JiBX maven > plugin) I get the following error: > > "Classloader conflict for binding 'projecta_binding' - factory does not > implement required interface" > > The exception is thrown from BindingDirectory.getFactory() method. I've > checked the binding factory generated by JiBX does implement > IBindingFactory, so I'm assumming it is really a class loader issue but > I'm not doing anything fancy, just a "mvn clean install". > > I'd appreciate any help or advice regarding the use of precompiled > binding as shown in this example. > > Also, as a second suggestion, is it possible to include a precompiled > binding doing <include path="classpath:binding.xml"/> ? in that way > other projects don't have to manually copy the precompiled binding > definition to the project directory. > > Thanks in advance, > > Karel > > ------------------------------------------------------------------------------ > _______________________________________________ > jibx-users mailing list > jibx-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jibx-users > ------------------------------------------------------------------------------ _______________________________________________ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users