layout | title | categories | weight | parent |
---|---|---|---|---|
post |
Building and Running the Application |
SBP |
300 |
first-jpa-app.html |
{% summary %}{% endsummary %}
This step shows how to build, package and deploy the application while taking advantage of XAP's dynamic load balancing capabilities and the Space as a highly HttpSession store.
The application sources and build scripts can be downloaded {%git https://github.com/gigaspaces/petclinic-jpa%}. This application uses a Maven build script, so you need to make sure you're connected to the internet when you first run it to allow Maven to download all the dependencies.
{% highlight console %} ~/gs/xap/{%version gshome-directory %}/tools/maven>installmavenrep.sh "" "" "Installing XAP {% currentversion%}.0-RELEASE jars" "" "" {% endhighlight %}
- cd to the root directory of the application
- Edit the value of the
gsVersion
property in thepom.xml
file at the root directory to reflect the GigaSpaces build you're using (this is the build number that the Maven plugin installation script outputs to the console when invoked). For example, if you are using GigaSpaces XAP {%version xap-version %} you should modify thepom.xml
to have:
{% highlight xml %} {%version maven-version %} {% endhighlight %}
- Run the following Maven command:
{% highlight console %} mvn package {% endhighlight %}
This will download the application's decencies, compile the sources and package the processor processing unit and the web application.
To deploy the application, you should do the following:
- Start a GigaSpaces Agent
- Run the following Maven command from the application's root directory:
{% highlight java %} mvn os:deploy {% endhighlight %}
To have an initial sample data set to work with, simply click the "Create Dummy Data" link in the welcome page of the application. This will create a number of Owner
s, Pet
s and Vet
s that you can work with to experience the application's functionality.
To monitor the application, start the GigaSpaces UI using the <XAP root>/bin/gs-ui.sh(bat)
or the GigaSpaces Web UI.
Please refer to this page for directions on how to enable HttpSession
high availability for the web application.
Please refer to this page for directions on how to enable HttpSession
high availability for the web application.