XJC任务失败

时间:2017-12-28 15:24:03

标签: java jaxb eclipselink weblogic12c xjc

尝试使用XJC Ant Task,所有库都驻留在我的Weblogic 12.2.1安装中。我在运行anttask时遇到以下异常。我试图更改eclipselink的版本但无法找到解决方案

Caused by: Exception [EclipseLink-50001] (Eclipse Persistence Services - 2.6.4.v20160829-44060b6): org.eclipse.persistence.exceptions.JAXBException
Exception Description: The class com.sun.codemodel.JDefinedClass requires a zero argument constructor or a specified factory method.  Note that non-static inner classes do not have zero argument constructors and are not supported.
        at org.eclipse.persistence.exceptions.JAXBException.factoryMethodOrConstructorRequired(JAXBException.java:148)
        at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.finalizeProperties(AnnotationsProcessor.java:966)
        at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processClassesAndProperties(AnnotationsProcessor.java:304)
        at org.eclipse.persistence.jaxb.compiler.Generator.<init>(Generator.java:158)

Ant文件如下

<project default="main" basedir=".">
    <path id="build.classpath">
        <fileset dir="C:\Weblogic\wlserver\server\lib" includes="**/weblogic.jar" />
    </path>

    <taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask" classpathref="build.classpath" />


    <echo message="calling the web services generation ant task: axis_bujava"/>
    <target name="main" >
        <compile-types/>

    </target>
    <macrodef name="compile-types">
        <sequential>
            <xjc destdir="C:\eclipse\workspace\Test\src" package="com.test.types">
                <ARG value="-npa" />
                <schema dir="C:\eclipse\workspace\Test\schema" includes="*.xsd" />
            </xjc>
        </sequential>
    </macrodef>

</project>

0 个答案:

没有答案