build-impl.xml error when using NetBeans - java

Ok, so I asked this question yesterday, and I still haven't found my solution, but I luckily I have enabled more logging and I am receiving this error message:
C:\....\nbproject\build-impl.xml:1039: The following error occurred while executing this line:
C:\....\nbproject\build-impl.xml:804: Java returned: 1
at org.apache.tools.ant.taskdefs.Java.execute(Java.java:111)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor245.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
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.taskdefs.Sequential.execute(Sequential.java:68)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor245.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
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.taskdefs.MacroInstance.execute(MacroInstance.java:396)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor245.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
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.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:286)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:555)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
BUILD FAILED (total time: 6 minutes 8 seconds)
Could not load class (org.apache.tools.ant.taskdefs.repository.MavenRepository) for type mavenrepository
Could not load a dependent class (jdepend/xmlui/JDepend) for type jdepend
Could not load a dependent class (javax/media/jai/PlanarImage) for type image
Could not load class (org.apache.tools.ant.taskdefs.repository.MavenRepository) for type mavenrepository
Could not load a dependent class (jdepend/xmlui/JDepend) for type jdepend
Could not load a dependent class (javax/media/jai/PlanarImage) for type image
I am using NetBeans 8.1 with only JDK 8 (both 32bit). I am also using Windows 8. I have performed a clean on the build-impl.xml from within NetBeans and I am still seeing this issue. Is it related to Ant somehow? I don't even really know what Ant is or does.
Here is the output for line 1039:
<j2seproject1:java>
<customize>
<arg line="${application.args}"/>
</customize>
</j2seproject1:java>
Here is the output for line 804
<java classname="#{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
<jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
<jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
<redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
<jvmarg line="${run.jvmargs}"/>
<jvmarg line="${run.jvmargs.ide}"/>
<classpath>
<path path="#{classpath}"/>
</classpath>
<syspropertyset>
<propertyref prefix="run-sys-prop."/>
<mapper from="run-sys-prop.*" to="*" type="glob"/>
</syspropertyset>
<customize/>
</java>

I have had the same problem and I have created a new glassfihs server and then it has worked...

Related

Handle java.lang.NegativeArraySizeException in Intellij IDE on ant input

<target name="readme" description="Create readme.txt for Build">
<echo>Creating readme.txt file </echo>
<input
message="Enter text for Readme.txt:"
addproperty="README_TXT"
defaultvalue="This is for file input: ${ant.project.name}"
/>
<echo>Text is: ${README_TXT} </echo>
</target>
When executing this,
When entered a simple sort string This is test line it is working fine
When entered a long string like a,jsha,mskahskakshkahskhakshakskaksdhksdfsfd.,df,d'fdkf;dfdljflkdhfdhkfdkhfkdhfkdkfdkf
it's throwing Exception:
/proj1/build.xml:312: java.lang.NegativeArraySizeException
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:116)
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.Main.start(Main.java:198)
at org.apache.tools.ant.Main.main(Main.java:286)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.ant.execution.AntMain2.main(AntMain2.java:30)
Caused by: java.lang.NegativeArraySizeException
at com.intellij.rt.ant.execution.IdeaInputHandler.readBytes(IdeaInputHandler.java:77)
at com.intellij.rt.ant.execution.IdeaInputHandler.handleInput(IdeaInputHandler.java:64)
at org.apache.tools.ant.taskdefs.Input.execute(Input.java:232)
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)
... 16 more
This is a bug in IntelliJ IDEA. You're welcome to report it to the issue tracker at https://youtrack.jetbrains.com/issues/IDEA

java.lang.reflect.InvocationTargetException When running Java web app with WildFly server

