This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
[5/Apr/2001] I set Indirect Ant as default compiler. Opening filesystem that does not contain build.xml somewhere in path shows: Thu Apr 05 15:40:50 GMT+02:00 2001: org.openide.util.RequestProcessor$Holder: Posted StackTrace Annotation: No build.xml Ant script was found above object DomEcho04. org.openide.util.RequestProcessor$Holder: Posted StackTrace(task org.netbeans.modules.java.JavaNode$1@558b7 [-14612, 1, -1]) at org.openide.util.RequestProcessor$Task.createHolder(RequestProcessor.java:322) at org.openide.util.RequestProcessor.post(RequestProcessor.java:100) at org.openide.util.RequestProcessor.post(RequestProcessor.java:84) at org.openide.util.RequestProcessor.postRequest(RequestProcessor.java:171) at org.netbeans.modules.java.JavaNode.requestResolveIcons(JavaNode.java:251) at org.netbeans.modules.java.JavaNode.sourceParsed(JavaNode.java:212) at org.netbeans.modules.java.JavaNode$PropL.stateChanged(JavaNode.java:169) at org.openide.util.WeakListener$Change.stateChanged(WeakListener.java:583) at org.netbeans.modules.java.parser.ParsingSupport.fireStateChange(ParsingSupport.java:276) at org.netbeans.modules.java.parser.ParsingSupport.changeStatus(ParsingSupport.java:259) at org.netbeans.modules.java.parser.ParsingSupport$Processor.complete(ParsingSupport.java:618) at org.netbeans.modules.java.parser.ParsingSupport$Processor.run(ParsingSupport.java:557) at org.openide.util.Task.run(Task.java:124) [catch] at org.openide.util.RequestProcessor$ProcessorThread.run(RequestProcessor.java:622)
Sorry, the stack trace is not complete - the portion that shows the actual error source is missing (only trace of code that posted the request is there). Could you attach the second trace part as well ?
Unfortunatelly it was not provided. However it is easily reproducible.
Reproduced, missing portion attached. It seems that Ant compiler throws IllegalArgumentException. Jesse, could you correct it in ant's CompilerType ? org.openide.compilers.CompilerType does not document throwing IllegalArg from prepareJob().
Created attachment 1024 [details] The real exception thrown from ant CompilerType
Jesse, I don't think that the CompilerType should throw IllegalArgument. Maybe printing a warning to output window when the compilation starts would be better. Anyway, if you think throwing the exception si correct, reassign this back to me. Thanks.
It's true, it does not declare IAE can be thrown. But if the job cannot be prepared at all, it is strange to print something--after all messages can only be printed from a compiler group, and there is none applicable here. It would be necessary to construct an entirely separate "fake" compiler and compiler group just to print this one message. So I think the API is deficient. Compare Executor.execute which can throw an IOException if the executor is misconfigured somehow--there appears to be no equivalent way for compiler types to report a problem. BTW I have already filed a bug that RP does not print the "real" stack trace from an exception, I think it is not using ErrorManager correctly. Also AFAIK if you actually run the compilation using F9, ErrorManager is used and the user is given a nice dialog with the message about what is wrong--there is no stack trace. So it might be a good idea for JavaNode to do the same, in the interests of robustness--catch runtime exceptions (or at least IAE) from resolveCompileBadge and report using ErrorManager.
I would point out that JavaCompilerType throws ClassCastException when run on a non-Java source, which is not exactly declared either... (I think there is some openide enhancement request that service types be able to declare what DataObject's they are applicable to?)
Yarda suggests: compiler produce dummy group which will fire compiler error event when run. No better way to do it, apparently.
Fixed in the trunk: AntCompilerType.java 1.5, IndirectAntCompilerType.java 1.4.
Fixed in release32.
Target milestone -> 3.2
Verified in build 20010627.
I have been seeing this issue again lately (last week or two) while using NetBeans from the CVS trunk. It is very annoying since I'm developing a NetBeans module and thus the stacktraces are getting in the way of any errors that _my_ module might be generating. Here is a stack trace: [org.apache.tools.ant.module] INFORMATIONAL *********** Exception occurred ***** ******* at Sat Sep 14 00:29:37 CDT 2002 Annotation: No build.xml Ant script was found above object JApplet. java.lang.IllegalArgumentException: No build.xml found for: Templates/GUIForms/J Applet.java at org.apache.tools.ant.module.run.IndirectAntCompilerType.prepareJob0(I ndirectAntCompilerType.java:105) [catch] at org.apache.tools.ant.module.run.AntCompilerType.prepareJob(AntCompile rType.java:76) at org.openide.loaders.CompilerSupport.addToJob(CompilerSupport.java:89) at org.netbeans.modules.java.JavaDataObject.checkUpToDate(JavaDataObject .java:1226) at org.netbeans.modules.java.JavaDataObject.access$400(JavaDataObject.ja va:63) at org.netbeans.modules.java.JavaDataObject$PrimaryListener.propertyChan ge(JavaDataObject.java:964) at org.openide.loaders.DataObject.firePropertyChange(DataObject.java:793 ) at org.openide.loaders.MultiDataObject$1.run(MultiDataObject.java:663) at org.openide.util.Task.run(Task.java:136) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java :599) [org.apache.tools.ant.module] INFORMATIONAL *********** Exception occurred ***** ******* at Sat Sep 14 00:29:37 CDT 2002 Annotation: No build.xml Ant script was found above object JDialog. java.lang.IllegalArgumentException: No build.xml found for: Templates/GUIForms/J Dialog.java at org.apache.tools.ant.module.run.IndirectAntCompilerType.prepareJob0(I ndirectAntCompilerType.java:105) [catch] at org.apache.tools.ant.module.run.AntCompilerType.prepareJob(AntCompile rType.java:76) at org.openide.loaders.CompilerSupport.addToJob(CompilerSupport.java:89) at org.netbeans.modules.java.JavaDataObject.checkUpToDate(JavaDataObject .java:1226) at org.netbeans.modules.java.JavaDataObject.access$400(JavaDataObject.ja va:63) at org.netbeans.modules.java.JavaDataObject$PrimaryListener.propertyChan ge(JavaDataObject.java:964) at org.openide.loaders.DataObject.firePropertyChange(DataObject.java:793 ) at org.openide.loaders.MultiDataObject$1.run(MultiDataObject.java:663) at org.openide.util.Task.run(Task.java:136) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java :599) [org.apache.tools.ant.module] INFORMATIONAL *********** Exception occurred ***** ******* at Sat Sep 14 00:29:37 CDT 2002 Annotation: No build.xml Ant script was found above object JFrame. java.lang.IllegalArgumentException: No build.xml found for: Templates/GUIForms/J Frame.java at org.apache.tools.ant.module.run.IndirectAntCompilerType.prepareJob0(I ndirectAntCompilerType.java:105) [catch] at org.apache.tools.ant.module.run.AntCompilerType.prepareJob(AntCompile rType.java:76) at org.openide.loaders.CompilerSupport.addToJob(CompilerSupport.java:89) at org.netbeans.modules.java.JavaDataObject.checkUpToDate(JavaDataObject .java:1226) at org.netbeans.modules.java.JavaDataObject.access$400(JavaDataObject.ja va:63) at org.netbeans.modules.java.JavaDataObject$PrimaryListener.propertyChan ge(JavaDataObject.java:964) at org.openide.loaders.DataObject.firePropertyChange(DataObject.java:793 ) at org.openide.loaders.MultiDataObject$1.run(MultiDataObject.java:663) at org.openide.util.Task.run(Task.java:136) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java :599) [org.apache.tools.ant.module] INFORMATIONAL *********** Exception occurred ***** ******* at Sat Sep 14 00:29:37 CDT 2002 Annotation: No build.xml Ant script was found above object JInternalFrame. java.lang.IllegalArgumentException: No build.xml found for: Templates/GUIForms/J InternalFrame.java at org.apache.tools.ant.module.run.IndirectAntCompilerType.prepareJob0(I ndirectAntCompilerType.java:105) [catch] at org.apache.tools.ant.module.run.AntCompilerType.prepareJob(AntCompile rType.java:76) at org.openide.loaders.CompilerSupport.addToJob(CompilerSupport.java:89) at org.netbeans.modules.java.JavaDataObject.checkUpToDate(JavaDataObject .java:1226) at org.netbeans.modules.java.JavaDataObject.access$400(JavaDataObject.ja va:63) at org.netbeans.modules.java.JavaDataObject$PrimaryListener.propertyChan ge(JavaDataObject.java:964) at org.openide.loaders.DataObject.firePropertyChange(DataObject.java:793 ) at org.openide.loaders.MultiDataObject$1.run(MultiDataObject.java:663) at org.openide.util.Task.run(Task.java:136) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java :599) [org.apache.tools.ant.module] INFORMATIONAL *********** Exception occurred ***** ******* at Sat Sep 14 00:29:37 CDT 2002 Annotation: No build.xml Ant script was found above object JPanel. java.lang.IllegalArgumentException: No build.xml found for: Templates/GUIForms/J Panel.java at org.apache.tools.ant.module.run.IndirectAntCompilerType.prepareJob0(I ndirectAntCompilerType.java:105) [catch] at org.apache.tools.ant.module.run.AntCompilerType.prepareJob(AntCompile rType.java:76) at org.openide.loaders.CompilerSupport.addToJob(CompilerSupport.java:89) at org.netbeans.modules.java.JavaDataObject.checkUpToDate(JavaDataObject .java:1226) at org.netbeans.modules.java.JavaDataObject.access$400(JavaDataObject.ja va:63) at org.netbeans.modules.java.JavaDataObject$PrimaryListener.propertyChan ge(JavaDataObject.java:964) at org.openide.loaders.DataObject.firePropertyChange(DataObject.java:793 ) at org.openide.loaders.MultiDataObject$1.run(MultiDataObject.java:663) at org.openide.util.Task.run(Task.java:136) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java :599) [org.apache.tools.ant.module] INFORMATIONAL *********** Exception occurred ***** ******* at Sat Sep 14 00:29:38 CDT 2002 Annotation: No build.xml Ant script was found above object Bean Form. java.lang.IllegalArgumentException: No build.xml found for: Templates/GUIForms/B eanForm.java at org.apache.tools.ant.module.run.IndirectAntCompilerType.prepareJob0(I ndirectAntCompilerType.java:105) [catch] at org.apache.tools.ant.module.run.AntCompilerType.prepareJob(AntCompile rType.java:76) at org.openide.loaders.CompilerSupport.addToJob(CompilerSupport.java:89) at org.netbeans.modules.java.JavaDataObject.checkUpToDate(JavaDataObject .java:1226) at org.netbeans.modules.java.JavaDataObject.access$400(JavaDataObject.ja va:63) at org.netbeans.modules.java.JavaDataObject$PrimaryListener.propertyChan ge(JavaDataObject.java:964) at org.openide.loaders.DataObject.firePropertyChange(DataObject.java:793 ) at org.openide.loaders.MultiDataObject$1.run(MultiDataObject.java:663) at org.openide.util.Task.run(Task.java:136) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java :599) [org.apache.tools.ant.module] INFORMATIONAL *********** Exception occurred ***** ******* at Sat Sep 14 00:29:38 CDT 2002 Annotation: No build.xml Ant script was found above object Customizer. java.lang.IllegalArgumentException: No build.xml found for: Templates/Beans/Cust omizer.java at org.apache.tools.ant.module.run.IndirectAntCompilerType.prepareJob0(I ndirectAntCompilerType.java:105) [catch] at org.apache.tools.ant.module.run.AntCompilerType.prepareJob(AntCompile rType.java:76) at org.openide.loaders.CompilerSupport.addToJob(CompilerSupport.java:89) at org.netbeans.modules.java.JavaDataObject.checkUpToDate(JavaDataObject .java:1226) at org.netbeans.modules.java.JavaDataObject.access$400(JavaDataObject.ja va:63) at org.netbeans.modules.java.JavaDataObject$PrimaryListener.propertyChan ge(JavaDataObject.java:964) at org.openide.loaders.DataObject.firePropertyChange(DataObject.java:793 ) at org.openide.loaders.MultiDataObject$1.run(MultiDataObject.java:663) at org.openide.util.Task.run(Task.java:136) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java :599)
Brian - the symptoms you are describing are the *fix* of the bug, not a regression. It now only logs an informational-level message to the log file. Since you set the default compiler type for all .java to be IAE, and did not supply a build.xml, in fact random .java files are *not* compilable; and the Java module tries to check compilation status of files in order to update the icon badge, which it cannot do. I guess the stack trace in the log file could simply be suppressed. However this could result in suppressing potentially useful debugging info in the case of real errors, since there are several kinds of reasons why preparing a compilation job with an IAE might fail. My best suggestion at this point is to remove call to notify() from AntCompilerType.prepareJob, and add it to BogusCompilerGroup.start, to hopefully prevent the stack traces from being printed in case the Java module is only probing for badges. Issue #3934 has a summary of the discussion for making service types such as compilers apply only to certain files, which is the underlying problem. 4.0's projects support will very likely introduce major changes in how things like compilation options are associated to files, which will probably obsolete issues like this anyway.
I see that this is the expected behavior. But, IMO the real problem is that the Java module doesn't need to check compilation status of Templates/GUIForms/JInternalFrame.java et al. I think that the actions in the templates for Java source code are causing the Java module to unnecessarily chec the compilation status of the java source code templates, which seems to me to be completely unnecessary since they are always uncompiled. In other words, doing <Context Menu>->New->Java Class shouldn't trigger this message. That means that the message would only occur with mounted filesystems, and I can control that by setting those filesystems to be uncompilable, I think. Besides the above, maybe Indirect Ant Compiler should delegate to the internal compiler when it can't find a build.xml?
"That means that the message would only occur with mounted filesystems, and I can control that by setting those filesystems to be uncompilable, I think." - actually templates are on the system filesystem which is currently always set to be used in compilation. I'm not sure it needs to be, however; probably it doesn't. The only cases where you would be compiling or running a class in the SFS is (1) the Startup folder, (2) VCS Generic commands. These could be easily special-cased, I think. "Besides the above, maybe Indirect Ant Compiler should delegate to the internal compiler when it can't find a build.xml?" - sounds too clever to me, and besides is Java-specific whereas the Ant module generally shouldn't be.
Fixed as Jesse suggected. The exception is thrown only after the compilation job is started and not during the preparing of compilation job. That should solve Brian's problem. Fixed in file: Checking in src/org/apache/tools/ant/module/run/AntCompilerType.java new revision: 1.8; previous revision: 1.7
Resolved for 3.3.x or earlier, no new info since then -> closing.