Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "EclipseLink/Examples/JPA/GlassFishV3 Web Tutorial"
m (→EclipseLink JPA Deployed on GlassFish 3 using Eclipse WTP) |
m (→References) |
||
Line 37: | Line 37: | ||
All of deployment, JNDI setup, persistence.xml configuration, jpql query example - in progress when we start JEE6 examples as V3 Prelude (a JEE6) server does not support deploying JEE5 EAR projects...... | All of deployment, JNDI setup, persistence.xml configuration, jpql query example - in progress when we start JEE6 examples as V3 Prelude (a JEE6) server does not support deploying JEE5 EAR projects...... | ||
+ | ==Downloading EclipseLink Libraries== | ||
+ | ===Download EclipseLink using HTTP - recommended=== | ||
+ | *Proceed to the following URL and download the latest eclipselink.zip which contains everything you need. | ||
+ | **http://www.eclipse.org/eclipselink/downloads/index.php | ||
+ | ***'''Click on the "EclipseLink 1.0.2 Installer Zip''' link which resolves to http://www.eclipse.org/downloads/download.php?file=/rt/eclipselink/releases/1.0.2/eclipselink-1.0.2.zip | ||
+ | *Expand the zip file and get the following 2 files | ||
+ | **eclipselink-1.0.2\eclipselink\jlib\eclipselink.jar | ||
+ | **eclipselink-1.0.2\eclipselink\jlib\jpa\javax.persistence_1.0.0.jar | ||
+ | ===Download EclipseLink using Maven=== | ||
+ | See the repository on http://www.eclipse.org/eclipselink/downloads/index.php | ||
+ | ===Download EclipseLink using SVN - developers only=== | ||
+ | *Get the following ''<font color="blue">eclipselink.jar</font>'' and ''<font color="blue">javax.persistence*.jar</font>'' from http://www.eclipselink.org ready for your EclipseLink shared library - ''(I am running rev 2.0.0.20090218-SNAPSHOT)'' | ||
+ | **The following page details four different ways to either obtain the binary jars or download the source and build them yourself with an anon account. | ||
+ | **http://wiki.eclipse.org/EclipseLink/Source | ||
==References== | ==References== | ||
[[EclipseLink/Examples/JPA/GlassFishV2_Web_Tutorial|EclipseLink JPA on GlassFish Server V2]] | [[EclipseLink/Examples/JPA/GlassFishV2_Web_Tutorial|EclipseLink JPA on GlassFish Server V2]] |
Revision as of 12:51, 27 February 2009
Contents
EclipseLink JPA Deployed on GlassFish 3 using Eclipse WTP
Please refer to the GlassFish V2 page for generic EclipseLink on GlassFish Issues.
If you want to get a small web application running quickly on GlassFish - the services provided by the Web Tools Project plugin 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.
Development Environment
Software: Eclipse IDE for Java EE 3.4 Ganymede (June 2008 +) with all 5 packages (DTP 1.6, EMF 2.4, GEF 3.4, WTP 3.0, XSD 2.4), Oracle 11g DB 11.1.0.6.0, Java JDK 1.6.0_04, GlassFish V3 Prelude
This example will run fine with any Database that EclipseLink supports.
Prerequisites
Install Eclipse EE
- I installed a clean version of Eclipse Ganymede (June 2008) 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 entity java classes have been generated using the Eclipse DALI tool.
Install GlassFish
- Do not use V3 TP2 - use the V3 Prelude release instead.
- The following issues were quickly solved within a 24h timeframe when posted to the GlassFish Forum
- It is recommended that you install the GlassFish V3 Prelude version and use the latest 1.0.9+ V3 SNAPSHOT Eclipse 3.4 Server plugin to run/debug the prelude server.
- Using the GlassFish V3 Prelude install - we select the SNAPSHOT version of the plugin after using "Download Additional Server Adapters" to get a 1.0.9 GlassFish plugin or later.
All of deployment, JNDI setup, persistence.xml configuration, jpql query example - in progress when we start JEE6 examples as V3 Prelude (a JEE6) server does not support deploying JEE5 EAR projects......
Downloading EclipseLink Libraries
Download EclipseLink using HTTP - recommended
- Proceed to the following URL and download the latest eclipselink.zip which contains everything you need.
- http://www.eclipse.org/eclipselink/downloads/index.php
- Click on the "EclipseLink 1.0.2 Installer Zip link which resolves to http://www.eclipse.org/downloads/download.php?file=/rt/eclipselink/releases/1.0.2/eclipselink-1.0.2.zip
- http://www.eclipse.org/eclipselink/downloads/index.php
- Expand the zip file and get the following 2 files
- eclipselink-1.0.2\eclipselink\jlib\eclipselink.jar
- eclipselink-1.0.2\eclipselink\jlib\jpa\javax.persistence_1.0.0.jar
Download EclipseLink using Maven
See the repository on http://www.eclipse.org/eclipselink/downloads/index.php
Download EclipseLink using SVN - developers only
- Get the following eclipselink.jar and javax.persistence*.jar from http://www.eclipselink.org ready for your EclipseLink shared library - (I am running rev 2.0.0.20090218-SNAPSHOT)
- The following page details four different ways to either obtain the binary jars or download the source and build them yourself with an anon account.
- http://wiki.eclipse.org/EclipseLink/Source