TicketMonster is an online ticketing demo application that gets you started with JBoss technologies, in particular the JBoss Developer Framework, and helps you learn and evaluate them.
Here are a few instructions for building and running it. You can learn more about the example from the tutorial.
NOTE: This step is optional. It is necessary only if you want to update the dates of the Performances in the import.sql
script in an automated manner. Updating the performance dates ensure that they are always set to some timestamp in the future, and ensures that all performances are visible in the Monitor section of the TicketMonster application.
-
Run the
update_import_sql
Perl script. You'll need theDateTime
,DateTime::Format::Strptime
andTie::File
Perl modules. These are usually available by default in your Perl installation.$ perl update_import_sql.pl src/main/resources/import.sql
NOTE: This step is optional. The administration site is already present in the source code. If you want to regenerate it from Forge, and apply the changes outlined in the tutorial, you may continue to follow the steps outlined here. Otherwise, you can skip this step and proceed to build TicketMonster.
Before building and running TicketMonster, you must generate the administration site with Forge.
-
Ensure that you have JBoss Forge installed. The current version of TicketMonster supports version 1.4.0.Final or higher of JBoss Forge.
-
Start JBoss Forge
$ forge
-
Verify that the Forge plugin is installed by running
$ forge list-plugins
and verifying that
org.jboss.forge.angularjs-scaffoldx-plugin
is in the returned list.The version of the installed plugin must be 1.0.3.Final or higher. The version is present in the output of this command and it appears like so:
org.jboss.forge.angularjs-scaffoldx-plugin:1.4.0.Final:1.0.3.Final-60c6c2c5-4888-4d6c-a0d9-4894622f94a3
. The plugin version is the second version string listed in the output; the first version string (1.4.0.Final
) is the Forge API version used by the plugin. -
If the outcome of the previous step was that the AngularJS plugin was not installed, do that now
$ forge install-plugin angularjs
-
From the JBoss Forge prompt, execute the script for generating the administration site
$ run admin_layer.fsh
Steps 3 and 4 need to be performed only once - after the plugin has been installed, it will be available on any subsequent runs of Forge.
On step 5, answer yes to all the the questions concerning patches. Deployment to JBoss EAP 6.1 is optional.
TicketMonster can be built from Maven, by runnning the following Maven command:
mvn clean package
If you want to run the Arquillian tests as part of the build, you can enable one of the two available Arquillian profiles.
For running the tests in an already running application server instance, use the arq-jbossas-remote
profile.
mvn clean package -Parq-jbossas-remote
If you want the test runner to start an application server instance, use the arq-jbossas-managed
profile. You must set up the JBOSS_HOME
property to point to the server location, or update the src/main/test/resources/arquillian.xml
file.
mvn clean package -Parq-jbossas-managed
If you intend to deploy into OpenShift, you can use the postgresql-openshift
profile
mvn clean package -Ppostgresql-openshift
You can run TicketMonster into a local JBoss EAP 6.1 instance or on OpenShift.
Download the Hibernate Search distribution that is available as a JBoss Module. Extract the Hibernate Search module to the modules
directory under JBOSS_HOME
.
-
Open a command line and navigate to the root of the JBoss server directory.
-
The following shows the command line to start the server with the web profile:
For Linux: JBOSS_HOME/bin/standalone.sh For Windows: JBOSS_HOME\bin\standalone.bat
-
Make sure you have started the JBoss Server as described above.
-
Type this command to build and deploy the archive into a running server instance.
mvn clean package jboss-as:deploy
(You can use the
arq-jbossas-remote
profile for running tests as well) -
This will deploy
target/ticket-monster.war
to the running instance of the server. -
Now you can see the application running at
http://localhost:8080/ticket-monster
- Make sure that you have an OpenShift domain and you have created an application using the
jbosseap-6
cartridge (for more details, get started here). If you want to use PostgreSQL, add thepostgresql-8.4
cartridge too. - Ensure that the Git repository of the project is checked out.
-
Build TicketMonster using either:
-
the default profile (with H2 database support)
mvn clean package
-
the
postgresql-openshift
profile (with PostgreSQL support) if the PostgreSQL cartrdige is enabled in OpenShift.mvn clean package -Ppostgresql-openshift
-
-
Copy the
target/ticket-monster.war
file in the OpenShift Git repository(located at<root-of-openshift-application-git-repository>
).cp target/ticket-monster.war <root-of-openshift-application-git-repository>/deployments/ROOT.war
-
Download the Hibernate Search distribution that is available as a JBoss Module. Extract the Hibernate Search module to
<root-of-openshift-application-git-repository>/.openshift/config/modules
directory. This directory can contain JBoss Modules required by the application deployed on the EAP cartridge. For more details on how to add JBoss Modules to an OpenShift app deployed on the JBoss EAP cartridge, refer this OpenShift knowledge base article.wget http://sourceforge.net/projects/hibernate/files/hibernate-search/4.4.0.Final/hibernate-search-modules-4.4.0.Final-jbossas-72-dist.zip unzip hibernate-search-modules-4.4.0.Final-jbossas-72-dist.zip -d <root-of-openshift-application-git-repository>.openshift/config/modules/
-
Navigate to
<root-of-openshift-application-git-repository>
folder -
Remove the existing
src
folder andpom.xml
file.git rm -r src git rm pom.xml
-
Add the copied file to the repository, commit and push to Openshift
git add .openshift/ git add deployments/ROOT.war git commit -m "Deploy TicketMonster" git push
-
Now you can see the application running at
http://<app-name>-<domain-name>.rhcloud.com
NOTE: this version of TicketMonster uses the binary deployment style.