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 187906 - Unable to edit libraries in a libraries folder through library manager
Summary: Unable to edit libraries in a libraries folder through library manager
Status: RESOLVED INCOMPLETE
Alias: None
Product: projects
Classification: Unclassified
Component: Libraries (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P1 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-21 19:08 UTC by _ wadechandler
Modified: 2010-06-24 15:28 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Libraries Customizer (84.79 KB, image/png)
2010-06-22 13:02 UTC, Tomas Zezula
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ wadechandler 2010-06-21 19:08:05 UTC
In NB 6.9, I can not open Tools->Libraries and select a location pointed to by a project if the project uses a libraries directory instead of the global directories.

In this case I had an existing project and existing libraries directory. The libraries directory is on the same level as the project:

project1
project2
common.libs

and common.libs holds the libraries. I can select to use a directory and import libraries fine. I can then use those libraries in the application and they are added to the classpath. But, there is no way to manage those libraries. Going the project properties->Libraries, selecting/highlighting a library, and clicking the Edit button yields a mostly blank screen as well, and thus you can't edit a library in any way once it has been imported. To, there is no way to create new libraries in the project library directory. This worked in 6.8.
Comment 1 Tomas Zezula 2010-06-22 12:57:29 UTC
Works fine for me in NB 6.9.
I've created  JavaApplication7 and JavaApplication8 both having a common lib folder as you described.

-
|-JavaApplication7/
|-JavaApplication8/
|-lib/

The libraries can be edited. See attached picture.
Can you attach a sample project?
Thanks

Peter, can you test it on Windows?
Thanks
Comment 2 Tomas Zezula 2010-06-22 13:02:38 UTC
Created attachment 100322 [details]
Libraries Customizer
Comment 3 _ wadechandler 2010-06-22 14:06:55 UTC
On another computer of mine, both are Windows XP Pro, it seems to be working. I did notice on this one at one time it did not show, but it only happened once. The other, it has never showed. The only real difference, less hardware and thus drivers, is one has JDK 1.6_17 and the other 1.6_20. So, I will update the other and see how that affects it. I guess I can clear out my user dir after I upgrade JDKs too, and see if that has any impact. I will report the results. Thanks Tomas.
Comment 4 Tomas Zezula 2010-06-22 14:13:32 UTC
Thanks for the help.
I've tested it on Mac(JDK 1.6_20). I don't have Windows but Peter will recheck it on Windows.
Comment 5 _ wadechandler 2010-06-23 18:25:09 UTC
I updated the JDK on my other computer but still no libraries showing up for the projects shared library folder in lib man. I'm building a NB module to see if I can track it down further.
Comment 6 _ wadechandler 2010-06-23 18:37:03 UTC
Guess I should say:

The NB module will initially:
-output what LibraryManagers are available from LibraryManager.getOpenManagers
-output what ArealLibraryProvider instances are provided in the default lookup

Just to see if things are returned at all there. From there I'll keep narrowing it down to see if I can figure it out locally.
Comment 7 _ wadechandler 2010-06-23 19:24:49 UTC
OK, so not sure the deal, but I have opened and closed this project many times in the IDE, and after running my plugin, the library manager can edit the projects properties! So, it must have something to do with accessing the library manager and lookup ... some how. Anyways, the module simply:

        Collection<LibraryManager> mans = LibraryManager.getOpenManagers();
        DefaultListModel dlm = new DefaultListModel();

        for(LibraryManager man : mans){
            dlm.addElement("Lib Man: " + man.getDisplayName() + ": " + man.getLocation());
        }

        libManList.setModel(dlm);

        dlm = new DefaultListModel();

        Collection<? extends ArealLibraryProvider> alps = Lookup.getDefault().lookupAll(ArealLibraryProvider.class);

        for(ArealLibraryProvider alp : alps){
            dlm.addElement("ALP: " + alp.getClass().getName());
        }

        alpList.setModel(dlm);

and after running that, which that code runs on a button click, the libraries show up in the lib man UI.

Prior to this I had even deleted the user directory and allowed the IDE to restart and rebuild it to still have the libraries not show up in the manager. Other than the above code, the only thing which took place was I ran my individual module which caused a new IDE with a new user directory to run with a testuserdir. I opened my project in that instance and then stopped it. The running instance acted the same exact way however (did not show the libraries until the code above ran).

I will restart the IDE and report back as to how it behaves. Again, on another Windows machine with JDK 1.6_20, this does not act the same.
Comment 8 _ wadechandler 2010-06-23 19:43:24 UTC
After restarting and trying different things I have tried:

-Restart and open recent project (selecting my project with a common lib) and close all projects and exit
-Restart and open project (selecting my project directory with a common lib) and close all projects and exit

and repeated the above multiple times with the lib manager working correctly. This only happened after building that module and running that code. Which is very strange. 

The only other thing I can think of is I used open recent project instead of open project right before it worked. So, that, plus the code in my simple plugin are the only things I have done differently. Well, I did use the option of my plugins project to install the plugin into the working dev environment as well (if that could matter). So, 3 different things I did. 

How they exactly affect the lib manager and the provided libraries I'm not sure as I did not investigate that far down. I can't reproduce the error yet. The next thing I will try is whether deleting the user directory causes it to revert. If so, then I will diff my user directories to see if there are any differences, and if so will report. Too, I can check Subversion on my end to see if there are any differences occurring in my libraries directory after opening the project in a different instance of the IDE.
Comment 9 _ wadechandler 2010-06-23 19:45:40 UTC
Comfirmed with svn I have no changes to my shared library directory, so nothing modified the properties file or anything. Rules that out at least.
Comment 10 _ wadechandler 2010-06-23 19:54:25 UTC
Sure enough. I renamed my user directory. Restarted the IDE. It created the new user directory. I opened my project. The library manager does NOT work correctly. I will report more findings. I'm trying to examine the user directories using kdiff3 now.
Comment 11 Tomas Zezula 2010-06-24 12:12:25 UTC
Aren't you running the full IDE? If so, it may be somehow related to module activation after the project is opened (empty user dir).
Comment 12 _ wadechandler 2010-06-24 15:28:45 UTC
Yes, the full IDE, but no, I can run the IDE. Open the project. No libraries. Close the project. Reopen. No libraries. Restart the IDE. No libraries. Run that code. It works from then on. I can open and close at will and the libraries will show up. I'm going to copy off the one user directory of the new one. Install my module and run the code. Then I will do a diff on that. I couldn't find anything against the previous user directory which was obvious it could affect libraries. If all else fails, I may try to debug it when I actually get more time.