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.
I'm using Windows 2000 on a Pentium 4 box with 1 GB RAM. I created a new free-form project using NetBeans 4.1 EA 2. The free-form project was "Java Project with Existing Ant Script." When I installed EA 2, I updated the netbeans.conf file to use the JDK that ships with the version of WebLogic we're using: netbeans_jdkhome="C:\bea\jdk142_04" In EA 2, under Java Platform Manager, there's the Default (which is the above) and I also added the above as a platform. Everything was working as expected. I recently upgraded to NetBeans 4.1 Final. I also set the netbeans.conf file to point to the WebLogic JDK listed above, same as EA2. I opened the aforementioned free-form project using 4.1 Final. Now, if I try to use code completion on standard Java classes like List, Iterator, String, etc., the code completion pop-up looks like it can't find the classes and thus shows no hints. Additionally, if I Ctrl+Shift+F to Fix Imports, all of the existing java.* imports are removed, and a message box appears with the following text: No imports found for the following types: - String - List - Iterator etc etc. What's going on?? I re-opened the exact same project again in EA 2 and code completion works as expected. I can't get much of any productive work done without code completion for Java classes. It must be something with 4.1 Final, because the project opened in EA2 has code completion working. The only difference is that I didn't add the WebLogic JDK to the Java Platform Manager in 4.1 final, but this shouldn't matter since free-form projects can have the target platform set (right?). Is there something I'm missing here? Please help! I don't want to succumb to my co-workers and use Eclipse! BTW: Keep up the great work!
Well, I worked around it. I blew away the old project directory and created the free-form project from scratch, bringing in the existing sources. That seemed to fix the problem. Still not sure what happened, but at least code completion works again.
The same problem is occurring again. It was fixed after I re-created the project but now it's back. What might have caused it is I did a Fix Imports within a class and it removed all of the existing java.* imports, and popped up the "No imports found for the following types" window described earlier. I don't know if Fix Imports caused the problem but that's when I first noticed it again.
Another hint: If I type the following in a Java file: "".<Ctrl+Space> The popup code completion window, the only thing in it is: java.lang.String.* The java file doesn't have an explicit import for java.lang or java.lang.String. So, it must know that it's a String, but for some reason it can't find the available methods. The problem appears to go away if I re-create the project from scratch, but that gets old rather quickly as the problem eventually reappears.
I've deleted and re-created the project from scratch but everything remains the same: fix import doesn't find classes, import errors not found, mehtod not found... have I got to return to 4.0? I think it's better
Hello, could you please go to Tools/Java Platform Manager and check whether there are some invalid (shown in red) platforms? If so, could you please try to remove them?
I looked under the Platform Manager and there don't appear to be any invalid platforms. There two platforms listed. The first one is "JDK 1.4 (Default)", which points to C:\bea\jdk142_04. I'm guessing this is the one that comes from the netbeans.conf file, which I edited to this jdk. The second platform is one I manually added, which also points to C:\bea\jdk142_04. I think I added this one *after* the code completion problems started to arise in a failed attempt to fix the problem. I'll try deleting it but unless you hear from me, assume it didn't work. Thanks for looking into this!
no invalid platform but switching the default platform from 1.5_02 to 1.5_03 solved the problem for the moment... I hope it will not reappears
sigh the bug reappears, I think (but I'm not sure) after Reformat Code
Same thing here! BTW I've also tested with NB 4.2 daily build 20050519 and the bug is still there!
Same problem here.. NB 4.1 on Windows 2K/Linux Debian.
Code completion Netbeans 4.1 on Linux works fine until I add jars to the classpath. [org.netbeans.javacore] INFORMATIONAL *********** Exception occurred *********** * at 1:29 PM on May 26, 2005 org.netbeans.lib.java.parser.CompilerException: Fatal Error: Unable to find pack age java.lang in classpath or bootclasspath at org.netbeans.lib.gjast.ASErrorChecker.parse(ASErrorChecker.java:59) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl$ErrorLis t.initCheck(ResourceImpl.java:1428) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl$ErrorLis t.size(ResourceImpl.java:1440) at org.netbeans.modules.java.JavaEditor.refreshAnnotations(JavaEditor.ja va:389) at org.netbeans.modules.java.JavaEditor.access$300(JavaEditor.java:83) at org.netbeans.modules.java.JavaEditor$2.run(JavaEditor.java:248) at org.openide.util.Task.run(Task.java:189) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:330) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java :721) Caused by: com.sun.tools.javac.util.FatalError: Fatal Error: Unable to find pack age java.lang in classpath or bootclasspath at com.sun.tools.javac.comp.MemberEnter.importAll(MemberEnter.java:120) at com.sun.tools.javac.comp.MemberEnter.visitTopLevel(MemberEnter.java:5 03) at com.sun.tools.javac.tree.Tree$TopLevel.accept(Tree.java:390) at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:383 ) at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:777) at com.sun.tools.javac.code.Symbol.complete(Symbol.java:355) at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:614) at com.sun.tools.javac.comp.Enter.complete(Enter.java:448) at com.sun.tools.javac.comp.Enter.main(Enter.java:426) at org.netbeans.lib.gjast.ASErrorChecker.compile(ASErrorChecker.java:173 ) at org.netbeans.lib.gjast.ASErrorChecker.parse(ASErrorChecker.java:56) [catch] ... 8 more Is the stacktrace in message.log I tried a few times and it occurres on the same moment. Freeform project before adding jars to the classpath code completion works, after adding jars to the classpath it won't work any more. Hope it helps Johan
Java/freeform is better location for this issue.
I am noticing the same error. Has the NB team been able to reproduce this issue? thanks..
*** Issue 59397 has been marked as a duplicate of this issue. ***
To roguexz: Unfortunately I'm not able to reproduce the issue. To all involved: Please take a look into your Platform manager and verify that all your plarforms conforming the source level of your freeform project are properly installed and nothing is missing from their cp, especially rt.jar. Also please verify that you don't have any broken or missing platforms. If anybody has a reproducible test case how to reproduce this issue starting from clean userdir please provide it. Thanks for help.
Hi, Well, I have checked my platform manager and there are no RED colored entries.. No missing entries. Everything looks fine. The very fact that this problem is intermittent and that it comes up after usage of the free form project for a while, indicates that the issue is not with the Platforms, since if it was a problem, then the code completion would not have worked right from the beginning. I am unable to decipher much from the exception stack trace.. Sigh! I guess, i will have to dig into the code and figure out what is going wrong. For a usecase: 1. You could try creating a free-form project. 2. Add a few random classes. 3. Then add a couple of external jars 4. Add a couple of more random classes which make references to methods in the external jars. 5. (Hopefully by now the issue should have come up) Hit "Fix Imports" and voila, you should be able to see the problem that we are facing. thanks, Rogue
The messages.log file on my Win2000 box shows the same error dump as the one in jcstover's May 26 entry, so it's common among OS platforms. My platform manager shows no entries in error. I think I've tried clearing the userdir previously and it didn't help, although recreating the project *did* clear the problem, only to have it return again at some point. I never had this problem with EA 2, which I used extensively, so did maybe something change between EA 2 and Final that may be causing the problem? It doesn't seem to be a problem with the selected Java platform since a bunch of us are seeing it.
Hello, I would like to ask somebody who is able to reproduce the problem to put the two attached jar files (org-netbeans-modules-java-editor.jar and org-netbeans-modules-java-freeform.jar) into $NBINSTALL_DIR/ide5/modules and reproduce the problem. In the log/console, there should be debug messages (part A printed during opening each freeform project, part B when the Fix All Import action is performed). I would like to ask you to attach these debug messages to this bug. Thank you very much.
Created attachment 22401 [details] Java editor module with debug logs.
Created attachment 22402 [details] Java freeform module with debug logs.
I forgot to mention: the modules are against the daily builds, no against 4.1. Sorry. The debug messages are in ${userdir}/var/log/messages.log and in the console.
Created attachment 22403 [details] Java editor module with debugs for release 4.1.
Created attachment 22404 [details] Java freeform module with debug logs for release 4.1
I have attached also org-netbeans-modules-java-editor.jar and org-netbeans-modules-java-freeform.jar for release 4.1. Please backup original files before replacing them.
Created attachment 22405 [details] Requested messages.log file for debugging (renamed to asleson_messages.log)
I shut down my NB 4.1 final and installed the appropriate module jar files. I emptied messages.log and reopened NetBeans. For some reason the problem seemed to go away, at least for now, but I still attached the messages.log file so you can take a look. When the problem shows up again I'll do another dump of the messages.log file. In the mean time, can somebody else who has been experiencing the problem please do the same and send in their messages.log file so we can get this tracked down and fixed ASAP? Since I didn't experience the problem at restart the log file may not contain the info needed to fix. Thanks!
Thanks asleson. I was able to reproduce the problem using a web freeform project. I am able to reproduce it if I have a jar file in WEB-INF/lib. I am attaching an example web project. Steps to reproduce: 1. Download the attached project, unpack it somewhere. 2. Open the project in the IDE. 3. Open file src-utils/org/test/utils/TimeProvider.java 4. Perform Fix All Imports in this file. Reassigning to web/freeform for further evaluation.
Created attachment 22406 [details] Example project.
Created attachment 22409 [details] Messages.log
Reassigning back. Web extension to freeform doesn't do anything which could affect the code completion in java files. I discussed this issue with Tomas Z. and Petr P. and they have the same opinion.
I did some debugging and it seems that the problem is that org.netbeans.modules.web.freeform.WebModules under some circumstances(1) returns a classpath (which seems to be a source classpath) regardless of the required classpath type (ie. even for ClassPath.BOOT). I think this is not correct: the WebModules should return the source classpath only for ClassPath.SOURCE type, and null for all other types. Notes: (1):see steps to reproduce Is there anybody who can reproduce the problem with plain java freeform (not web freeform) project? In such a case, would it be possible to attach packed content of the ${projectdir}/nbproject directory? Thanks.
I've tried but I've been unable to reproduce with a regular Java free-form project. Sorry. I'm glad to see this will be fixed soon. I see it's marked as being targeted for 4.2. Once it's fixed (and I hope it's soon!), can you please provide a patch for 4.1 final, since 4.2 is still a ways out on the horizon? I use several Web free-form projects and not having code completion makes things quite difficult. Thank you!!!
Oops, sorry, the confirmation email said I changed Platform, OS, and Target milestone. I didn't intend to. I changed them back to All, All, and 4.2, respectively.
Isn't issue #58408 related to this one?
Issue #58408 sure looks the same to me. jlahoda, maybe this is the "regular" java free-form test case you're looking for?
Created attachment 22520 [details] Binary patch that may solve the problem.
Hello, could you please download attached patch (59031.jar), place it into directory: ${NETBEANS_INSTALLDIR}/enterprise1/modules/patches/org-netbeans-modules-web-freeform and test whether it helps with this problem? Thanks.
jlahoda, is there some way I can install this binary patch on my 4.1 Final installation? If so I'd be happy to do so ASAP and let you know how it works. Just let me know!
I did the following: 1. Tested my app to ensure the code completion problem was still there. It was. 2. Closed NetBeans. 3. Installed the binary patch, 59031.jar, in ${NETBEANS_INSTALLDIR}/enterprise1/modules/patches/org-netbeans-modules-web-freeform 4. Restarted NetBeans. 5. Repeated the simple test done in step #1. Code completion for the java.lang.String class, at least, was now working. So, it looks like this may have fixed the problem. Thank you!!! I'll let you know if there are more problems, like when I use Fix Imports.
The patch causes a problem. In the "Projects" pane of my free-form Web project, when I go to the directory that has my JSPs and expand the directory, none of the JSPs appear in the tree. They didn't appear in the "Files" view either. I deleted the patches directory inside ${NETBEANS_INSTALLDIR}/enterprise1/modules (which of course also delete the binary patch file), restarted NetBeans, and now the JSPs appear in the Projects pane again like they're supposed to. So the problem is almost surely related to the patch. I'm happy to try out any other patches when they're available.
*** Issue 59057 has been marked as a duplicate of this issue. ***
Created attachment 22526 [details] Refined possible binary patch.
works for me. I installed it reopened NetBeans the jsp's show the java code completes the imports are getting fixed I guess it is time for a beer now! THX a lot
The refined binary patch appears to work for me too. JSPs show, code completion works, and Fix Imports appears to work. I'll update this issue if anything appears broken. Thank you!!!
Passing to web/freeform as it seems that (at least one) problem is there. I will attach source patch against release 4.1 that seems to fix the problem (thanks asleson and loki for testing). If there is any reproducible case with plain java/freeform project, please file a new bug against java/freeform.
Created attachment 22532 [details] Source patch against web module, release 4.1.
Thanks for the patch. I'll look at it.
*** Issue 59912 has been marked as a duplicate of this issue. ***
WOW, 9 duplicates (users complaining) - it seems to be good candidate for HotFix.
Its not over yet. :) I installed the binary patch jar as required and for the most part it worked. That is until I started using code that required org.jdom.Element. Since the class Element is ambiguous throughout java when I tried to do a fix imports I receieved the following exception: Annotation: Exception occurred in Request Processor javax.jmi.reflect.InvalidObjectException: Object with MOFID DF0E4A54-D594-11D9-ABF3-FD7F0254AA77:00000000000017D5 no longer exists. at org.netbeans.mdr.handlers.BaseObjectHandler._getDelegate(BaseObjectHandler.java:353) at org.netbeans.mdr.handlers.InstanceHandler.getInstanceDelegate(InstanceHandler.java:48) at org.netbeans.mdr.handlers.InstanceHandler._handleGet(InstanceHandler.java:193) at org.netbeans.jmi.javamodel.JavaClass$Impl.super_getModifiers(Unknown Source) at org.netbeans.modules.javacore.jmiimpl.javamodel.JavaClassImpl.getModifiers(JavaClassImpl.java:76) at org.netbeans.jmi.javamodel.JavaClass$Impl.getModifiers(Unknown Source) at org.netbeans.modules.editor.java.JMIUtils.isAccessible(JMIUtils.java:1140) at org.netbeans.modules.editor.java.JMIUtils.isAccessible(JMIUtils.java:778) at org.netbeans.modules.editor.java.JMIUtils$AccessibilityDescriptor.<init>(JMIUtils.java:1070) at org.netbeans.modules.editor.java.JMIUtils.isAccessible(JMIUtils.java:1138) at org.netbeans.modules.editor.java.JMIUtils.isAccessible(JMIUtils.java:778) at org.netbeans.modules.editor.java.JavaFixAllImports.addAllNeededImports(JavaFixAllImports.java:177) at org.netbeans.modules.editor.java.JavaFixAllImports$1.run(JavaFixAllImports.java:59) at org.openide.util.Task.run(Task.java:189) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:330) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:721) I recommended that you try to use a class in some code that is ambiguous in nature like Element and do a 'fix imports' you will see that the following error occurs.
I agree with the hotfix, this is a show-stopper since many users have projects with their own build script and folder taxonomy. Also, on my last message, there is no need to download jdom if you don't want to. I think you can duplicate what I had by just typing in Element. Since java comes packaged with 3 different Element classes already (javax.swing.text.Element, javax.swing.text.html.parser.Element, and org.w3c.dom.Element).
I have downloaded and installed the supplied patch. However, when I added a new Jar file (Quartz), the code completion still had problems. In fact, it could not even recognise the import statement. I added the Jar file in the lib directory, and added a reference to it in the Java Sources Classpath. Is/Are there any file(s) that I can upload to help you diagnose the problem? Thanks Joseph.
To dhinojosa: I can't reproduce your scenario. Could you please: 1) File a new bug with exact steps to reproduce? 2) Check if the steps are reproducible also without this patch? Thanks!
To bonej010: I have tried your scenario too, but I don't see any specific problems. Could you please file a new bug with exact steps to reproduce? (starting with new empty freeform project?) Thanks.
Looks like the project file got corrupted. When I recreated the project, it worked fine immediately. Thanks for looking into the issue.
Fixed in trunk. The proposed patch was applied and it seems to works without any problems.
Are you sure this was fixed in the trunk? I'm using NetBeans 4.2 dev daily 200506211800 and it seems to be there. Same symptoms. Thanks!
I have verified the fix in build 200506281800. OTOH it is possible that there are still other problems which we didn't discover yet. If you have reproducible case or random case when it fails, please file a new issue with step-by-step description how to reproduce your problem. Thanks!
Hi all, we are preparing hot fix for NetBeans 4.1. I'd like to ask all reporters: could you please install attached NBM manually to your NetBeans 4.1 installation and test your Web freeform projects. If you find any regression, pelase let us know ASAP. Please send us also positive feedback - we need to know how many users tested it. Thanks! How to install NBM: 1) Tools | Update Center 2) Select "Install Manually Downloaded Modules (.nbm Files)", Next 3) Add - browse attached NBM file, Next 4) Next 5) Accept (Sun license) 6) Next 7) Check 'Include' column for Web Freeform Project Support - version 1.0.2 (Not Signed) modile 8) Yes (confirm installation of unsigned module) 9) Finish 10) select 'Restart the IDE', OK Thanks you very much for your help!
Created attachment 23078 [details] 4.1 hotfix candidate
So far so good on my computer, although I've just installed the patch and done a quick test. Usually it would take a while after creating a project before the problem would show. If I see anything bad today I'll add it to this issue. Great job! Thanks!!