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.
EclipseLink/Examples/MySports/GlassFish
< EclipseLink | Examples | MySports
Upgrade and Configure GlassFish
Use this procedure to upgrade GlassFish to use a more recent EclipseLink version and prepare the connection pool.
- Replace the following JAR files from <GLASSFISH_HOME>\glassfish\modules\ with the JAR files from the EclipseLink OSGI bundle:
- org.eclipse.persistence.antlr.jar
- org.eclipse.persistence.asm.jar
- org.eclipse.persistence.core.jar
- org.eclipse.persistence.jpa.jar
- org.eclipse.persistence.jpa.modelgen.jar
- org.eclipse.persistence.oracle.jar
- Copy the following JAR file from the EclipseLink OSGI bundle to <GLASSFISH_HOME>\glassfish\modules\:
- org.eclipse.persistence.moxy_2.3.0.v20110604-r9504.jar
- Use the GlassFish Admin Console to create a new JDBC resource named jdbc/MySports and a new JDBC connection pool named MySportsPool. In this example, we will use the embedded Derby database:
- Resource type: javax.sql.DataSource
- Datasource classname: org.apache.derby.jdbc.EmbeddedDataSource40
Note: Be sure to edit the JDBC Connection Pool properties to reflect your database connection information. In this example, we will use: - User: APP
- Password: APP
- ServerName: localhost
- DatabaseName: gemini
- PortNumber: 1527
Configure Eclipse Environment
Now you can configure Eclipse to run the MySports example.
- Add a variable named eclipselink_2.3_jar with the value <ECLIPSELINK OSGI BUNDLE>\org.eclipse.persistence.core_2.3.0.<BUILD>.jar.
This is used for the javaagent of the test project. You can add this variable by creating a String Substitution variable, as shown here: - Obtain the three example projects from the EclipseLink SVN repository:
Note: If you use the Eclipse Team Provider for SVN plugin (http://www.eclipse.org/subversive/downloads.php) Eclipse will can import the example projects.- http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/branches/2.3/trunk/examples/my-sports/MySports/
- http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/branches/2.3/trunk/examples/my-sports/MySportsAdmin/
- http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/branches/2.3/trunk/examples/my-sports/MySportsTests/
- Start the Derby server. The GlassFish installation includes a Derby instance that can be used, in the <GLASSFISH_HOME>\javadb\ folder.
- Import the EclipseLink MySports projects into Eclipse.
- Create a new Derby connection profile. Use the same JDBC Connection Properties that you used when creating the GlassFish connection pool.
- Add the Connectivity Driver Definition for the Derby database to the project.
- Edit the eclipselink-examples-mysports.properties file to match your database connection information.