Skip to content

Modifying the CustomerDBSpring sample REST application to run on Glassfish V3

November 25, 2008

Netbeans 6.5 comes with sample applications (CustomerDB and CustomerDBSpring)  that demonstrate how to use the Jersey REST APIs. By default these deploy on Glassfish V2.

If you want to try this on Glassfish V3, you will need to change your persistence.xml to use EclipseLink instead of Toplink. (EclipseLink is the new JPA provider in V3 ).  This should do the trick:

<persistence-unit name="CustomerDBSpringPU" transaction-type="JTA">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <jta-data-source>jdbc/sample</jta-data-source>
    <class>customerdb.Customer</class>
    <class>customerdb.DiscountCode</class>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <properties>
      <property name="eclipselink.target-database" value="Derby"/>
      <property name="eclipselink.logging.level" value="FINE"/>
    </properties>
 </persistence-unit>

Advertisements

Comments are closed.

%d bloggers like this: