Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EclipseLink/Examples/JPA/GlassFishV3 Web Tutorial"

m (EclipseLink JPA Deployed on GlassFish 3 using Eclipse 3.5)
m (JPA Specification Library Location=)
Line 69: Line 69:
 
***org.eclipse.persistence.core.jar***org.eclipse.persistence.jpa.jar
 
***org.eclipse.persistence.core.jar***org.eclipse.persistence.jpa.jar
 
***org.eclipse.persistence.oracle.jar (optional)
 
***org.eclipse.persistence.oracle.jar (optional)
==JPA Specification Library Location===
+
==JPA Specification Library Location==
 
*javax.persistence.jar ships with GlassFish in the standard ''modules'' directory.
 
*javax.persistence.jar ships with GlassFish in the standard ''modules'' directory.
  
 +
==Progress==
 +
*20090911: I may be missing something getting an EAR running on B63.
 +
**deployment of even a web2.5/ejb3.0 ear fails both for all of the following scenarios
 +
**ant deploy script to b63
 +
**eclipse deploy to b63
 +
**autodeploy eclipse exported ear to b63
 +
**autodeploy ant exported ear to b63
 +
**autodeploy of NetBeans 6.8 ear to b63
 +
<pre>
 +
Sep 11, 2009 7:44:41 AM org.glassfish.api.ActionReport failure
 +
SEVERE: Error during deployment : no container associated with application of type : ear
 +
java.lang.RuntimeException: no container associated with application of type : ear
 +
</pre>
  
 
+
*However, [http://bits.netbeans.org/netbeans/6.8/m1/ NetBeans 6.8.1M1 20090822] with an embedded GlassFish b58 is working fine.
20090909 All of deployment, JNDI setup, persistence.xml configuration, jpql query example - in progress ......
+
*I am testing on NetBeans from now on and will investigate ant/eclipse deployment later
 +
*All of deployment, JNDI setup, persistence.xml configuration, jpql query example - in progress ......
  
  
Line 92: Line 106:
 
**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.
 
**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-->
 
**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 13:23, 11 September 2009

EclipseLink JPA Deployed on GlassFish 3 using Eclipse 3.5

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 the GlassFish V3 application server using the Eclipse IDE, follow the instructions in this tutorial.

This basic example details how to use Eclipse to run/debug a minimum J2EE 5/6 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 V3 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.

Tutorial Source

And the DDL generation J2SE JPA application used to populate the database schema.

http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/examples/org.eclipse.persistence.example.jpa.server.common.ddlgen

Development Environment

Software: Eclipse IDE for Java EE 3.5 Galileo (June 2009 +) , JavaDB (part of GlassFish), SUN Java JDK 1.6.0_xx, GlassFish V3 Prelude

This example will also run fine with any Database that EclipseLink supports.

Prerequisites

Install Eclipse EE

  • I installed a clean version of Eclipse 3.5 Galileo (June 2009)

Install a Database

  • In this example I am the included JavaDB that is part of GlassFish V3, the table schemas have already been created manually and all entity java classes have been generated using the Eclipse DALI tool.

Install GlassFish

Install Eclipse GlassFish Server Plugin

  • Currently the "Download additional server adapters" link on the "New Server" dialog will not work with Eclipse 3.5 - Use the "Help | Install New Software" menu instead via the https://ajax.dev.java.net/eclipse/site.xml update site to get version 32+ of the plugin that is compatible with Galileo.
    • You may refer to the details of Eclipse Bug # 280365.

EclipseLink Library Location

  • The EclipseLink modules ship as 5 separate jars in the standard modules directory (Note EclipseLink SDO and JAXB are precluded by the libraries shipped with GlassFish - the milestone version is from the JPA 2.0 trunk branch.
    • \glassfish\modules
      • org.eclipse.persistence.antlr.jar
      • org.eclipse.persistence.asm.jar
      • org.eclipse.persistence.core.jar***org.eclipse.persistence.jpa.jar
      • org.eclipse.persistence.oracle.jar (optional)

JPA Specification Library Location

  • javax.persistence.jar ships with GlassFish in the standard modules directory.

Progress

  • 20090911: I may be missing something getting an EAR running on B63.
    • deployment of even a web2.5/ejb3.0 ear fails both for all of the following scenarios
    • ant deploy script to b63
    • eclipse deploy to b63
    • autodeploy eclipse exported ear to b63
    • autodeploy ant exported ear to b63
    • autodeploy of NetBeans 6.8 ear to b63
Sep 11, 2009 7:44:41 AM org.glassfish.api.ActionReport failure
SEVERE: Error during deployment : no container associated with application of type : ear
java.lang.RuntimeException: no container associated with application of type : ear
  • However, NetBeans 6.8.1M1 20090822 with an embedded GlassFish b58 is working fine.
  • I am testing on NetBeans from now on and will investigate ant/eclipse deployment later
  • All of deployment, JNDI setup, persistence.xml configuration, jpql query example - in progress ......


References

EclipseLink JPA on GlassFish Server V2

Back to the top