You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by he...@apache.org on 2012/11/23 21:12:29 UTC
svn commit: r1413044 -
/openjpa/site/trunk/content/building-and-running-openbooks.mdtext
Author: helenxu
Date: Fri Nov 23 20:12:29 2012
New Revision: 1413044
URL: http://svn.apache.org/viewvc?rev=1413044&view=rev
Log:
CMS migration
Modified:
openjpa/site/trunk/content/building-and-running-openbooks.mdtext
Modified: openjpa/site/trunk/content/building-and-running-openbooks.mdtext
URL: http://svn.apache.org/viewvc/openjpa/site/trunk/content/building-and-running-openbooks.mdtext?rev=1413044&r1=1413043&r2=1413044&view=diff
==============================================================================
--- openjpa/site/trunk/content/building-and-running-openbooks.mdtext (original)
+++ openjpa/site/trunk/content/building-and-running-openbooks.mdtext Fri Nov 23 20:12:29 2012
@@ -5,8 +5,7 @@ Title: Building and Running OpenBooks
OpenBooks comes with
* complete source code
-* build scripts to demonstrate how to build a typical OpenJPA application
-and package it for JSE or JEE environment
+* build scripts to demonstrate how to build a typical OpenJPA application and package it for JSE or JEE environment
* scripts to run OpenBooks in on your local database installation.
@@ -17,8 +16,7 @@ Follow the simple instructions below to
OpenBooks can be checked out from OpenJPA repository.
- *$ svn co* {{[https://svn.apache.org/repos/asf/openjpa/trunk/openjpa-examples/openbooks](https://svn.apache.org/repos/asf/openjpa/trunk/openjpa-examples/openbooks)
-}}.
+ *$ svn co* [https://svn.apache.org/repos/asf/openjpa/trunk/openjpa-examples/openbooks](https://svn.apache.org/repos/asf/openjpa/trunk/openjpa-examples/openbooks).
will check out the source code and build scripts of OpenBooks in current
directory.
@@ -28,8 +26,7 @@ OpenBooks requires following software en
* Java Runtime version 6.0 or higher
* OpenJPA Libraries version 2.0 or higher
* Ant version 1.6 or higher
-* Any JDBC complaint database supported by OpenJPA (embedded Derby is the
-default).
+* Any JDBC complaint database supported by OpenJPA (embedded Derby is the default).
@@ -53,7 +50,7 @@ for WAS, respectively.
Before you run a build, configure the build environment by editing
*openjpa-examples/openbooks/build.properties*. Essentially, you need to
-* Point *openjpa.lib* variable to the local directory where OpenJPA class
+* Point *openjpa.lib* variable to the local directory where OpenJPA class
library(ies) reside. Notice that the variable points to a directory and not
a *\*.jar* file. All *\*.jar* files found under the directory are
included in compilation classpath. OpenJPA version 2.0, however, is also
@@ -61,12 +58,12 @@ available with all its runtime dependenc
Apache Commons Collections and others) packaged together in a _single_
library (lib).
-*Note: * Access to the OpenJPA class libraries is easier if you have a
+_Note:_ Access to the OpenJPA class libraries is easier if you have a
Maven repository (.m2) available on your system. In this case, all
that is required is to update the *openjpa.version* variable to point at
the proper OpenJPA SNAPSHOT version.
-* Ideally, a JPA-compliant application _should_ not require
+* Ideally, a JPA-compliant application _should_ not require
provider-specific library during compilation. OpenBooks persistent domain
model and application logic also does not use any OpenJPA specific
features, but OpenJPA libraries are still used during compilation because
@@ -76,28 +73,24 @@ OpenJPA.
The next step is to configure runtime configuration descriptors and
environment variables.
-* JSE
-** Edit *persistence.xml* located in
-*openjpa-examples/openbooks/src/main/resources/META-INF* directory.
-Modify the *javax.persistence.jdbc.driver* and
-*javax.persistence.jdbc.url* property to suit your local database and its
-driver.
-** Edit *openjpa-examples/openbooks/run.properties* to specify location
+
+* JSE
+ * Edit *persistence.xml* located in *openjpa-examples/openbooks/src/main/resources/META-INF* directory. Modify the *javax.persistence.jdbc.driver* and *javax.persistence.jdbc.url* property to suit your local database and its driver.
+ * Edit *openjpa-examples/openbooks/run.properties* to specify location
of OpenJPA class libraries and JDBC Driver used in runtime classpath. Here
again, the use of the *openjpa.version* variable with a Maven repository
makes the library and jdbc driver configuration easy.
* JEE
-** You may already have a JTA data source configured and registered in
+ * You may already have a JTA data source configured and registered in
JNDI. Of course, then the appropriate configuration is to be edited
accordingly in the *<jta-data-source>* and *<non-jta-data-source>*
-clauses. See *persistence.jee.was.xml* for WebSphere environment, or
-*persistence.jee.liberty.xml* for the Liberty Profile.
-** OpenJPA library and JDBC drivers are configured in JEE server and hence
+clauses. See *persistence.jee.was.xml* for WebSphere environment, or * persistence.jee.liberty.xml* for the Liberty Profile.
+ * OpenJPA library and JDBC drivers are configured in JEE server and hence
variables in this file are irrelevant.
-** More information on the build and installation of the OpenBooks example
-for application servers can be found in the [WebSphere Application Server](#websphere.html)
- and [Liberty Profile|#liberty]
+ * More information on the build and installation of the OpenBooks example
+for application servers can be found in the [WebSphere Application Server](#BuildingandRunningOpenBooks-WebSphereApplicationServer)
+ and [Liberty Profile](#BuildingandRunningOpenBooks-LibertyProfileinWebSphereApplicationServerv8.5)
deployment sections.
@@ -119,13 +112,12 @@ or
*$ ant \-Dbuild.mode=jee*
The default target of the ant script will
+
* generate metamodel classes (required for Criteria API)
* compile the source code
* enhance the persistence domain model
-* package the application based on the build.mode as a Swing-based
-application or a Web Application Archive.
-* copy the deployable artifacts to *target* and *target/openbooks*
-directories relative to the current directory.
+* package the application based on the build.mode as a Swing-based application or a Web Application Archive.
+* copy the deployable artifacts to *target* and *target/openbooks* directories relative to the current directory.
<a name="BuildingandRunningOpenBooks-DeployOpenBooksinanApplicationServer"></a>
@@ -138,7 +130,7 @@ steps are encoded in separate build scri
Using generic build as described in the previous section, the
*target/openbooks.war* web archive needs to be deployed manually.
-{anchor:websphere}
+
<a name="BuildingandRunningOpenBooks-WebSphereApplicationServer"></a>
### WebSphere Application Server
@@ -146,15 +138,14 @@ For WebSphere Application Server, automa
*build.jee.was.xml*. WebSphere deployment needs to be triggered by
*ws_ant* utility as follows
- *$ ws_ant \-Dbuild.mode=jee \-Dappserver=was \-Dwas.home=<WAS_HOME>*
+ *$ ws_ant \-Dbuild.mode=jee \-Dappserver=was \-Dwas.home=<WAS_HOME\>*
-where *<WAS_HOME>* denotes the root directory where WAS V7 with JPA 2.0
+where *<WAS_HOME\>* denotes the root directory where WAS V7 with JPA 2.0
feature pack has been installed (at a minimum). Yes, OpenBooks requires
features defined by the JPA 2.0 specification, thus the use of the WAS V7
JPA 2.0 feature pack is a minimum requirement. Further information on this
feature pack is available [here](http://www-01.ibm.com/support/docview.wss?rs=180&uid=swg27018836)
- or [WebSphere in general|http://www-01.ibm.com/software/websphere/]
-.
+ or [WebSphere in general](http://www-01.ibm.com/software/websphere/).
The WebSphere specific build will configure appropriate JTA data sources
using a python script (found under *openbooks/scripts/* directory before
@@ -162,7 +153,7 @@ deploying OpenBooks as a web application
server instance. If multiple profiles exist, the script will use the first
server profile.
-{anchor:liberty}
+
<a name="BuildingandRunningOpenBooks-LibertyProfileinWebSphereApplicationServerv8.5"></a>
### Liberty Profile in WebSphere Application Server v8.5
@@ -170,10 +161,9 @@ For the Liberty Profile in WebSphere App
build scripts are available in *build.jee.liberty.xml*. Liberty Profile
deployment is very easy and needs to be triggered by *ant* as follows
- {{$ ant \-Dbuild.mode=jee \-Dappserver=liberty
-\-Dliberty.home=<WAS_HOME>/wlp \-Dliberty.server=<server name>}}
+ *$ ant \-Dbuild.mode=jee \-Dappserver=liberty \-Dliberty.home=<WAS_HOME\>/wlp \-Dliberty.server=<server name\>*
-where *<WAS_HOME>* denotes the root directory where WAS v8.5 has been
+where \<WAS_HOME\> denotes the root directory where WAS v8.5 has been
installed, and <server name> is the name of your Liberty Profile server.
Instead of specifying these two variables, *liberty.home* and
*liberty.server*, you could modify the build variables in the
@@ -189,8 +179,7 @@ application via your server.xml file. E
can be found in the *openbooks/scripts/liberty* directory.
Additional information on the Liberty Profile can be found [here](http://www.wasdev.net/)
-. General WebSphere information can be found [here|http://www-01.ibm.com/software/websphere/]
-.
+. General WebSphere information can be found [here](http://www-01.ibm.com/software/websphere/).
<a name="BuildingandRunningOpenBooks-RunOpenBooks"></a>
## Run OpenBooks
@@ -199,8 +188,8 @@ If you have built OpenBooks for JSE, the
*openjpa-examples/openbooks/target/openbooks* directory.
Invoke the Ant script to run OpenBooks
-*$ ant \-f run.xml*
+*$ ant \-f run.xml*
If you have built OpenBooks for JEE, a Web Application Archive
*openbooks.war* will be created in *openjpa-examples/openbooks/target*
@@ -211,7 +200,7 @@ Server. Once deployed, you can point a b
For example,
- *http://localhost:9080/openbooks/*
+ [http://localhost:9080/openbooks/](http://localhost:9080/openbooks/)
to access OpenBooks as a web application.
@@ -223,7 +212,7 @@ OpenBooks checks for existing data at fi
the database is empty, the schema is defined and populated with initial
data. However, you can explicitly populate the database in JSE build.
-*Note:* By default, the OpenBooks example uses and populates an Embedded
+_Note:_ By default, the OpenBooks example uses and populates an Embedded
Derby instance on "first touch". So, no further configuration or loading
is required for the default configuration.