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 256699 - Netbeans shows incorrectly, that classes are missing
Summary: Netbeans shows incorrectly, that classes are missing
Status: RESOLVED INCOMPLETE
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-19 19:36 UTC by ralphlevan
Modified: 2016-11-10 10:46 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ralphlevan 2015-11-19 19:36:40 UTC
Whenever I have a project with libraries in another project and I rebuild that other project, my current project reports those classes as missing.  Compiles go just fine, but the editor insists they are missing and won't do any code completion for those classes.

Specifically, my current project uses a jar from the dist directory of the other project.

Removing the jar from the project and then readding it does not cause the editor to discover its mistake.

This has been going on for years and I could have sworn I reported it before, but I see no signs of it.
Comment 1 Jiri Prox 2015-11-20 16:39:10 UTC
What types of project do you use?
How did you add the dependency on the library project? (as a project, or directly as a jar)
Comment 2 ralphlevan 2015-12-11 20:35:46 UTC
I have a theory.

I run some tomcat services.  Sometimes, when I replace a jar on a running tomcat and that tomcat later tries to load a class from that jar, it throws a class not found exception.  My theory is that some lower class for handling jars caches a map of the jar and then closes the jar file. (We know it must close the jar, because my tomcat runs in a Unix environment and the original file would still around if the tomcat still had it open and it wouldn't see my change.) Later, when it needs something new out of the jar it reopens the file, but uses the cached map.  If there's a discrepancy, it throws the exception.

I think the same thing is happening here.  To test that, I rebuilt the jar that is used in so many of my other projects and then immediately restarted the IDE.  None of the other projects have complained.

If this is true, then the solution will require that the editor flush/close the cached jar object.
Comment 3 ralphlevan 2015-12-11 20:38:15 UTC
(In reply to Jiri Prox from comment #1)
> What types of project do you use?
> How did you add the dependency on the library project? (as a project, or
> directly as a jar)

Sorry, I replied to the email, but I see it didn't make it into the bug report.

These are standard NetBeans Ant builds with the jars manually (right-click, add jar) to the projects.
Comment 4 Svata Dedic 2016-08-12 13:03:51 UTC
java issue
Comment 5 Svata Dedic 2016-11-10 10:46:22 UTC
Could you recreate a simple project setup to demonstrate the issue ?