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 144795 - Rest Services Entity Wizard cannot find Persistance Units
Summary: Rest Services Entity Wizard cannot find Persistance Units
Status: RESOLVED DUPLICATE of bug 101556
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on: 101556
Blocks:
  Show dependency tree
 
Reported: 2008-08-21 22:06 UTC by nthompson
Modified: 2011-10-10 10:02 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nthompson 2008-08-21 22:06:37 UTC
If entity classes are located in external JAR files instead of the current NetBeans project then the RESTful Web 
Services from Entity Classes wizard cannot find the persistence unit files and it stops with the message "Current 
project has no persistence units. Please use New Persistence Unit wizard to create one."  The developer has two 
workarounds: (1) either use the New Persistence Unit wizard to create a persistence.xml file assuming that he/she has 
the knowledge to do so, or (2) manually merge the contents of the various individual persistence.xml files from each 
of the external jar files into a single persistence.xml file for the current project.
Comment 1 nthompson 2008-08-21 22:18:32 UTC
This phenomena can be demonstrated by building the two NetBeans projects that are associated with the tutorial, "Using 
Java Persistence API Within a Visual Web JSF Application." The tutorial builds a visual web application (named 
TestWebApp) that binds a visual component to a JPA entity class that is packaged in another project's jar file (the 
other project is named TestModelApp).

To reproduce this problem, follow the tutorial through to completion and confirm that the visual web application 
displays the User table contents when it is run. After running the tutorial, use the "Restful Web Services from Entity 
Classes Wizard" in the TestWebApp project to build the web services. It will be observed that the wizard will not be 
able to find a persistence unit and will stop prematurely. A workaround can be applied by copying the persistence.xml 
file from the TestModelApp project's "src/META-INF/" directory to the TestWebApp project's "src/conf/" directory. If 
the RESTful Services wizard is run again, it will find the persisence.xml file that was copied from the external jar 
file and will successfuly complete the creation of the REST services.
Comment 2 Sergey Petrov 2010-05-20 13:24:11 UTC
it may be consider as a duplicate of #101556 or at least it's related.
Comment 3 Denis Anisimov 2011-10-07 06:23:10 UTC
I'm able to reproduce it.
Current wizard REST from Entities uses the same UI that is JPA 
Controller from entities.
It has the same problem.
Comment 4 Sergey Petrov 2011-10-10 10:02:38 UTC
As it's said current wizard is the sae as in persistence area, and it's unfortunately just isn't supported so far to use/recognize pu from jars.

*** This bug has been marked as a duplicate of bug 101556 ***