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.
NB version: Dev 20110223 Java: 1.6.0_20 OS: Windows XP version 5.1 on x86 New, virgin userdir Glass Fish 3.1 b43 Steps to reproduce: 1. Create a new EE6 Web Application that uses GF 3.1. Add the Spring framework 3.0.2 2. Run the RESTful WS from Database wizard. Use the Derby jdbc/sample data source and the CUSTOMER table from that data source. 3. Choose to generate a subclass of javax.ws.rs.core.Application for REST resource application, with Jersey libraries added to classpath. (This doesn't seem to matter, because web.xml is generated anyway.) 4. Add aopalliance.jar to the application's compile-time libraries. Also delete the @Error annotations from the service classes. The resulting persistence.xml file is for TopLink and should be for JPA 1.0. However, it is for JPA 2.0, which is not supported by Swing. If you delete this persistence.xml and generate a new TopLink PU from the Persistence unit wizard, it is correctly version 1.0.
(In reply to comment #0) > > The resulting persistence.xml file is for TopLink and should be for JPA 1.0. > However, it is for JPA 2.0, which is not supported by Swing. No it shouldn't. This is just a workaround for known issue #179216. It is normal to create persistence unit with new spec version. Persistence unit is created and configured for project via call : org.netbeans.modules.j2ee.persistence.wizard.Util.addPersistenceUnitToProject(project,org.netbeans.modules.j2ee.persistence.wizard.Util.buildPersistenceUnitUsingData(project, null, helper.getTableSource().getName(), null, null)); So please provide extending version of method in the Util class which allows choose persistence version to clients ( RESTful code ). F.e. add method "buildPersistenceUnitUsingData" with additional argument which could have either boolean type or some enum type . As result there will be two overloaded methods: with additional argument and without it. In case of presence this additional argument the method should use its value to specify persistence version. After providing this functionality on the j2ee.persistence module side please reassign this issue to the RESTful . I will use it for Spring workaround.
quite strange to use wrong api/spi, but if it's really necessry it's always possible to extend. api/spi etc with "manual" version restriction may have sense even for persitence itself if allow to limt version in new pu wizard but there is no such functionality. will look.
http://hg.netbeans.org/web-main/rev/4304f7c33ed0 added version parameter, it's used as "restriction" not as direct version, you will not be able to create 2.0 in project with 1.0 support only, but should be able to create 1.0 in project with 2.0 support.
Thanks, changeset: 189576:28947aa1303f
Integrated into 'main-golden', will be available in build *201102260001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/4304f7c33ed0 User: Sergey B. Petrov <sj-nb@netbeans.org> Log: fix #195974 extend api