2014-07-08 5 views
3

JAXB-RI 2.2.7에서 schemagen ant 작업을 사용하려고하는데 "BUILD FAILED .... ap"오류가 계속 발생합니다. build.xml의 schemagen 작업. 관련 스탠자는 다음과 같습니다.jaxb-ri-2.2.7을 사용하여 개미 schemaster 작업에서 ClassCastException

<taskdef name="schemagen" classname="com.sun.tools.jxc.SchemaGenTask"> 
    <classpath refid="compile.classpath"/> 
</taskdef> 

<target name="schemas" description="Compile all Java source files"> 
<mkdir dir="${schemas.dir}" /> 
<schemagen destdir="${schemas.dir}"> 
    <src path="${src.dir}"/> 
    <classpath refid="compile.classpath" /> 
</schemagen> 
</target> 

-verbose와 함께 다음과 같은 스택 추적을 얻습니다. 나는 ClassCastException의 세부 사항에 대해 인터넷 검색을 시도했지만 아무 것도 발견하지 못했다. 어떤 제안?

감사합니다, 아담

여기
BUILD FAILED 
/home/adam/sandboxes/adam/sensei/code/trunk/repository/build.xml:99: Error starting ap 
    at com.sun.tools.jxc.ApBasedTask$InternalApAdapter.execute(ApBasedTask.java:131) 
    at com.sun.tools.jxc.ApBasedTask.compile(ApBasedTask.java:170) 
    at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:930) 
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) 
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:606) 
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) 
    at org.apache.tools.ant.Task.perform(Task.java:348) 
    at org.apache.tools.ant.Target.execute(Target.java:435) 
    at org.apache.tools.ant.Target.performTasks(Target.java:456) 
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393) 
    at org.apache.tools.ant.Project.executeTarget(Project.java:1364) 
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) 
    at org.apache.tools.ant.Project.executeTargets(Project.java:1248) 
    at org.apache.tools.ant.Main.runBuild(Main.java:851) 
    at org.apache.tools.ant.Main.startAnt(Main.java:235) 
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) 
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) 
Caused by: java.lang.RuntimeException: java.lang.AssertionError: java.lang.ClassCastException: com.sun.tools.javac.api.JavacTrees cannot be cast to com.sun.source.util.Trees 
    at com.sun.tools.javac.main.Main.compile(Main.java:469) 
    at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:132) 
    at com.sun.tools.jxc.ApBasedTask$InternalApAdapter.execute(ApBasedTask.java:127) 
    ... 18 more 
Caused by: java.lang.AssertionError: java.lang.ClassCastException: com.sun.tools.javac.api.JavacTrees cannot be cast to com.sun.source.util.Trees 
    at com.sun.source.util.Trees.getJavacTrees(Trees.java:84) 
    at com.sun.source.util.Trees.instance(Trees.java:73) 
    at com.sun.tools.jxc.model.nav.ApNavigator.getClassLocation(ApNavigator.java:410) 
    at com.sun.tools.jxc.model.nav.ApNavigator.getClassLocation(ApNavigator.java:83) 
    at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.getLocation(ClassInfoImpl.java:1284) 
    at com.sun.xml.bind.v2.runtime.IllegalAnnotationException.convert(IllegalAnnotationException.java:122) 
    at com.sun.xml.bind.v2.runtime.IllegalAnnotationException.build(IllegalAnnotationException.java:106) 
    at com.sun.xml.bind.v2.runtime.IllegalAnnotationException.<init>(IllegalAnnotationException.java:70) 
    at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.<init>(ClassInfoImpl.java:211) 
    at com.sun.xml.bind.v2.model.impl.ModelBuilder.createClassInfo(ModelBuilder.java:399) 
    at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:257) 
    at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:227) 
    at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:375) 
    at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:390) 
    at com.sun.tools.jxc.api.impl.j2s.JavaCompilerImpl.bind(JavaCompilerImpl.java:95) 
    at com.sun.tools.jxc.ap.SchemaGenerator.process(SchemaGenerator.java:110) 
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:793) 
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:722) 
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1700(JavacProcessingEnvironment.java:97) 
    at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1029) 
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1163) 
    at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1108) 
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:824) 
    at com.sun.tools.javac.main.Main.compile(Main.java:439) 
    ... 20 more 
Caused by: java.lang.ClassCastException: com.sun.tools.javac.api.JavacTrees cannot be cast to com.sun.source.util.Trees 
    at com.sun.source.util.Trees.getJavacTrees(Trees.java:82) 
    ... 43 more 
+0

동일한 문제가 발생합니다. 해결책을 찾았습니까? - 고마워, 마크. –

답변

0

같은 문제. 스택 추적에서 JAXB 주석의 일부 오류라고 말할 수 있지만 xjc가 예외를 처리하려고 시도하는 동안 다른 클래스와 함께 실패하고 어떤 클래스와 속성에서 문제인지를 알 수있는 방법이 없습니다.