Showing posts with label javaee. Show all posts
Showing posts with label javaee. Show all posts

2014-02-09

Update Glassfish 3.1.2.2 Eclipselink Version to 2.5.1

Glassfish 3.1.2.2 ships with EclipseLink 2.3.2 as JPA Provider. To update the bundled version to a newer (2.5.1 in this case) do the following:

1) Download the new EclipseLink OSGi Bundles from the EclipeLink download site and unzip the archive to a folder on your disk.

2) Make a backup of your current Glassfish modules folder. Assuming you have installed Glassfish in C:\glassfish-3.1.2.2 the modules folder is C:\glassfish-3.1.2.2\glassfish\modules.

3) Delete all JAR files in your current Glassfish modules folder beginning with org.eclipse.persistance.* and the JAR file javax.persistence.jar.

 4) From the downloaded OSGi bundles archive copy all JAR files beginning with org.eclipse.persistance.* but not the source files (containing source in their name) to your Glassfish modules folder. And copy the JAR file beginning with javax.persistance.* to your Glassfish modules folder, too.
5) Clear the contents of the OSGi cache for each domain from the domains osgi-cache folder. Assuming you have installed Glassfish in C:\glassfish-3.1.2.2 the domains OSGi cache folder for domain1 is C:\glassfish-3.1.2.2\glassfish\domains\domain1\osgi-cache.

You can simply delete the whole osgi-cache folder. It will be recreated during next startup of the domain.

You can now start your Glassfish server with updated EclipseLink modules.

2012-10-13

Java Connector Architecture (JCA) 1.6 and CDI on Glassfish 3.1

Context and Dependency Injection (CDI) is different if used in a Java Connector Architecture (JCA) 1.6 Resource Adapter.
If there is a beans.xml in the META-INF directory of a resource adapter (RAR), the beans.xml file is read and the resource adapter is recognized as a CDI module correctly.
This way CDI can be used for all beans inside the resource adapter.

But remember:
However it is not possible to inject CDI bean classes contained in a resource adapter RAR into other web applications or EJBs.