I'm using the Ant XJC task, and attempting to load two JAXB extensions.  One is 
a local copy of the "element wrapper" plugin, and the other the "fluent api".

When I run this, I get the following error:
--------------------
Caused by: java.util.ServiceConfigurationError: com.sun.tools.xjc.Plugin: 
Provider dk.conspicio.jaxb.plugins.XmlElementWrapperPlugin not a subtype
        at com.sun.tools.xjc.Options.findServices(Options.java:965)
        at com.sun.tools.xjc.Options.getAllPlugins(Options.java:383)
--------------------

I'm asking this here because I am using an Ant task, so perhaps someone might 
know what that error message means.  However, I'm calling this from a Gradle 
build script.  I'll show that in a moment if that helps to illuminate anything.

I previously was doing the same work in a Maven POM, using the 
"cxf-xjc-plugin", which was working fine.

My task looks like this:
-------------------------
task processXSDs() << {
        ant.taskdef(name: 'xjc', classname: 'com.sun.tools.xjc.XJCTask',
                                classpath: configurations.jaxb.asPath)
        ant.xjc(destdir: 'tmp', package: 
"com.att.sunlight.service.domain.serviceCallResults", extension: true) {
                classpath(path: configurations.jaxb.asPath)
                schema(dir: "src/main/resources/schema", includes: 
"serviceCallResults.xsd")
        arg(value: "-Xxew")
        arg(value: "-summary target/xew-summary.txt")
        arg(value: "-instantiate lazy")
        arg(value: "-Xfluent-api")
        }
}
-------------

If it matters, the "arg" lines were added after I first saw this error, so 
those are irrelevant.  I also added the additional classpath reference in the 
"xjc" task call, which also made no difference.

Where I added the following to the jaxb configuration:
        jaxb 'com.sun.xml.bind:jaxb-xjc:2.2.6'
        jaxb 'com.sun.xml.bind:jaxb-impl:2.2.6'
        jaxb 'javax.xml.bind:jaxb-api:2.2.6'
        jaxb "JAXBXMLElementWrapperPlugin:JAXBXMLElementWrapperPlugin:1.0.0"
        jaxb "net.java.dev.jaxb2-commons:jaxb-fluent-api:2.1.8"

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org

Reply via email to