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.
With Netbeans 4.1, I'm having an issue where the various features of the IDE that should be able to resolve classnames for me fail to see some classes in some JARs. e.g, If I hit shift-alt-f to "FIX Imports" OR if I hit shift-alt-i to "Import class" OR if I open a new Java file and type "import org." then hit control-space. Some of the classes that should be in the dropdown are not. Steps to reproduce: 1. Download Apache Commons Logging from apache.org. Get version 1.0.4, I happened to use the Zip file distribution. 2. Unzip the distribution, notice there are 2 jars at the top level: commons-logging.jar and commons-logging-api.jar 3. Create a New Java application project (native, not Ant style) 4. Add commons-logging-api.jar to the project's classpath (either by adding the JAR directly or by creating a library containing it and adding that - it doesn't matter) 5. Try to complete anything from the org.apache.commons package (eg, type import org.apache. into a Java file and hit ctrl-space) -> nothing appears. Fix Imports cannot find the Log or LogFactory classes from this package either. 6. Remove commons-logging-api.jar from the project classpath and add commons-logging.jar instead 7. Notice the autocomplete now works correctly. 8. Open both jars, see they have the same classes and roughly similar manifests 9. Look in the IDE log file, see absolutely no reports of any problems Something is definitely wrong. I'm also having the same problem with local copies of Apache Commons Collections and an old version of Doug Lea's conncurrent.jar we have here. There are probably a lot more things missing. This is particularly annoying because it makes Fix Imports next to useless, because Fix Imports will *remove* the import statements for Apache Commons Logging from files were I have entered them manually. If I can try 4 random JARs and have 3 failures, this must be a pretty widespread problem (unless I'm incredibly unlucky).
Does not seem to be a classpath problem. Does the compiler resolve the classes during build when having the commons-logging-api.jar on the classpath?
Yes. Everything compiles just fine. The problem is with all of the "Fix Imports", Autocomplete and code helper functionality exposes by the editor. Clearly, if the compiler can see the classes, these tools should be able to see them too.
It seems a problem of javacore, the classpath is correct the project compiles, but for sure can you attach the project.properties and private.properties files?
Created attachment 23953 [details] project.properties from sample project
Created attachment 23954 [details] private.properties from sample project
Can you reproduce it in latest 5.0 build? We cannot reproduce it.
Confirmed. The same project migrated to 5.0 appears to work fine. Can you reproduce it in 4.X? I think it would be better if you understood what caused the problem, otherwise it may come back to haunt us unexpectedly.
Scratch that last comment. As of this afternoon, this is now severely broken on 5.0 also. I don't know what I might have done today that caused it to stop working, but it has... it's back to almost the same behaviour as in 4.X - can't find EasyMock or Spring classes, but for some reason it can find log4j now. Which leads me to suspect that somehow some index is getting corrupted...?
I'm sorry I cannot reproduce it. Completion works for me with both commons-logging-api.jar and commons-logging.jar. There are not any classes named Spring or EasyMock.
Right now I can't reproduce it either. Since I upgraded to the 5.0 beta I've only seen this happen once and restarting the IDE fixed it. I'm actually reasonably convinced there's some kind of subtle problem buried here, but I also don't have a reproducable case to give you. So it's hard to say what to do next.
Created attachment 27698 [details] Screenshot of the problem occuring
I'm still hitting this problem daily, and I can't figure out why. Now it's happening with Apache commons chains, as you will see from the screenshot. (http://www.netbeans.org/nonav/issues/showattachment.cgi/27698/MissingItems.png) The code in the file compiles fine - the Chains libraries are on the classpath, but the IDE resolutely refuses to acknowledge the existance of the org.apache.commons.chain package in code completion and FIX imports. Is there a particular cache I could clear to see if it helps with this issue?
I've got the same problem with NB5.0rc2 and now with NB5.0 under Windows XP. I added HtmlUnit library to my project (with sources and javadocs) and IDE doesn't see classes (packages etc.) that belong to some jars from this library. When I had removed sources and javadocs, the NB started "jar scan" and now everything seems to be fine. If I manage to isolate this problem, I'll write again.
Javacore module was replaced by Retouche infrastructure. This bug is not valid in trunk any more.
Reorganization of java component