I trying to use WildFly 9.0.1 server to run a Java web application.
I created a new project and select the wildfly server as well as hibernate.
When I try running the server,
I get the following error:
WildFly Application Server Started
Distributing /Users/davey/NetBeansProjects/WebApplication1/dist/WebApplication1.war to [org.netbeans.modules.javaee.wildfly.WildflyDeploymentManager$1#5e97ba27]
java.lang.reflect.InvocationTargetException
/Users/davey/NetBeansProjects/WebApplication1/nbproject/build-impl.xml:1052: The module has not been deployed.
See the server log for details.
Line 1052 of build-impl.xml has the following:
<target depends="init,-init-cos,compile,compile-jsps,-do-compile-single-jsp,-pre-dist,-do-tmp-dist-with-manifest,-do-tmp-dist-without-manifest,-pre-run-deploy,-pre-nbmodule-run-deploy,-run-deploy-nb,-init-deploy-ant,-deploy-ant,-run-deploy-am,-post-nbmodule-run-deploy,-post-run-deploy,-do-update-breakpoints" name="run-deploy"/>
<target if="netbeans.home" name="-run-deploy-nb">
[THIS IS LINE 1052] <nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
</target>
And in the info log, I see this output, not sure how it's related, but looks like netbeans throws this and asks me to report the error to netbeans.
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
at org.xnio.nio.WorkerThread$ConnectHandle.handleReady(WorkerThread.java:319)
at org.xnio.nio.WorkerThread.run(WorkerThread.java:539)
at ...asynchronous invocation...(Unknown Source)
at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:272)
at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:253)
at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:351)
at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:339)
at org.jboss.as.protocol.ProtocolConnectionUtils.connect(ProtocolConnectionUtils.java:83)
at org.jboss.as.protocol.ProtocolConnectionUtils.connectSync(ProtocolConnectionUtils.java:114)
Caused: java.net.ConnectException: WFLYPRT0053: Could not connect to remote://localhost:9999. The connection failed
at org.jboss.as.protocol.ProtocolConnectionUtils.connectSync(ProtocolConnectionUtils.java:122)
at org.jboss.as.protocol.ProtocolConnectionManager$EstablishingConnection.connect(ProtocolConnectionManager.java:257)
at org.jboss.as.protocol.ProtocolConnectionManager.connect(ProtocolConnectionManager.java:71)
at org.jboss.as.protocol.mgmt.FutureManagementChannel$Establishing.getChannel(FutureManagementChannel.java:212)
at org.jboss.as.controller.client.impl.RemotingModelControllerClient.getOrCreateChannel(RemotingModelControllerClient.java:146)
at org.jboss.as.controller.client.impl.RemotingModelControllerClient$1.getChannel(RemotingModelControllerClient.java:65)
at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:147)
at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:122)
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeRequest(AbstractModelControllerClient.java:263)
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:168)
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:147)
Caused: java.io.IOException
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:149)
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:75)
Caused: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.netbeans.modules.javaee.wildfly.ide.commands.WildflyClient.executeOnModelNode(WildflyClient.java:261)
at org.netbeans.modules.javaee.wildfly.ide.commands.WildflyClient.undeploy(WildflyClient.java:523)
Caused: java.io.IOException
at org.netbeans.modules.javaee.wildfly.ide.commands.WildflyClient.undeploy(WildflyClient.java:529)
at org.netbeans.modules.javaee.wildfly.ide.commands.WildflyClient.deploy(WildflyClient.java:541)
[catch] at org.netbeans.modules.javaee.wildfly.WildflyDeploymentManager.distribute(WildflyDeploymentManager.java:189)
at org.netbeans.modules.j2ee.deployment.impl.TargetServer.deploy(TargetServer.java:683)
at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:246)
at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:166)
at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:111)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor372.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.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:286)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:555)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
EDIT
When I use the GlassFish Server instead, everything works just fine

Java Application Fails At Build Time

I am migrating an application from Quartz 1.8 to Quartz 2.2.2. In order to build my application I added quartz-2.2.2.jar and c3p0-0.9.1.1.jar. I am building my application using jdk-1.6 version. While building my application I am getting below error:
An exception has occurred in the compiler (1.6.0_29). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.IllegalAccessError: tried to access class com/sun/tools/javac/comp/MemberEnter$3 from class com/sun/tools/javac/comp/MemberEnter
at com.sun.tools.javac.comp.MemberEnter.importNamedStatic(MemberEnter.java:244)
at com.sun.tools.javac.comp.MemberEnter.visitImport(MemberEnter.java:542)
at com.sun.tools.javac.tree.JCTree$JCImport.accept(JCTree.java:495)
at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:399)
at com.sun.tools.javac.comp.MemberEnter.visitTopLevel(MemberEnter.java:512)
at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:446)
at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:819)
at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:763)
at com.sun.tools.javac.comp.Enter.complete(Enter.java:464)
at com.sun.tools.javac.comp.Enter.main(Enter.java:442)
at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:822)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
at com.sun.tools.javac.main.Main.compile(Main.java:353)
at com.sun.tools.javac.main.Main.compile(Main.java:279)
at com.sun.tools.javac.main.Main.compile(Main.java:270)
at com.sun.tools.javac.Main.compile(Main.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:56)
at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1065)
at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:882)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
Please help me out here. Thanks in advance.
java docs about IllegalAccessError :
Normally, this error is caught by the compiler; this error can only
occur at run time if the definition of a class has incompatibly
changed.
So you are probably accessing something from Quartz 1.8 than isn't available in Quartz 2.2.2.
An exception has occurred in the compiler (1.6.0_29)
your compiler is pretty old Quartz 2.2.2 maybe using some new java features

ClassCastException in ant schemagen task using jaxb-ri-2.2.7

