Created attachment 95157 [details]
I cannot run my application if compile on save setting is enable.
Created attachment 95158 [details]
Compile on save setting
Created attachment 95159 [details]
Seems as broken cache iff run without Compile On Save works.
Can you try to do some simple edit and save in the class ITBPS1View if the problem happens even after it?
Does the Clean & Build work?
I've had the same exception. Clean and build didn't work for me.
'Compile on save' was always on.
After reading this bug, i cleared the flag and performed a build and started in debug. This worked for me.
Running IDE 6.9 build 201006101454
java 1.6.0_20 Client vm 16.3-b01
What should soemone submit when finding hitting this problem?
When you turn on the compile on save do you still have the problem?
If so, can you try to do some "no semantic" change in the file the RuntimeError comes from (eg. add a space) and save it. Does it solve the problem?
Just use Netbeans 6.9 problem solved :)
We still have this problem in Netbeans 6.9
Product Version: NetBeans IDE 6.9 (Build 201006101454)
We are working with a Maven project with modules. So some modules depend on other modules.
If we set the compile on build on in the run module we get this exception and the code (if we crtl click in the code to parent classes) only contains
throw new RuntimeException("Compiled Code");
Base on my experiment
I uninstall netbeans 6.8 then delete its folder which are not removed from the uninstall process. then i use the latest JDK. Then Install netbeans 6.9 after that when i check the compile on save setting & compile my swing framework the error does not occured anymore.
Hope it can help you.
Another Work Around...
1. Open Project
2. Right Click -> Click Properties
3. Project Properties -> Click Build Node -> Compiling Sub Node
4. Compiling -> UnCheck Compile On Save
5. Compile your project->Run
I am not able to reproduce it. If someone is able to do it, please reopen the issue with the signature file of the affected class (located in nb_user_dir/var/cache/index/s*/java/*/classes) and if possible with corresponding source file.
For weeks no problem with compile-on-save, then Netbeans 6.9 crashed one day, no process left hanging or anything. Restarted with "ok" to no other Netbeans running. From that point on compile-on-save resulted in the error noted. So, I built manually a few times, and at some point I turned compile-on-save back on and it was working again. Note that the code that failed to run in my case was a Swing component.
This same issue is happening for us in 6.9.1, in code from a 3rd party library and the Java core libraries (so obviously neither can be edited to fix). It comes on with "Compile on save" and goes away when this is turned off. Unfortunately the effect is intermittent - it worked fine for weeks then with no change to the relevant code (as we said, it's 3rd party) the "Uncompilable source code" RuntimeException appeared. If you google for "Uncompilable source code" and "Compile on Save" you geta lot of other people with the same problem. I'm keeping a record of my request for a solution at http://stackoverflow.com/questions/4386076/uncompilable-source-code-runtimeexception-in-netbeans
(In reply to comment #12)
I've kept a copy of the users .netbeans/cache when the situation occurred if this would be helpful to the netbeans developers. We had to clear it to get the situation working.
The user dir is very welcomed. If the library containing the problem can be shared it will be event better.
How you will share it?
Please attach or send the requested data. Without the requested data the issue state should not be changed from incomplete. The incomplete means that reporter or someone should provide the requested data. I cannot do much without the caches and possibly the source file
(In reply to comment #15)
> Please attach or send the requested data. Without the requested data the issue
> state should not be changed from incomplete. The incomplete means that reporter
> or someone should provide the requested data. I cannot do much without the
> caches and possibly the source file
I'm not sure exactly what to attach. When you say the library with the problem, the issue was not in the library the user had written, the exception was happening when a java class (java.util.TreeSet) was calling a third party library class (which was delivered in compiled form, so no source code was used, and I wouldn't have expected it to be compiled. Furthermore it's a commercial library so we don't have the rights to send it to you.
As far as the user directory is concerned, when I look at it, there were no .class files in it. Which files would you like? It was definitely a problem in this directory, because when we deleted everything in var/index/ and restarted netbeans the problem went away, so something somewhere was corrupt in the cache.
Created attachment 103821 [details]
Sig file we believe had the problem
We believe this file had uncompilable source code issue
Attached .sig file and reopened.
Thanks very much!
Yes, it's the class throwing the RE.
Seems the problem is in the synthetic bridged method created during lower by TransTypes.addBridge.
This is strange as this method just add erased version of the method delegating to the non erased one.
Dusan will know more.
One more thing if you still have the userdir with the wrong .sig file can you attach the errors folder from the cache folder. The case has following structure:
The erros folder from the same s<number> as java folder containing the broken sig file will be helpful.
i solved this problem by doing the following :
1) close NetBeans
2) delete all files and folders inside build folder
3) delete the following folders that existing in your user folder
for example on windows 7 (C:\Users\you_user_name\)
all user setting and cache will be removed
after that i reopen NetBeans and add the project - clean & build
the project worked.
*** Bug 195576 has been marked as a duplicate of this bug. ***
I was in Bug 195576. I haven't been able to reproduce the issue reliably. Build & Compile fails quite often due to jar file not being able to be deleted but when that happens I stop Tomcat and then do it, or just do Build. I also turned Deploy on Save off in the Project Properties > Run menu - that was able to solve the original really bad problem for me where the issue mentioned in the bug occurred and I couldn't get it to compile no matter what I did - even though NetBeans said Build Successful it obviously wasn't. Yes it is "Deploy on Save" labeled on the checkbox for me at least.
Created attachment 111564 [details]
Cache Folder and source code
I still have this problem with NB 7.0.1.
Attached I have the cache folder as well as my project group that triggers the exception. The main project is MicroflowEngine_08. Before running I cleared the cache.
The workaround with unchecking CompileOnSave works for me.
I also had this bug in the past. It is really annoying... That's one of the reasons why I don't really trust "Compile on save".
When I use "Compile on save" I normally do some "Clean and Build" along, to assure everything is fine. But after I do "Clean and Build" I fall on this bug:
In reply to Comment #25:
"When I use "Compile on save" I normally do some "Clean and Build" along, to
assure everything is fine."
Clean and Build before the Compile And Save run does not help at all as the compile on save rewrites the original files by the CoS generated files, it only hurts performance.
> Clean and Build before the Compile And Save run does not help at all as the
> compile on save rewrites the original files by the CoS generated files, it only
> hurts performance.
Yes, I know... But is hard to swallow that. Tell to the users that "Clean&Build" does not work when "Compile on Save" is enabled. Weird reactions will arise from the dark depths :P
Product Version: NetBeans IDE 7.0.1 (Build 201107282000)
Java: 1.6.0_29; Java HotSpot(TM) 64-Bit Server VM 20.4-b02
System: Windows 7 version 6.1 running on amd64; Cp1252; en_GB (nb)
I have had the another instance of the following:
java.lang.RuntimeException: Uncompilable source code - Erroneous sym type:
where removing the index folder allowed the Run/Debug to work correctly.
If this happens again what information do I need to submit?
Best information is the source file of the class for which the error happened.
Created attachment 113127 [details]
Source File of Runtime exception
L119 public FolderDelegate(final FolderDelegate parentFolder, final Folder folder)
L121 this.decorator=getFolderDecorator(folder.getType(), folder.getName());
L123 this.displayName=parentFolder==null || !parentFolder.getFolder().isDynamic() ?
L124 Resources.getResource("_Folder_" + folder.getName(), folder.getName()) :
Error was reported against L123 at "Folder.isDynamic" in the description of the RuntimeException.
- Closing Netbeans
- Deleting the 'index' directory to the Recycle bin
- resulting my application running again.
- Closing Netbeans
- restoring 'index' directory.
- Loading Netbeans
- also resulted in a running application
So the removal of the idex director forced Netbeans to correct another artefact that is not itself in the the 'index' folder but is involved in the cause of the exception.
The index folder contains the class files for Compile On Save.
When the Compile On Save is turned on the class files are updated (copied) from index folder to project/build/classes folder (no compilation is done).
Thanks for the information. I feel it worth highlighting that the 'Compile on Save' has not been changed and remain selected. In my instance these .class's are to be JARed and signed within an ant script. I do not know whether is this helping isolate the issue or not. But I will have to leave that to you.
Created attachment 113658 [details]
Class files generated when "Compile on save" is on AND off
(Included in readme.txt)
I've encountered a bug where a class called Axis throws an Uncompilable source code error when the Axis.valueOf(String) method is called from an external class. This exception only occurs when "Compile on save" is turned on, it does not occur when the feature is turned off. I've included the original Axis code, as well the class files generated when the "compile on save" is turned on AND when "compile on save" is turned off. My hopes are that there are some discrepencies between the class files which will shed some light on the bug.
Axis.java - Java file that generates an Uncompilable source code error when the Axis.valueOf(String) method is called.
Axis.class_compile_on_save - Class file generated by Netbeans when "Compile on save" is turned ON
Axis$1.class_compile_on_save - Additional class file generated by Netbeans when "Compile on save" is turned ON
Axis.class - Class file generated by Netbeans when "Compile on save" is turned OFF
Axis$1.class - Additional class file generated by Netbeans when "Compile on save" is turned OFF
Stacktrace of the exception:
java.lang.RuntimeException: Uncompilable source code
Product Version: NetBeans IDE 7.0.1 (Build 201107282000)
Java: 1.6.0_29; Java HotSpot(TM) Client VM 20.4-b02
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Documents and Settings\tanguayle\.netbeans\7.0
(In reply to comment #34)
> I've encountered a bug where a class called Axis throws an Uncompilable source
> code error when the Axis.valueOf(String) method is called from an external
> class. This exception only occurs when "Compile on save" is turned on, it does
> not occur when the feature is turned off. I've included the original Axis code,
> as well the class files generated when the "compile on save" is turned on AND
> when "compile on save" is turned off. My hopes are that there are some
> discrepencies between the class files which will shed some light on the bug.
Something similar happened to me before when compile on save was enabled, but I don't know how to reproduce. I don't rely on compile on save. No doubt it is a nice feature, but there are problems that sometimes are difficult to solve.
I can reproduce this problem pretty regularly. I have several J2SE (with existing source) Netbeans projects, P1, P2, P3. All projects have "Compile On Save" enabled.
Starting condition: Netbeans is up and running with P1 open.
1) Close P1.
2) Open P2. "Clean and Build Main Project"
3) Run project
I almost always see the "Uncompilable source code" error (see below for a sample stack trace). When I do an "rm -rf $HOME/.netbeans/7.1/var/cache/" Everything works from that point on....until I go to another project again.
I saved the "cache/" directory from the last time it happened, in case someone wants to look at it. I'm also going to attach messages.log (it has various exceptions - don't know if they're related).
Finally, I increased the priority to P2 given that it can happen so frequently and stops one from actually running ones application in the IDE.
17 Jan 2012 16:00:18 - java.util.concurrent.ExecutionException: java.lang.RuntimeException: Uncompilable source code
17 Jan 2012 16:00:18 - at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
17 Jan 2012 16:00:18 - at java.util.concurrent.FutureTask.get(FutureTask.java:83)
17 Jan 2012 16:00:18 - at javax.swing.SwingWorker.get(SwingWorker.java:582)
17 Jan 2012 16:00:18 - at com.netforensics.ui.login.ComponentConfigTask.done(ComponentConfigTask.java:72)
17 Jan 2012 16:00:18 - at javax.swing.SwingWorker$5.run(SwingWorker.java:717)
17 Jan 2012 16:00:18 - at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(SwingWorker.java:814)
17 Jan 2012 16:00:18 - at sun.swing.AccumulativeRunnable.run(AccumulativeRunnable.java:95)
17 Jan 2012 16:00:18 - at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(SwingWorker.java:824)
17 Jan 2012 16:00:18 - at javax.swing.Timer.fireActionPerformed(Timer.java:291)
17 Jan 2012 16:00:18 - at javax.swing.Timer$DoPostEvent.run(Timer.java:221)
17 Jan 2012 16:00:18 - at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
17 Jan 2012 16:00:18 - at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:677)
17 Jan 2012 16:00:18 - at java.awt.EventQueue.access$000(EventQueue.java:85)
17 Jan 2012 16:00:18 - at java.awt.EventQueue$1.run(EventQueue.java:638)
17 Jan 2012 16:00:18 - at java.awt.EventQueue$1.run(EventQueue.java:636)
17 Jan 2012 16:00:18 - at java.security.AccessController.doPrivileged(Native Method)
17 Jan 2012 16:00:18 - at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
17 Jan 2012 16:00:18 - at java.awt.EventQueue.dispatchEvent(EventQueue.java:647)
17 Jan 2012 16:00:18 - at com.netforensics.ui.NFEventQueue.dispatchEvent(NFEventQueue.java:27)
17 Jan 2012 16:00:18 - at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
17 Jan 2012 16:00:18 - at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
17 Jan 2012 16:00:18 - at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
17 Jan 2012 16:00:18 - at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
17 Jan 2012 16:00:18 - at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
17 Jan 2012 16:00:18 - at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
17 Jan 2012 16:00:18 - Caused by: java.lang.RuntimeException: Uncompilable source code
17 Jan 2012 16:00:18 - at com.netforensics.ui.login.ComponentConfigTask.doInBackground(ComponentConfigTask.java)
17 Jan 2012 16:00:18 - at javax.swing.SwingWorker$1.call(SwingWorker.java:277)
17 Jan 2012 16:00:18 - at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
17 Jan 2012 16:00:18 - at java.util.concurrent.FutureTask.run(FutureTask.java:138)
17 Jan 2012 16:00:18 - at javax.swing.SwingWorker.run(SwingWorker.java:316)
17 Jan 2012 16:00:18 - at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
17 Jan 2012 16:00:18 - at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
17 Jan 2012 16:00:18 - at java.lang.Thread.run(Thread.java:680)
BUILD SUCCESSFUL (total time: 1 minute 52 seconds)
*** Bug 201726 has been marked as a duplicate of this bug. ***
Hard to fix without a reproducible test case. Are you able to create a simple test case and attach it to the issue with exact steps to reproduce? Thanks.
I tried to create two mickey-mouse projects (with just a couple classes in each) to see if the problem could be reproduced, but I was unsuccessful.
But I'd be happy to give you any info you want from my environment - it's obviously not as good as first-hand experience, but with stack traces and messages.log and whatever else you can think to have me try, it should be possible to fix it, no? As I said - I can reproduce it pretty regularly.
(In reply to comment #38)
> Hard to fix without a reproducible test case. Are you able to create a simple
> test case and attach it to the issue with exact steps to reproduce? Thanks.
Question: if you guys can't fix this cache corruption issue because it's too hard to reproduce, would you consider providing an option from within Netbeans to automatically clear the cache when one moves from project to project?
As I said in an earlier comment, this "Uncompilable source code" runtime exception happens to me EVERY TIME I switch projects. It gets old quick to have to exit the IDE, do an "rm -rf cache" and then restart the IDE.
I never had this problem before when I used to have "Compile On Save" turned off. But then Netbeans doesn't always compile files that have inlined code from files that have changed :-( ....CoS doesn't suffer that issue, it seemed....but it has this one :-(
I believe the issue might have something to do with the size of the project. I've been using netbeans 6.91 for years now and the project has been gradually growing. I used to get this sort of cache corruption once in a while but now it happens every day.
I think trying to reproduce the issue with 2 small projects wont suffice. Try massive, inter-dependent projects and making constant changes between them. That should do it.... not sure how you want to create a test case with that.
Whoever is trying to fix this problem might be better off identifying the logs or specific files that might point to the issue when it occurs.
Closing and re-opening all projects fixed the problem in my case while anything else including deletion of cache index and re-starting the IDE did not. I would suggest NOT to do this because it removes the evidence which could otherwise be analysed with patches as supplied in bug 210053 for 7.1.
Analyzing the attached sig files, there is one thing common to them - the Uncompilable source code exception (which is added by Repair) is generated inside of synthetic Enum methods like valueOf(String) (added by Lower) or synthetic bridge methods (added by TransTypes). BUT Lower and TransTypes runs AFTER Repair, So, to reproduce the problem, the indexed source root has to be big enough to be processed via MultipassCompileWorker. Moreover, the memory low has to appear in time of indexing an enum or a class with bridge methods. Sig file (already containing synthetic method) has to be already generated when the class gets indexed again due to memory low. With that steps I'm finally able to reproduce the problem!
Woohoo! Nice work.
Fixed in jet-main.
verified in trunk
The fix seems fine to me.
Merged to release72:
Integrated into 'releases', will be available in build *201206212341* or newer. Wait for official and publicly available build.
User: Dusan Balek <email@example.com>
Log: Issues #182009, 207028, and 210053 fixed.
Integrated into 'main-golden', will be available in build *201206220002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Dusan Balek <firstname.lastname@example.org>
Log: Issues #182009, 207028, and 210053 fixed.
verified in 7.2
This problem is happening for me using NetBeans IDE 7.2 (Build 201207171143) running on Ubuntu 12.04.1 LTS and Java(TM) SE Runtime Environment (build 1.6.0_33-b04). I can't seem to find a "cache" directory to delete. Turning "compile on save" off fixes the issue. When I turn it on the issue comes back.
Could you please identify, which of the sig files located under the /var/cache/index subdirectory of your IDE userdir contains the 'Uncompilable source code' and attach it to the issue? Thanks.
Also make sure, that content of your caches is created with NB 7.2 (so make sure that you are not using NB 7.2 with an old userdir).
Created attachment 127341 [details]
SIG files that fail under 7.2
I think it is one of these. The method signature that is causing the "Uncompilable source code - is not abstract and does not override abstract method" was changed in the interface and the implementation. The error is complaining that the implementation does not implement the original signature. The error started yesterday after a clean-build. I've only ever used version 7.2 on this machine.