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 250222 - Hint says package does not exist even when maven project compiles without errors
Summary: Hint says package does not exist even when maven project compiles without errors
Status: RESOLVED INCOMPLETE
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-04 21:45 UTC by bht
Modified: 2015-02-27 16:59 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
messages.log (491.06 KB, application/octet-stream)
2015-02-04 21:45 UTC, bht
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bht 2015-02-04 21:45:04 UTC
Created attachment 151823 [details]
messages.log

It appears the IDE cache or whatever relevant data gets corrupted with a maven project that compiles fine.

In this case (I had others with the same project and other projects), the declared junit test dependency is ignored:

red hint on import statement: "package org.junit does not exist"

There are errors in the log file:

INFO [org.netbeans.api.java.source.ElementHandle]: Resolved type is null for kind = CLASS
INFO [org.netbeans.api.java.source.ElementHandle]: Cannot resolve: ElementHandle[kind=CLASS; sigs=junit.framework.Assert ]
INFO [org.netbeans.api.java.source.ElementHandle]: Resolved type is null for kind = CLASS
INFO [org.netbeans.api.java.source.ElementHandle]: Cannot resolve: ElementHandle[kind=CLASS; sigs=org.junit.Assert ]
INFO [org.netbeans.api.java.source.ElementHandle]: Resolved type is null for kind = CLASS
INFO [org.netbeans.api.java.source.ElementHandle]: Cannot resolve: ElementHandle[kind=CLASS; sigs=junit.framework.TestCase ]
INFO [org.netbeans.api.java.source.ElementHandle]: Resolved type is null for kind = CLASS
INFO [org.netbeans.api.java.source.ElementHandle]: Cannot resolve: ElementHandle[kind=CLASS; sigs=junit.framework.Assert ]
INFO [org.netbeans.api.java.source.ElementHandle]: Resolved type is null for kind = CLASS
INFO [org.netbeans.api.java.source.ElementHandle]: Cannot resolve: ElementHandle[kind=CLASS; sigs=org.junit.Assert ]
INFO [org.netbeans.api.java.source.ElementHandle]: Resolved type is null for kind = CLASS
INFO [org.netbeans.api.java.source.ElementHandle]: Cannot resolve: ElementHandle[kind=CLASS; sigs=junit.framework.TestCase ]
INFO [org.netbeans.modules.java.editor.imports.ComputeImports]: Cannot resolve type element "ElementHandle[kind=INTERFACE; sigs=junit.framework.Test ]".
INFO [org.netbeans.modules.java.editor.imports.ComputeImports]: Cannot resolve type element "ElementHandle[kind=ANNOTATION_TYPE; sigs=org.junit.Test ]".
INFO [org.netbeans.modules.java.editor.imports.ComputeImports]: Cannot resolve type element "ElementHandle[kind=ANNOTATION_TYPE; sigs=org.junit.BeforeClass ]".
INFO [org.netbeans.api.java.source.ElementHandle]: Resolved type is null for kind = CLASS
INFO [org.netbeans.api.java.source.ElementHandle]: Cannot resolve: ElementHandle[kind=CLASS; sigs=junit.framework.Assert ]
INFO [org.netbeans.api.java.source.ElementHandle]: Resolved type is null for kind = CLASS


Prior to this, I had a network connection problem and the build failed because of it, but that was resolved.

I would expect that the IDE can recover from this, or that I could use an action to initiate recovery.

I tried menu action "Reload POM", "Clean and build". I closed and re-opened the project. No improvement.

I am fairly confident that I can fix this by closing NetBeans and deleting the NetBeans cache, but NetBeans engineers have previously advised that this would be too radical an action and I agree, because it takes too long for the IDE to get back into a responsive state. I have seen it re-loading maven indexes from the web and so on, where it took an hour until the IDE became responsive again.


I am very frustrated about this as I have seen this issue for years.
Comment 1 Tomas Zezula 2015-02-05 09:57:41 UTC
Please can you try it with dev build.
In the dev build the Navigator has a view Classpath containing the file classpath.
Can you paste the classpath in the issue.
Thanks
Comment 2 Tomas Stupka 2015-02-27 16:59:39 UTC
any updates on this?