I'm trying to use the schemagen ant task from JAXB-RI 2.2.7, but I keep getting "BUILD FAILED .... Error starting ap" on the schemagen task in build.xml. The relevant stanzas are as follows:
<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>
With -verbose, I get the stack trace below. I've tried googling for the details of the ClassCastException but not found anything. Any suggestions?
Thanks, Adam
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
Same problem here. From the stack trace I would say it's some error in JAXB annotation, but while xjc tries to handle that exception it fails with another one and there's no way of knowing in which class and property the problem is.

JUnit fails but no tests report as failing

I am running JUnit tests using Ant on the command line on Windows XP.
On some runs, midway through running all of the tests, I will get a BUILD FAILED message pointing at a specific test class, but all of the tests in that class are reported as having passed both in the console output and in the XML file.
The class contains no non-determinism and should not have any side-effects. There is no reason for it to be running out of memory either.
What could cause these strange build failures?
Update:
I doubt this will be helpful, but here is the end of the run when it fails (modified directory and package names for anonymity):
C:\proj\er20\rr> ant clean build test
<snip/>
[junit] Running com.example.PathUTest
[junit] Tests run: 6, Failures: 0, Errors: 0, Time elapsed: 7.5 sec
BUILD FAILED
C:\proj\er20\common\build.xml:385: The following error occurred while executing this line:
C:\proj\er20\rr\build.xml:58: Test com.example.PathUTest failed
Update 2:
I have finally managed to get the failure to happen with -verbose enabled. Here is the stacktrace (copied by hand):
BUILD FAILED
C:\proj\er20\common\build.xml:385: The following error occurred while executing this line:
C:\proj\er20\rr\build.xml:58: Test com.example.PathUTest failed
at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:541)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:418)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.Main.runBuild(Main.java:698)
at org.apache.tools.ant.Main.startAnt(Main.java:199)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: C:\proj\er20\rr\build.xml:58: Test com.example.PathUTest failed
at org.apache.tools.ant.taskdefs.optionl.junit.JUnitTask.actOnTestResult(JUnitTask.java:1712)
at org.apache.tools.ant.taskdefs.optionl.junit.JUnitTask.execute(JUnitTask.java:820)
at org.apache.tools.ant.taskdefs.optionl.junit.JUnitTask.executeOrQueue(JUnitTask.java:1657)
at org.apache.tools.ant.taskdefs.optionl.junit.JUnitTask.execute(JUnitTask.java:764)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
... 17 more
--- Nested Exception ---
C:\proj\er20\rr\build.xml:58 Test com.example.PathUTest failed
at org.apache.tools.ant.taskdefs.optionl.junit.JUnitTask.actOnTestResult(JUnitTask.java:1712)
at org.apache.tools.ant.taskdefs.optionl.junit.JUnitTask.execute(JUnitTask.java:820)
at org.apache.tools.ant.taskdefs.optionl.junit.JUnitTask.executeOrQueue(JUnitTask.java:1657)
at org.apache.tools.ant.taskdefs.optionl.junit.JUnitTask.execute(JUnitTask.java:764)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.perform(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
at org.apache.tools.ant.tskdefs.CallTarget.execute(CallTarget.java:105)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor4.invoke(Source Unknown)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.Main.runBuild(Main.java:698)
at org.apache.tools.ant.Main.startAnt(Main.java:199)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Total time: 1 minute 27 seconds
And here is the relevant Ant target:
<target name="test">
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="../buildsupport/lib/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<!-- line 58 is the next line -->
<junit printsummary="yes" fork="yes" haltonfailure="yes" dir="${test-dir}" showoutput="yes">
<jvmarg value="-Xmx10200M"/>
<jvmarg value="-Xms600M"/>
<jvmarg value="-server"/>
<jvmarg value="-Dlog4j.configuration=file:log4j.xml"/>
<jvmarg value="-XX:CompileCommand=exclude,com.example.GtaCore,expandLabel"/>
<env key="LD_LIBRARY_PATH" path="${env.LD_LIBRARY_PATH}:${test-dir}/native_lib"/>
<jvmarg value="-Djava.library.path=./native_lib"/>
<formatter type="xml"/>
<classpath>
<!-- classpath items -->
</classpath>
<batchtest>
<fileset includes="**/*Test.class" excludes="**/*$$*.class"/>
</batchtest>
</junit>
<junitreport>
<!-- config -->
</junitreport>
<echo> finished suite</echo>
</target>
Probable Cause and Solution
We discovered that deep down within code that we were calling, an error debugging GUI was being displayed which ran in another thread. Since disabling the display of this GUI, we have not seen this issue again.
Maybe in rr\build.xml (you have 2 build files) at line 58 there is
<fail message="Test com.example.PathUTest failed"/>

Categories