It seems that i can create a project or application level library just fine only if there's still no other library at the same level. If there's at least already one library at the same level where i'm trying to create the new one it just doesn't get created. No error though.
The code i'm using to create the library is something like this:
LibraryTable libraryTable = LibraryTablesRegistrar.getInstance().getLibraryTableByLevel(LibraryTablesRegistrar.PROJECT_LEVEL, facet.getModule().getProject());
LibraryTable.ModifiableModel libraryTableModel = libraryTable.getModifiableModel();
Library library = libraryTableModel.createLibrary(JAXWS_LIBRARY_NAME);
Library.ModifiableModel libraryModel = library.getModifiableModel();
When i debug this, i can see that at the end both libraryTable.getLibraries() and libraryTableModel.getLibraries() return the new library. But still, it doesn't show up in IDEA.
Any ideas of what might be wrong would be great.