Installing OpenJPA modules in Apache Karaf
Before we can begin to explore how to build OpenJPA-backed applications, we must first install all the required JPA modules into the Karaf container.
Getting ready
The ingredients of this recipe include the Apache Karaf distribution kit, access to JDK, and Internet connectivity.
How to do it…
Thanks to Apache Karaf's feature system, installing OpenJPA is a very simple two-step process: install the JPA and OpenJPA feature in Karaf. The steps are as follows:
Note
Why do we not have to add the feature URL? This is because Apache Karaf's standard distribution includes the JPA and OpenJPA feature URLs by default.
We can install a feature by executing the
feature:install
command with the feature's name as follows:karaf@root()> feature:install jpa
We can verify the installation by executing the
list –t 0 | grep -i JPA
command, which will list all installed OpenJPA components and dependencies in Karaf (Geronimo-jta_1.1_spec, Geronimo-jpa_2.0_spec, Aries JPA...