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.
This is an intermittent issue and I haven't figured out how to reproduce yet. Netbeans will sometimes give me an "Uncompilable source code - Erroneous sym type" error then there is no error. All of the code compiles just fine. Sometimes when this happens I can just touch (add a space to the end of a line) the file in question and save - then the problem goes away. However, sometimes it is much more persistent .. occasionally the only solution I've found is to exit, come back up in 7.0 Beta, run in 7.0 Beta, save, exit, then come back up in 7.0 Release. In 7.0 Beta I used to get files that just didn't compile (without touching, as above), and files with no errors that showed an error badge (touching would usually fix). That was annoying, but simpler to solve than this issue. Sorry I don't have more details on how to reproduce ... it just happens sometimes.
This still happens to me also, it happened in 7.0 and still happens in 7.0.1. I'm not sure the compiler is the component responsible for the bug, because the project compiles correctly and the exception shows up at runtime. I add that running the jar from the command line works as expected and no exception is thrown.
From the nbusers mailing list I got the following hint: "workaround it by deselecting 'Compile On Save' in the project options". It actually works. I felt like changing the product for this bug report because I think "java" is not really responsible for this, while the ide is. Consequently I choose "Import settings" as component, but that's only a guess. Feel free to switch that back to "java/compiler" if I misunderstood the meaning of the "product" field.
Hard to fix without a reproducible test case. The workaround is to switch the Compile-On-Save off in project's properties.
I submitted the same issue I think, see 206266. I just attached an application to reproduce the problem.
This error just hit me. Switching off compile in save is a workaround but creates a PITA too. Product Version: NetBeans IDE 7.1 (Build 201112071828) Java: 1.7.0; Java HotSpot(TM) 64-Bit Server VM 21.0-b17 System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb) I have a maven web app which uses Morphia (MongoDB). It was when I created a test using a Query<Entity> that Netbeans fell over.
Have a look at issue 210053 - there are some clues and patches that may help diagnosis. I could not reproduce it :(
WHEN I HAD AN ISSUE WITH UPPERCASE & LOWERCASE PACKAGE NAMES, THIS ERROR HAPPENED, I TRIED DISABLING COMPILE ON SAVE AND IT STILL THERE, WHAT WORKED TO ME WAS A CLEAN AND BUILD, HOPE IT HELPS
After reading comment #8 I briefly looked at the calendar: «No, it's not april fools'...»
since I switched to 7.2 I have this problem to. so netbeans 'corrupts' the classfiles and my 'run' from the command line fails at runtime (also in classes I did not change!)
Today we installed NB7.2 and created a new project with compile on save enabled. Source code was already there and has been imported into this project. Suddenly we got "erroneous type" messages too. Disabling compile on save, clearing file history and index cache then restarting NB solved it.
I have the same bug. Clearing the netbeans cache helps for a while. Then I get the "Uncompilable source code - Erroneous ctor sym type" exception when running my application. After clearing the cache again it works again for a while.
I have the same issue with 7.3 dev now, very often. I originally filed issue 210053. I have tried many times to make a reproducible test case but it became clear that it is impossible to do. So while this hasn't been fixed or cannot be fixed, where is plan B? We cannot consider the clearing of the cache manually. Would it be possible to create an IDE action to clean up a project without having to shut down? Or is there a way that the IDE can diagnose such events?
The following scenario can cause this error on a large scale: In a J2EE project dependent on glassfish-3.1.2.2, I upgraded the EclipseLink persistence provider with the latest version as follows: - Stop GlassFish - remove the following files from C:\Program Files\glassfish-3.1.2.2\glassfish\modules javax.persistence.jar org.eclipse.persistence.oracle.jar org.eclipse.persistence.antlr.jar org.eclipse.persistence.asm.jar org.eclipse.persistence.core.jar org.eclipse.persistence.jpa.jar org.eclipse.persistence.jpa.modelgen.jar org.eclipse.persistence.moxy.jar - copy new files from eclipselink-plugins-2.4.0.v20120608-r11652.zip javax.persistence_2.0.4.v201112161009.jar org.eclipse.persistence.oracle_2.4.0.v20120608-r11652.jar org.eclipse.persistence.antlr_3.2.0.v201206041011.jar org.eclipse.persistence.asm_3.3.1.v201206041142.jar org.eclipse.persistence.core_2.4.0.v20120608-r11652.jar org.eclipse.persistence.jpa.jpql_2.0.0.v20120608-r11652.jar org.eclipse.persistence.jpa.modelgen_2.4.0.v20120608-r11652.jar org.eclipse.persistence.jpa.osgi_2.4.0.v20120608-r11652.jar org.eclipse.persistence.jpa_2.4.0.v20120608-r11652.jar org.eclipse.persistence.jpars_2.4.0.v20120608-r11652.jar org.eclipse.persistence.moxy_2.4.0.v20120608-r11652.jar - Start GlassFish GlassFish does not care about the names of the files. Meanwhile, all projects depending on GlassFish break because the file javax.persistence.jar is missing. The file javax.persistence_2.0.4.v201112161009.jar just needs to be renamed. The IDE appears to recompile files that depend on javax.persistence.jar e.g. import javax.persistence.EntityManager; , and in my case it put "uncompilable sourcecode" in the constructor of many files that I did not touch at all. It did not help that I later renamed javax.persistence_2.0.4.v201112161009.jar to javax.persistence.jar and the project did not have any errors. It just failed when running the tests. The affected files were all JUnit test files in the project's test directory. It would not surprise me if I did not change a single line of Java code to create these errors.
Thanks for the description. I have found a bug where a timestamp is not cleared from the cache after a jar is deleted - if a jar (re-)appears at the same place with the same timestamp, it is not reindexed again. Is there a chance this would match your usecase? Thanks.
Jan, This looks close. But the jars have different timestamps. The new version has a later date: 24 May 2012, 7:20:44 a.m. vs Sunday, 15 July 2012, 3:38:08 p.m. and the sizes are different.
I get the same error when put compile on save off it seem to be running fine. Using Netbean 7.2
Integrated into 'main-golden', will be available in build *201211220002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/c3a8525b2847 User: Jan Lahoda <jlahoda@netbeans.org> Log: #199293: when a jar file is deleted, its timestamp must be forgotten as well, so that is the file re-appears with the same timestamp, it is processed again.
The above changeset fixes the problem with jar disappearing and appearing with the same timestamp. For possible other problems, I am afraid that some pointers on how to reproduce are needed.
How to reproduce: - Install NetBeans including GlassFish - Run NetBeans in a separate userdir - Start NetBeans in separate userdir - do not import settings - Menu|Tools|Options|Miscellaneous|Files|Uncheck "Enable auto-scanning of sources" - Open the attached project "Cache" - In the services window, start Java DB and ensure that the sample database exists: jdbc:derby://localhost:1527/sample - Run the test CustomerSessionTest.java (should succeed) - In the GlassFish installation dir C:\Program Files\glassfish-3.1.2.2\glassfish\modules, rename javax.persistence.jar to javax.persistence.hide.jar - Menu|Source|Scan for external changes and wait for the project to break because of missing javax.persistence.jar - Rename javax.persistence.hide.jar back to javax.persistence.jar - Menu|Source|Scan for external changes and wait for the project to fix itself - Run the test CustomerSessionTest.java (should succeed) Result: Testcase: ejb.session.CustomerSessionTest: Caused an ERROR Uncompilable source code - Erroneous ctor sym type: <any> java.lang.RuntimeException: Uncompilable source code - Erroneous ctor sym type: <any> at ejb.session.CustomerSessionTest.setUpClass(CustomerSessionTest.java:31)
Created attachment 128696 [details] Test case in zip file
Thank you very much - reproducible.
I have had a different, very common scenario that produces the same result: Incorrect error badges detected after Exception in Log. Happened after I had deleted an overriding method in a session bean that implements a local interface. Subsequently I fixed the resulting error of not implementing that method by deleting the method in the interface. Then the session bean java file kept the old error badge and the IDE warned me of errors in the project when I tried to run a junit test for a single session bean method. I had to wait a long time because in log WARNING [org.netbeans.modules.java.source.tasklist.IncorrectErrorBadges]: Going to recompute root= Finally afer a long time, the error badge disappeared from the session bean. But when I tried to run the junit test then there was an ExceptionInInitializerError in setUpClass() which was caused by uncompilable source code in the session bean that had the wrong error badge. I have saved all the data from this scenario so please ask if you need it.
Integrated into 'main-golden', will be available in build *201301030001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/394c4cf7bf07 User: Jan Lahoda <jlahoda@netbeans.org> Log: #199293: reporting a synthetic error when invoking a resolvable constructor with erroneous type, unless it can be expected an error was already reported. Needed to handle introduction of a new type that fixes the constructor, but does not recompile the usages of the constructor.
The test case from comment#20 should be fixed by the above changeset. The test case from comment#23 is hopefully fixed by: http://hg.netbeans.org/main-silver/rev/2616124d1342 Before testing please clear $CACHE_DIR/index, so that old broken data do not affect the testing. Thanks.
Integrated into 'main-golden', will be available in build *201301050001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/2616124d1342 User: Jan Lahoda <jlahoda@netbeans.org> Log: #199293: the behavior of 'find subclasses' depends on the given ElementHandle's ElementKind - indexing needs to use OTHER when unsure (otherwise e.g. subtypes of an interfaces would not be found, leading to false compile errors)
I had the problem with a maven project in 7.4dev as well: Product Version: NetBeans IDE Dev (Build 201307262300) Java: 1.7.0_25; Java HotSpot(TM) 64-Bit Server VM 23.25-b01 Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b15 I fixed it by "clean and build" after searching quite some time for an error that was not there...