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 171973

Summary: Can not create/use other/new persistence library
Product: javaee Reporter: err <err>
Component: PersistenceAssignee: Sergey Petrov <sj-nb>
Status: RESOLVED WONTFIX    
Severity: blocker CC: pjiricka
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description err 2009-09-10 19:45:15 UTC
- I downloaded M7 of eclipselink and created a NetBeans library with the two jars.
- In my project I did "New Entity Classes from Database"
- Select "Database Connection" in combo box, Add All, Next
- click "Create Persistence Unit..."
- In "Persistence Library" select "Manage Libraries..."
- In "Library Manager" select the library I earlier added, click OK
- The library still does not show up in list.
- Used the "New Persistence Library..."
- After adding the two jars, the "EntityManager is not present on library classpath" error indicator went away.
- Clicked ok, still didn't show up in list.

Product Version: NetBeans IDE Dev (Build 200909040632)
Java: 1.6.0_12; Java HotSpot(TM) Client VM 11.2-b01
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Documents and Settings\erra\.netbeans\dev
Comment 1 err 2009-09-10 19:56:55 UTC
Forgot to mention that the persistence library I defined before doing this was already part of the project.
Comment 2 Sergey Petrov 2009-09-10 20:42:53 UTC
it shouldn't be a big problem with m7 as from today nb is bundled with eclipselink 2.0 m7, but still may be an issue
with addition of new libraries.
Comment 3 err 2009-09-11 00:04:15 UTC
Change summary to reflect the higher level issue (not just the specific issue with eclipselink)
Comment 4 Sergey Petrov 2009-09-11 05:09:50 UTC
there are several points why it may not work,
- nb show persistence library only if it know about this persistence library, 
- also nb show only one provider item in drop down per known provider versions and it have sense because from code sde
without libraries there may be no way distinguish even eclipselink 1.0 and 2.0, and if we speak about milestones it's
even more worst case.
Comment 5 err 2009-09-11 05:47:22 UTC
> there are several points why it may not work,
> - nb show persistence library only if it know about this persistence library, 
"New Persistence Library..." and its dialog seems to check that the jars are valid since it has that "EntityManager is
not present on library classpath" check. Doing this dialog, would notify NB about the new library for its list.

> - also nb show only one provider item in drop down per known provider versions and it have sense because from
>   code sde without libraries there may be no way distinguish even eclipselink 1.0 and 2.0,
>   and if we speak about milestones it's even more worst case.
In the "New Persistence Library..." dialog you give the library a name. So it would not be a problem to have all the
milestone builds for example, each with a different name. Like:
    persistlib-M5
    persistlib-M6
    persistlib-M7
    persistlib-release

About the "Manage Libraries...", I guess if you pick a library there, then exit that dialog it should be validated with
the "EntityManager is not present on library classpath" check.


If there is no time to do this for 6.8, then
    "New Persistence Library..."
    "Manage Libraries..."
should probably be taken out of the drop down combo box, and the 'define your own' feature dropped for 6.8. There is a
potential problem that there might be a bug fix of eclipselink and no easy way to start using it without this feature.

Comment 6 Sergey Petrov 2009-09-11 06:13:09 UTC
yes, library have name but in persistence unit dialog you have no selection for library, only for provider and library
is determined based on provider, either there should be additional selection of library if multiple exist or providers
list should extends and have smth like "EclipseLink (libname)" items.
Comment 7 Sergey Petrov 2009-09-11 06:14:08 UTC
before removal or enhancment it's good to check if new 
Comment 8 Sergey Petrov 2009-09-11 06:14:31 UTC
dismiss last comment.
Comment 9 err 2009-09-11 18:07:42 UTC
I think I understand better now. Yes, it looks like the UI is missing some stuff to make use of multiple libraries of
the same provider.
Comment 10 Sergey Petrov 2009-09-25 12:01:35 UTC
*** Issue 173087 has been marked as a duplicate of this issue. ***
Comment 11 Sergey Petrov 2010-10-27 10:31:59 UTC
looking into the issue once more. 
it may be possible to separate  drop down items into items with some library match or have additional dialog or/and drop down. but it looks more like a corner case as we are trying to have ui simple and working in less clicks and providing correct result for most cases, usage of M3,M4,M5 etc looks like a corner case I see no usual for development.
Comment 12 Sergey Petrov 2013-06-13 03:22:19 UTC
except milestones, there are mor valid use cases for support this feature, new versions with the same jpa version support may be releasd.
without control for libraries, persistence nb support will use first in order, it may be the way to workaround the issue if change order in ant library list (with library name changes).
Comment 13 Martin Balin 2015-09-17 13:10:15 UTC
Report from old NetBeans version. Due to code changes since it was reported likely not reproducible now. Feel free to reopen if happens in 8.0.2 or 8.1.