blob: 5ae8064e02ef8d96d214acfebb35c09642c28a55 [file] [log] [blame]
Title: BlogSample-0.1-incubating
<a name="BlogSample-0.1-incubating-TheBlogSample-version0.1-incubating."></a>
# The Blog Sample - version 0.1-incubating.
<a name="BlogSample-0.1-incubating-RunningtheBlogSample"></a>
## Running the Blog Sample
<a name="BlogSample-0.1-incubating-Prereqs"></a>
### Prereqs
Follow the instructions [here](http://db.apache.org/derby/papers/DerbyTut/install_software.html#derby)
to complete the following actions: Download Derby, Install Derby, Set
DERBY_INSTALL, Configure Embedded Derby and then Verify Derby.
<br>
- - -
**Note:**
The version of Derby used by the current release and development versions
of the Blog Sample is 10.5.3.0. Since May 2010 the Derby tutorial points to
the latest Derby release (10.6.x) - if this is installed the Blog sample
will not work. See [ARIES-317](https://issues.apache.org/jira/browse/ARIES-317)
. For the present the best solution is to install Derby 10.5.3.
- - -
<a name="BlogSample-0.1-incubating-CreatetheOSGiplatformfortheBlogsample"></a>
### Create the OSGi platform for the Blog sample
Download and unzip the source zip for the [latest release](aries:downloads.html)
of Aries Samples and build the blog-assembly module:
cd samples-0.1-incubating/blog/blog-assembly
mvn install
This procedure will pull in the binaries from the latest release and its
dependencies.
<a name="BlogSample-0.1-incubating-RunningtheBlogsample"></a>
### Running the Blog sample
Download the JDBC based Blog sample application (.eba file) from the [latest release](aries:downloads.html)
.
Create the database
cd samples-0.1-incubating/blog-sample/blog-assembly/target
export
CLASSPATH=$DERBY_INSTALL/lib/derby.jar:$DERBY_INSTALL/lib/derbytools.jar:.
java org.apache.derby.tools.ij blogDB.sql
now start Aries in an OSGi framework (we're using Eclipse Equinox in this
case)
java -jar osgi-3.5.0.v20090520.jar -console
The OSGi console should start up, the 'ss' command should show all of the
Blog bundles in state 'ACTIVE'.
Now start the blog application (.eba file) you downloaded earlier, by
copying it into the load directory which was created when Aries started.
Point your browser to [http://localhost:8080/org.apache.aries.samples.blog.web/](http://localhost:8080/org.apache.aries.samples.blog.web/)
If you subsequently delete the .eba from the load directory the application
will be uninstalled.
<a name="BlogSample-0.1-incubating-RunningthesampleusingaJPApersistencelayer"></a>
### Running the sample using a JPA persistence layer
The first blog sample application was written to use a JDBC persistence
layer. There is a second application implemented to demonstrate the JPA
capability
To run the blog sample which uses the JPA persistence layer, start the OSGi
framework, remove any previous copies of the blog sample from the
target/load directory, then copy the Blog sample JPA .eba file into the
load directory.
Finally, after typing 'refresh' at the OSGi console, point your browser at [http://localhost:8080/org.apache.aries.samples.blog.web/](http://localhost:8080/org.apache.aries.samples.blog.web/)
. You should see something that looks precisely the same as the blog sample
running with the JDBC persistence layer, but this time running using the
JPA persistence layer.
<a name="BlogSample-0.1-incubating-Usingthelatest,unreleasedcode"></a>
## Using the latest, unreleased code
If you prefer to use the very latest code from subversion, checkout and
build the Aries trunk by following the [Building Aries instructions](aries:buildingaries.html)
.
<a name="BlogSample-0.1-incubating-AbouttheBlogsample"></a>
## About the Blog sample
The blog sample components can be visualised like this:
![bs](BlogSample.png)