EclipseLink/Examples/JPA/GlassFishV3 Web Tutorial
EclipseLink JPA Deployed on GlassFish 3 using Eclipse WTP
Note: This tutorial' is under construction for the next week as of 20080909.
If you want to get a small web application running quickly on GlassFish - the services provided by the Web Tools Project pluggin in the Eclipse IDE can take care of the deployment details and set the server into debug mode for you.
This basic example details how to use Eclipse to run/debug a minimum J2EE web application servlet using EclipseLink JPA as the persistence provider. The goal of this example is to detail the minimum steps needed to run EclipseLink inside GlassFish using the Eclipse IDE - at this point no presentation/controller layer such as JSF, Spring or Struts will be used beyond a basic HttpServlet so we can concentrate on the the integration layer JPA setup.
The DALI project was used to generate Entities from a schema with sequences already populated.
This example will run fine with Eclipse 3.3 EE and any Database that EclipseLink supports.
Install Eclipse EE
- I installed a clean version of Eclipse Ganymede M5 with all of WTP 3.0
Install a Database
- In this example I am using Oracle 11g, the table schemas have already been created manually and all entitity java classes have been generated using the Eclipse DALI tool.
- See the following GlassFish Technology Preview 2 page.
- Note V3TP2 is currently a subset of JEE5 but it has everything we need JSF 1.2, JSP 2.1/Servlet 2.5 and JPA 1.0 via EclipseLink
All of Installation, deployment, JNDI setup, persistence.xml configuration, jpql query example - in progress ......
I am currently working past the following issue with the GlassFish V3 SNAPSHOT plugin to Eclipse 3.4. The workaround is to rename the jars and create stubs for the missing ones to get past the creation errors and then rename them back once we have a server instance.
- Using GlassFish V3 TP2
- Using GlassFish V3 Prelude - Workaround is to use the snapshot plugin which matches with the jars names in Prelude