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.
All imports that are not part of the projects source tree get deleted when I run 'fix imports'. When i started this editing session it worked. Since the last time it worked i edited a JSP file and run a 'ctr shift F' (format) command on it. I used JDK 1.5.0.03 netbeans 1.4 on a Suse Linux 9.2 installation. I am now going to delete my user setttings to see if that resolves the problem. cheers, Aad
I have deleted my .netbeans/nb4.1 settings and after restart of Netbeans all worked fine again (I guess that means we have a workaround). If I can make the behavior repeatable I will report back.
Just did a second test: It is repeatable. Every time after I have opened a JSP the 'fix import' setting refuses to work correctly. All imports that are not directly related to the source tree of the project that I am working on are deleted. One more detail: I store my .class and .java file in the same folder structure.
This issue seems to have more side effects. The code completion in Java also fails for such ordinary things as the java.lang.Class API.
Mmm, the problem is becoming more pressing. Even after deleting the 4.1 subdirectory the problem stays. If this problems persists I may have to downgrade since it slows creating new code considerably.
Hm, this is strange. I tried to reproduce this behaviour with NetBeans 4.1 (build #200505031930), JDK 1.5.0_03 (build #6) but on Windows XP and it works fine for me. I used web application project type. Here is what I did: 1. Using "Add JAR/Folder..." on Libraries node added my own JAR to the web project. 2. Opened index.jsp and pressed CTRL+Shift+F to reformat the page. 3. Created new Java Class and used some class there from my JAR. Auto-completion auto-imported the class. 4. Right clicked editor area and selected "Fix Imports" from popup menu. Nothing changed - import statement survived. What is exact build number of NetBeans 4.1 you are using ? It reminds me of my older issue #56161.
Mmm, My jar files were added by using the project (from the project view) right-click, properties, in javasources I added the jars (is that equivalent? or should I add all jars there as well?) Other than that all your steps are the same ones i took. About the build: Linux 2.6.8-24.10-default IDE version: IDE/1 spec-5.9.1.impl-200505031930 Product version Netbeans 4.1. (build 200505031930) All the other info seems pretty much the same. On the nbusers forum some equivalent remarks about 'losing' the jar info seems to occur. Some other details: - classes and java files are stored in same directories (don't ask) - we use CVS can't think of too many other things. If you would like to explore my userdir or have more questions feel free to drop me a line. cheers, Aad
I am also not able to reproduce the issue. How do you store your .java and .class files in the same directory - do you use a special build script? Did you encounter the issue also outside JSP editor (e.g. when editing a java file)? Thanks.
The .java and .class files are stored in the same directory tree (about 900 classes). We use a ant based build script. The problem occurs in the __JAVA EDITOR__. Here is how I can reproduce it at will: 0. stop netbeans 1. delete all user settings in .netbeans/4.1 2. restart netbeans 3. 're-attach' the project by selecting it and setting the build file 4. open a .java file and everything works great (including completion and fix imports) 5. open a jsp file, add a space, delete it, save it 6. go to the same .java file (or open another one) run fix imports and see how all imports where the java code is not part of your project (e.g. java.util.Map) are deleted. 6a. try code completion. Nothing works unless it is part of your project. if you e-mail me a phone number aad at nales.com I am more than willing to give you a call so that you can ask about the specifics. We all (4) people work with the same setup and we all experience exactly the same problems. Since this problem is extremely annoying but since I am already addicted to the other 4.1. features and I am more than willing to spend time on fixing this. cheers, Aad 6. go to the same .java file
I've spent 2 hours trying to reproduce this problem but without any success. I used all 3 project types: standard, with own sources and with own build script. The only way how I was able to reproduce items 6 and 6a was to screw up my build script or its properties file. This way "Fix Imports" removed all imports and code completion didn't work but it also resulted in impossibility to build the project. So now I have two questions for you: [1] If this happens, can you really "Clean and Build" the project successfully ? (I know it's kind of dumb question :-| [2] Would it be possible to share your project with us ? At least project metadata (build script and properties file) plus at least fragment of one Java file. From what I've seen my humble conclusion is that it could be rather problem of projects than both Java/JSP editors.
First your questions: 1. Yes it builds beautifully without a glitch it runs, it starts it stops no problem what so ever. 2. No problem either, I will upload the build.xml and build.properties. (I will do that now). Then if you tell me how you would like to get the java sources (do you want the libs and all as well?) It is an Open Source project so I am OK with giving you all the source if necessary.
Created attachment 22518 [details] build file
Created attachment 22519 [details] sample java code
Created attachment 22521 [details] sample jsp
Uh, I promised too much with the build.properties we don't use one since we only work on Linux.
Seems to be a duplicate of issue 59031. Can you zip the nbproject directory and attach it to the issue? You can try the binary patch attached to 59031 (called 59031.jar, see the end of issue 59031). Thanks and let us know if it helps.
The patch works fine for the java code however I now have the same problem asleson is reporting. The jsp files no longer show up!. But what ever 59031.jar did to fix the problem is definitely on the right track. I am happy to accept that is a duplicate of 59031. I hope a fix will be available soon since I have the same problem as said gentleman. *** This issue has been marked as a duplicate of 59031 ***
Thanks for confirmation. Verifying as duplicate issue then ...