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.

Bug 184233 - [69cat] "Error parsing file" annotation on many java files
Summary: [69cat] "Error parsing file" annotation on many java files
Status: RESOLVED INCOMPLETE
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 8.2
Hardware: PC Windows 7
: P2 normal with 4 votes (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-15 08:50 UTC by _ hair
Modified: 2017-10-19 20:52 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
java files with "Error parsing file" (20.04 KB, image/png)
2010-04-15 08:51 UTC, _ hair
Details
package with "Contains files with errors" (18.70 KB, image/png)
2010-04-15 08:51 UTC, _ hair
Details
messages.log (1.44 MB, text/plain)
2010-04-15 08:57 UTC, _ hair
Details
messages.log related to comment #9 (423.52 KB, text/plain)
2010-04-22 10:11 UTC, _ hair
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ hair 2010-04-15 08:50:04 UTC
[ BUILD # : 49ed57cba68e ]
[ JDK VERSION : 1.6.* ]

After starting netbeans many java files in the Projects pane are annotated with
the red exclamation mark. See screenshot attached.
The description in the tooltip reads "Error parsing file". They are otherwise
compiling files and projects.

Opening the file in the editor shows no errors and soon the red annotation in
the Project pane disappears.
Opening the files seems the only way to remove the annotation badge.

Such annotations also appear on package nodes, see second screenshot, despite
there not being any files in the package with errors.
Comment 1 _ hair 2010-04-15 08:51:21 UTC
Created attachment 97416 [details]
java files with "Error parsing file"
Comment 2 _ hair 2010-04-15 08:51:58 UTC
Created attachment 97417 [details]
package with "Contains files with errors"
Comment 3 _ hair 2010-04-15 08:57:45 UTC
Created attachment 97418 [details]
messages.log
Comment 4 _ hair 2010-04-15 09:01:58 UTC
> Opening the file in the editor shows no errors
>  and soon the red annotation in the Project pane disappears.

In between the file opening in the editor and the red annotation in the Project pane disappearing is the "Scanning projects" task quickly running, when this task finishes the annotations promptly disappear.
Comment 5 Dusan Balek 2010-04-15 09:24:59 UTC
Could you please go to var/cache/index subdirectory of your userdir, open file 'segments' and find segment number (s?) that belongs to the source root annotated with the error mark. After that go to s? subdirectory that corresponds to the segment number found. There should be folder 'errors' in it. Could you please attach its content to this issue? Thanks.
Comment 6 _ hair 2010-04-15 09:39:32 UTC
$ cd ~/.netbeans/dev/var/cache/index/s25/errors/1

$ find . -type f
./no/finntech/service/advert/impl/AdQueryImpl.java.warn
./no/finntech/service/advert/impl/LocationQueryImpl.java.warn

$ cat ./no/finntech/service/advert/impl/AdQueryImpl.java.warn
WARNING:-1:AdQueryImpl.java uses unchecked or unsafe operations.
WARNING:-1:Recompile with -Xlint\dunchecked for details.

$ cat ./no/finntech/service/advert/impl/LocationQueryImpl.java.warn
WARNING:-1:LocationQueryImpl.java uses unchecked or unsafe operations.
WARNING:-1:Recompile with -Xlint\dunchecked for details.
Comment 7 Jan Lahoda 2010-04-15 13:17:19 UTC
(In reply to comment #6)
> $ cd ~/.netbeans/dev/var/cache/index/s25/errors/1
> 
> $ find . -type f
> ./no/finntech/service/advert/impl/AdQueryImpl.java.warn
> ./no/finntech/service/advert/impl/LocationQueryImpl.java.warn
> 
> $ cat ./no/finntech/service/advert/impl/AdQueryImpl.java.warn
> WARNING:-1:AdQueryImpl.java uses unchecked or unsafe operations.
> WARNING:-1:Recompile with -Xlint\dunchecked for details.
> 
> $ cat ./no/finntech/service/advert/impl/LocationQueryImpl.java.warn
> WARNING:-1:LocationQueryImpl.java uses unchecked or unsafe operations.
> WARNING:-1:Recompile with -Xlint\dunchecked for details.

Is this at the time the errors are shown in the projects tab? Could you please list all error and warning files in all var/cache/index (something like: find */errors/1 -type f) and cat any files that end with .err? Thanks.
Comment 8 _ hair 2010-04-15 18:22:55 UTC
For now (cause i opened all the erred files) i can only reproduce the package that's annotated as red with no red annotated files in it.
Here the only listing is 
./s692/errors/1/no/finntech/control/controller/realestate/HomesController.java.err
a file that no longer exists in the project.
Comment 9 _ hair 2010-04-22 10:09:32 UTC
I got it again with a brand new project group.
This time with file named BapDebugAction.java 


$cat s732/errors/1/no/finntech/actions/shop/BapDebugAction.java.err
ERROR:122:cannot find symbol\n  symbol\d   method sendExpiredFlexi(no.finntech.base.modules.organisation.support.OrganisationBean)\n  location\d interface no.finntech.base.modules.shop.ShopEmailService
ERROR:134:cannot find symbol\n  symbol\d   method sendFlexiAboutToExpire(no.finntech.base.modules.organisation.support.OrganisationBean)\n  location\d interface no.finntech.base.modules.shop.ShopEmailService

Opening the file in the editor showed no such error and soon (after a quick "scanning projects" task ran) the badge in the explorer disappeared.




And still with the "no.finntech.control.controller.realestate" package.
Here there exists a 
var/cache/index/s692/errors/1/no/finntech/control/controller/realestate/HomesController.java.err

but this java file has over a week been removed from the project.

Highlight from messages.log:

WARNING [org.netbeans.modules.java.source.tasklist.IncorrectErrorBadges]: Incorrect error badges detected, file=/usr/local/src/finn-src/iad-trunk-clean/actions/src/main/java/no/finntech/actions/shop/BapDebugAction.java.
WARNING [org.netbeans.modules.java.source.tasklist.IncorrectErrorBadges]: Going to recompute root=/usr/local/src/finn-src/iad-trunk-clean/actions/src/main/java, files in error=[file:/usr/local/src/finn-src/iad-trunk-clean/actions/src/main/java/no/finntech/actions/shop/BapDebugAction.java].

but nothing interesting from the "-Dorg.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.level=FINE" logger.
I've attached this same messages.log
Comment 10 _ hair 2010-04-22 10:11:47 UTC
Created attachment 97845 [details]
messages.log related to comment #9
Comment 11 it0243 2010-11-18 12:05:19 UTC
(In reply to comment #10)
> Created an attachment (id=97845) [details]
> related to comment #9  ( http://netbeans.org/bugzilla/show_bug.cgi?id=184233#c9
> )

I experienced the same problem. I resolved it by temporarily recreating the missing file (based on the corresponding .err file found by a global search for .err files in my var/cache/index subdirectory of myuserdir complaining for a file missing within the problematic package) and deleting it again. The error annotation disappeared then.
Comment 12 puce 2010-12-18 01:09:05 UTC
I also have a similar problem, but the red file annotation does not disappear when I open or re-save the file.

NetBeans 6.9.1
Java SE 6
Maven 2.2.1
Mercurial
Comment 13 puce 2010-12-18 01:12:14 UTC
I set the priority to P2 as this is a major distraction/ misinformation if my source code is OK or not.
Comment 14 Jan Lahoda 2011-01-10 12:17:58 UTC
I have found a problem related to excludes on sourcepath (bug #194174) and there are some known problems related to maven projects (bug #188323). Unfortunately without specific steps to reproduce it is impossible to say if the problem described here are related to any of these bugs and without such steps to reproduce it is virtually impossible to fix them. If anybody could provide specific steps how to reproduce, it would be most welcome. I was testing what seemed suspicious to me, but only outcome was #194174, in which case the error badges are corrected on next IDE restart, and so it does not seem to be related to problems described here. Thanks.
Comment 15 aherzog 2011-09-16 12:18:11 UTC
I had similar error: in the project pane only the project itself had a red error flag saying "Contains files with errors", but in the files pane almost all source files had an error flag. If you opened the source files from here inside it said that the import packages are not found (even so the classpath to the libraries is set correctly).

In my case the problem was, that there were two possible path to the project: one through the real path to the project folder and a second one through a symlink (which I created to access the folder faster). While the project was set up on the real path, the path to the source folders was defined via the symlinked path.

After deleting the symlink and reassigning the path to the source folder the error disappeared.
Comment 16 waynebeast 2013-09-24 15:42:28 UTC
I just encountered the same problem with version 7.3.1. Everything is fine until Netbeans runs a "scanning files" operation, which is then interrupted by "low memory" error. After that, Netbeans begin to have trouble parsing one of the files.
Comment 17 Svata Dedic 2013-09-25 11:13:31 UTC
The conditions you've described (OOM followed by parsing problems) seems to be different from those reported earlier. Please open a separate defect. There are also other issues regarding to incorrect 'error' badge (e.g. issues #214630, #170190, #219204, #233933), but those do not report preceding OOM, which may twist things.

Reverting the target milestone and status; please file a separate report for the unique scenario. Thanks.